; ; Smaller extras for the 8K version... ; FORGET DUMP PDEF EXPLAIN ; ;-------------------------------------------------- "Loading FORGET" $PRINT CRLF ; ; FORGET DefName ; does not confirm, just does it ; DEFINE FORGET TOKEN IFZ SDIC IFZ "BAD" ELSE DUP @USR GET SUB IF<0 "NO" ELSE 4 SUB #0 PUT "OK" ENDIF ENDIF $PRINT ENDIF END ;-------------------------------------------------- "Loading DUMP" $PRINT CRLF ; ; from to DUMP ; dumps memory, 1 word per line ; DEFINE DUMP +DO INDEX DUP PNUM ": " $PRINT GET PNUM CRLF +LOOP END ;-------------------------------------------------- "Loading PDEF" $PRINT CRLF ; ; WordAdr PDEF - lists definition at WordAdr ; slightly smaller version ; OCTAL DEFINE PDEF OCTAL ;output numbers in octal DUP HEADER$ ;get header string DUP GET @ENSEC SUB IFNZ ; if (address) <> ENSEC.. $DROP ;do nothing ELSE ;otherwise list it, address still on stack.. ;no need to support listing of headerless words... ; #0 $GET 133 SUB ;check to see if headerless ("[") ; IFZ ;if headerless... ; @BLK GET S>Y ;forced end if end of dictionary ; ELSE ;if not headerless... DUP DEC GET S>Y ;put link address on Y to check ; ENDIF "OCTAL DEFINE " $PRINT $PRINT CRLF ;print DEFINE line #0 S>Z ;init line length on Z ;main loop.... DO INC DUP Y>S DUP S>Y SUB IF<0 ;if adr < link.. DUP GET ;get data at next address ;check for literal numbers and strings.. @STRING SUB IFZ ;if string... INC DUP GET DUP S>Z ;get word length, dup to Z #1 SWAP +DO INC DUP GET S>X +LOOP ;build string Z>S S>X ;complete string with word count ;code to print CRLF if req and update line len 74 $LEN 3 ADD Z>S ADD DUP S>Y SUB IF<0 CRLF $LEN 3 ADD S>Z Y>S DROP ELSE Y>S S>Z ENDIF 42 PCHR $PRINT 21040 PWRD ;print '"string" ' #0 ;keep going ELSE DUP GET @LITERAL SUB IFZ ; if number... ;code to print CRLF if req and update line len 74 7 Z>S ADD DUP S>Y SUB IF<0 CRLF 7 S>Z Y>S DROP ELSE Y>S S>Z ENDIF INC DUP GET PNUM #0 ; print # and keep going ELSE DUP GET @RTSEC SUB IFZ ; if RTSEC (END) "END" $PRINT CRLF #1 ;print END and stop ELSE DUP GET ; get address to decode... HEADER$ ; get header name of address ; string to print on X, line length on Z 74 $LEN Z>S ADD DUP S>Y ; max len, new length on stack and dup'd to Y SUB ;max - new IF<0 ;if 60-len < 0... CRLF $LEN S>Z Y>S DROP ;new Z, drop old len ELSE Y>S S>Z ;else Z=new line length ENDIF $PRINT ;print string #0 ;keep going ENDIF ; RTSEC ENDIF ; number ENDIF ; string ELSE ; if = or past next link.. "END" $PRINT CRLF 1 ;print END and stop ENDIF ; next link test UNTIL ; loop until finished Z>S DROP ; drop the line length counter Y>S DROP ; drop the link address ENDIF ; ENSEC test DROP ; drop the pointer address END ;end of definition ;-------------------------------------------------- "Loading EXPLAIN" $PRINT CRLF OCTAL DEFINE EXPLAIN ; ; EXPLAIN DefName - lists definition ; slightly smaller version ; TOKEN IFZ SDIC IFZ "BAD" $PRINT ELSE PDEF ENDIF ENDIF END ;-------------------------------------------------- "Done" $PRINT CONSOLE