From: Simone Rapisarda Subject: v04i025: mdef - Macro Definer to speed up programming v1.0, Part01/01 Newsgroups: comp.sources.hp48 Followup-To: comp.sys.hp48 Approved: spell@seq.uncwil.edu Checksum: 4035502842 (verify with brik -cv) Submitted-by: Simone Rapisarda Posting-number: Volume 4, Issue 25 Archive-name: mdef/part01 BEGIN_RDME mdef.rdm This is the macro definer I posted at the end of february to comp.sys.hp48. The doc is a little bit improved. It's written in user-RPL but it isn't painful to use. Now I don't have the time to work on the system-RPL version but someday, maybe I'll have it. Owever the time you'll have to wait for the system-RPL version is proportional in an inverse order to the number of people that will encourage me working on it (Suggestion are also welcome). ciao RAP END_RDME BEGIN_DOC mdef.doc M D E F version 1.0 by S. A. Rapisarda This is complete idiot proof macro definer written in user-RPL. It's a very useful tool to write user-RPL programs (expecially the ones that make a lot of stack manipulations) seeing immediately the consequences caused by the instructions you enter. So, while writing a program, you don't have to remember the position of each object on the stack and everything else. INSTRUCTIONS: Download the MDEF directory, enter in it and when everything is ready enter the custom menu, you will find these six labels: BEGIN Begin the macro definition. END Finish the macro definition (the macro will be pushed on the stack as a program). PAUSE Pause the macro definition (press it again to restart the definition). ADD1 Add the first level object to the macro. EDIT Edit the macro (press ENTER when finished). MDEF will record all programmable keystrokes, the non-programmable ones will be executed but not recorded. An exception is made for two keys: [STO] and [PURGE]. The corresponding instructions will no be recorded unless you reassign these instructions to the keys (the keys will loose their special LASTARG capability). NOTES: The last 22 characters of the macro are always (+/-) displayed in the top row of the display. All the variable contained in the directory are used by the custom menu: please don't execute, modify or delete them. Do not exit the user keyboard while defining a macro. These programs do COMPLETE error checking. Silly example ;) To Create a program that calculates a logarithm in any base do the following: Put the argument of the log in level two and the base in level one then press [BEGIN] [LN] [SWAP] [LN] [SWAP] [/] [END]. At the end you will find in level one the following program: \<< LN SWAP LN SWAP / \>> And in level two the log you just calculated (so you're shure that the program in level one works correctly). Ciao RAP END_DOC BEGIN_ASC mdef.asc %%HP:; "69A20FF7003000000060FD54E445542560D9D20E163278BF18B9C13CE224B2A2 D9AE1AFE22D9D204563284E2050D4143425F497632C2A207000002E0CF176BA1 B440284E2050D444943505B21305BF228DBF15DF2293632B21302A00060C854E 445542560D9D20E163278BF11C432D6E201037E1632FD33262BC1F1732D9D20C 2A2050000DBBF147A2084E201065B213076BA1FD332AC422F1732D9D203FBF18 4E2050D4449435054B2A2933A1B21305DF2278BF145632D6E20103797632DCC0 262BC1B21305DF224563284E2050D4143425F497632C2A207000002D6E201037 76BA1B440284E2050D444943505EF53293632B21301310040345434B440D9D20 E163284E204064C4147468BC1D13A2279E193632B2130E300050D44494350550 D9D20E163284E2050D4143425F478BF18B9C178BF13392010000000000001209 0DA1DBBF1C58C19C2A2485A1C2A2050000ED2A2485A19C2A24A5A193632B2130 E80004064C41474403392000000000000000001200050D4143425F450C2A2050 00081000303435453047A2047A20C2A20F000024547494E4D9D20E16323CE228 4E2040345434B4F88E1AFE22D9D20916C14563284E204064C4147497632DCC02 339201000000000000269472C1339201000000000000369472C1339201000000 0000005595D2C184E2050D444943505B21305DF2293632B2130B213047A20C2A 20B000054E444D9D20E16323CE2284E2040345434B4AFE22D9D2084E204064C4 1474F76C1C2A2070000BA84E2050D4143425F476BA1B7FC14B2A24563284E204 064C4147497632DCC02C2A20500004563284E2050D4143425F497632DCC02B21 305DF2293632B2130B213047A20C2A20F00000514553554D9D20E16323CE2284 E2040345434B4AFE22D9D203392010000000000003693CE22025C1AFE22D9D20 339201000000000000369472C184E2050D444943505B21305DF22B21305DF229 3632B2130B213047A20C2A20D000014444413D9D20E16323CE2244CF14B2A2D5 CE184E2040345434B4387E1AFE22D9D204563284E2050D4143425F497632C2A2 07000002E0CF176BA1B440284E2050D444943505B21305DF2293632B2130B213 047A20C2A20D000044943505D9D20E16323CE2284E2040345434B4AFE2284E20 50D4449435055DF2293632B2130B213047A20C2A20D000054449445D9D20E163 23CE2284E2040345434B4AFE22D9D2033920100000000000082069112C2A2050 00084E2050D4143425F478BF18B9C19C2A276BA147A2084E201065B213076BA1 76BA1FD332AC422F17323FBF15BF22D9D204563284E2050D4143425F497632DC C02B21305DF2284E2050D4449435054B2A269112B21305DF2293632B2130B213 0B2130C58B" END_ASC BEGIN_UU mdef.uue begin 644 mdef M2%!(4#0X+466*O!_``,````&WT5.5$52!ITMX&$CA_N!FQS#+D(K*IWJH>\B MG2U`92-(+E#0%#0D]91G(RPJ<```(`[\<;8:2P2"Y`(%341)4U`K,5#[(MC[ M4?TB.3:R$@.B`&#`6.1$521ET-D"'C9RN!_!--+F`@%S'C;R/2,FR_%Q(YTM MP*("!0#0NQ]T*H#D`@%6*S%PMAK?,Z),(A\WTMD"\_N!Y`(%341)4U"THI(S M&BLQ4/TBA_M!92-M+A`PEV3;"H@(' M``#2Y@(!KL40@2"Y0T$24-`7E7R,Y-K(2`S$!0#!4-+1$T-D"'C:"Y`($ M1DQ!1X;+T3$J`#``5-1$E34`6=+>!A(T@N4-`4-"3U=+@?N,EQ MN!\S*1`````````AD-`:O?O!A1S)HD)8&BPJ4```WJ)"6!K)HD):&CDVLA(# MC@!`8,04=$0PDP(``````````"$`4-`4-"3U5,"B`@4`@`$``T-35`-T*D"G M`BPJ\```0D5'24Z=+>!A(\,N@N0"!$-%0TN/Z*'O(ITMD&$<5#:"Y`($1DQ! M1WDVTLP@,RD0````````8DDG'#,I$````````&-))QPS*1````````!562T< M2"Y0T$24-`6U$@/5+Y)C(RLQL!(#="K`H@(+`%#D1-39`AXV,NPB2"Y`,%0T MM*3O(ITM@.0"!$9,04=_QL&B`@<`L(KD`@5-04-23V>KL?<A[R*=+4!E(T@N M4-`4-"3UE&> } { "END" \<< IF CECK THEN FLAG STOF "\<<" MACRO + OBJ\-> 0 'FLAG' STO "" 'MACRO' STO END \>> } { "PAUSE" \<< IF CECK THEN -63 IF FC?C THEN -63 SF MDISP END END \>> } { "ADD1" \<< IF DEPTH 0 > CECK AND THEN 'MACRO' " " ROT + STO+ MDISP END \>> } { "DISP" \<< IF CECK THEN MDISP END \>> } { "EDIT" \<< IF CECK THEN 28 MENU "" MACRO DUP SIZE 1 + { V } + + IFERR INPUT THEN DROP2 ELSE 'MACRO' STO END MDISP 0 MENU END \>> } } MACRO "" FLAG 0 MDISP \<< MACRO DUP SIZE DUP 21 - SWAP SUB 1 DISP "" 2 DISP 1 FREEZE \>> CECK \<< FLAG TYPE 5 == \>> \GaENTER \<< DUP \-> s \<< IFERR STR\-> THEN "" SWAP { V } + IFERR INPUT THEN DROP2 MDISP 0 DOERR END DUP 's' STO STR\-> END 'MACRO' " " s + STO+ MDISP \>> \>> \GbENTER \<< DUP SIZE IF 0 \=/ THEN 'MACRO' " " ROT + STO+ MDISP ELSE DROP END \>> END END_RPL -- WolfNet BBS Pisa (Italy) Tel. +39-50-589050 300-14.4K Baud Matrix 2:332/602.0 Simone Rapisarda - via FidoNet node 2:33/800 UUCP: ...!gear!wolf!800.10!Simone.Rapisarda ARPA: Simone.Rapisarda@p10.f800.n33.z2.fidonet.org