Classic Computer Magazine Archive PROGRAM LISTING: 84-03/DISASM.4TH


SCR #30
   0 ( FORTH DISASSEMBLER ANTIC 3/84 )
   1 HEX 0 VARIABLE MULTIMODE -2 ALLOT
   2 1D , 1E , 3C , 3D , 3E , 5C ,
   3 5D , 5E , 7D , 7E , 9C , 9D ,
   4 9E , BC , BD , BE , DC , DD ,
   5 DE , FC , FD , FE ,
   6
   7 : SEARCH 1 + 0 DO OVER OVER I 2
   8     * + C@ - DUP 0= IF DROP
   9     DROP DROP I 1 LEAVE ELSE
  10     0 IF DROP DROP I 0 LEAVE
  11     ENDIF ENDIF LOOP ;
  12
  13 0< VARIABLE POINTER
  14
  15 -->



SCR #31
   0 : STRING ( COMPILE TEXT )
   1     BL BLK @ IF BLK @ BLOCK ELSE
   2     TIB @ ENDIF IN @ + SWAP
   3     ENCLOSE IN +! OVER - >R +
   4     HERE R CMOVE R> ALLOT ;
   5
   6 0 VARIABLE MULTINAME -2 ALLOT
   7
   8 STRING ORAASLBITANDROLJMPEORLSR
   9 STRING ADCRORSTYSTASTXLDYLDALDX
  10 STRING CPYCMPDECCPXSBCINC
  11
  12 : CHKMODE DROP DUP 2 * '
  13     MULTIMODE + @ POINTER @ C@ -
  14     4 /MOD SWAP IF SWAP 1+ SWAP
  15     ENDIF ;   -->



SCR #32
   0 0 VARIABLE ONEMODE -2 ALLOT
   1 2C00 , 2C08 , 280A , 3010 ,
   2 2C18 , 1020 , 2C28 , 282A ,
   3 3030 , 2C38 , 2C40 , 2C48 ,
   4 284A , 3050 , 2C58 , 2C60 ,
   5 2C68 , 286A , 246C , 3070 ,
   6 2C78 , 2C88 , 2C8A , 3090 ,
   7 2096 , 2C98 , 2C9A , 14A0 ,
   8 14A2 , 2CA8 , 2CAA , 30B0 ,
   9 20B6 , 2CB8 , 2CBA , 04BE ,
  10 2CC8 , 2CCA , 30D0 , 2CD8 ,
  11 2CE8 , 2CEA , 30F0 , 2CF8 ,
  12 00FF , ( 00FF IS A DUMMY )
  13
  14
  15 -->



SCR #33
   0 0 VARIABLE ONENAME -2 ALLOT
   1 STRING BRKPHPASLBPLCLCJSRPLPROL
   2 STRING BMISECRTIPHALSRBVCCLIRTS
   3 STRING PLARORJMPBVSSEIDEYTXABCC
   4 STRING STXTYATXSLDYLDXTAYTAXBCS
   5 STRING LDXCLVTSXLDXINYDEXBNECLD
   6 STRING INXNOPBEQSED???
   7
   8 0 VARIABLE MODE -2 ALLOT
   9 STRING ,X,Y,X)Y..##0PX).Y().AIMRE
  10
  11 0 VARIABLE LENGTH -2 ALLOT
  12 2 C, 2 C, 1 C, 1 C, 2 C, 1 C,
  13 1 C, 1 C, 1 C, 2 C, 0 C, 0 C,
  14 1 C, 0 C,
  15 -->



SCR #34
   0 : PRINTNAME SPACE SWAP 3 * +
   1             3 TYPE 2 SPACES ;
   2
   3 : PRINTMODE 2 * ' MODE + 2 TYPE
   4             2 SPACES ;
   5
   6 : PRINTADD POINTER @ C@ DUP 20
   7     = OVER 40 = OR OVER 4C = OR
   8     OVER 60 = OR SWAP 6C = OR
   9     SWAP ' LENGTH + C@ 1 POINTER
  10     +! POINTER @ OVER POINTER +!
  11     OVER 0= IF DROP DROP ELSE
  12     OVER 1 = IF C@ . DROP ELSE
  13     @ 0 D. DROP ENDIF ENDIF ;
  14
  15 -->



SCR #35
   0 : DISASSEMBLE POINTER ! CR
   1   BEGIN CR
   2     POINTER @ DUP 0 D. 2 SPACES
   3     C@ ' ONEMODE 2D SEARCH
   4       IF ( FOUND ) DUP ' ONENAME
   5          PRINTNAME 2 * 1+ '
   6          ONEMODE + C@ 4 /
   7       ELSE ( NOT ) DROP POINTER @
   8          C@ ' MULTIMODE 16 SEARCH
   9          CHKMODE CHKMODE CHKMODE
  10          SWAP ' MULTINAME
  11          PRINTNAME ENDIF
  12     DUP PRINTMODE PRINTADD
  13     ?TERMINAL OR
  14   UNTIL ;
  15 : DIS DISASSEMBLE ;

Back to previous page