Previous | Contents | Next

DISASM

NEW ROM

This is my implementation of the author's disassembler algorithm as detailed in chapter 16 but with the following modifications:

  • Included code to validate prefixed instructions.
  • Implemented table "n" and the RST and IM inline tables in code.
  • Represented the V, X and Y placeholders with inverse equivalents.
  • Represented the VV placeholder with an inverse W.
  • Represented the V placeholder for relative offsets with an inverse Z.
Program Organisation
If you are up to the challenge of typing this in then I suggest
that you use HEXLD3E (sif-hexld3e.p) that has its machine code
located between 6400h and 6737h (RAMTOP should be set to 6400h).

I am writing this to address 6738h directly following HEXLD3E's
machine code, but there is no requirement for this program to be
written to any specific memory address because it's relocatable.
If you look at the addresses listed down the side you'll see
that they are offsets and are there for reference purposes. If
you are going to type this in then all that you need to do is to
enter the hex codes as shown and follow the instructions in the
next paragraph.

When calling this for the first time, place the absolute address
of offset 000A into offset 0002, the address of the byte to be
disassembled into ADDRESS and then CALL offset 0000 e.g. you
write this to 6738h, and so you write 6742h to 673A (it would be
stored as 4267h, little endian). The program will perform some
relocation if necessary and then jump to the start point DISASM.

The program will disassemble the byte or sequence of bytes at the
address held in ADDRESS and will build strings at these offsets:
DISADDR "019F " (5 chars)
DISBYTS "01E5FF   " (9 chars)
DIS     "LD BC,FFE5",FF (up to 18 chars plus a terminating FF)
Invalid prefixed instructions will disassemble to a single data
byte and DIS will be FF i.e. empty. On completion ADDRESS holds
the address of the next byte to disassemble.

Program Listing
; FUNCTIONS
; On entry: A = 01 for GETADDR - get address of offset 0000
;             which is used to create absolute addresses so
;             that they don't need to be hard coded
;           A = 02 for DISADDF - add following string to DIS
;             D = zero based index of FF terminated string
;             within an FE terminated list following the CALL
;           A = 03 for DISADDB - add byte to DIS
;             D = a byte
;           A = 04 for DISADDW - add word to DIS
;             DE = a word (written ED)
;           A = 05 for DISADDT - add string from table to DIS
;             D = zero based index of FF terminated string
;             contained within one of the tables TBLC/R/S/Q/X
;             E = zero based id of table
;           A = 06 for DISINSB - insert byte into DIS
;             D = a byte
;             E = the offset within DIS to place the byte
;           A = 07 for DISREPBWS - replace byte with string
;             D = zero based index of FF terminated string
;             within an FE terminated list following the CALL
;             E = the byte to replace
;           A = 08 for HEXTOCHAR - convert D to chars in DE
;             D = a byte to convert to Sinclair characters
;           A = 09 for GETCURBYT - gets byte at ADDRESS+BYTCNT
;           A = 0A for GETPREBYT - gets byte at ADDRESS+BYTCNT-1
;  On exit: GETADDR returns the address of offset 0000 in HL
;           HEXTOCHAR returns two chars in DE (written DE)
;           GETCURBYT returns byte in A
;           GETPREBYT returns byte in A

0000: AF                  XOR A
0001: CD0A00    FUNCTIONS CALL 000A
0004: C9                  RET
0005: 292E38    PROGID    DEFB "DIS"
0008: 960B      PROGLEN   DEFW 0B96
000A: FE00                CP 00
      2037                JR NZ,SF1
      E1        RELOCATE  POP HL              Get address of 0004.
      E5                  PUSH HL
      2B                  DEC HL
      2B                  DEC HL
      2B                  DEC HL
      E5                  PUSH HL
      D1                  POP DE              DE = FUNCTIONS address.
      2B                  DEC HL
      01DA0A              LD BC,RELOCTBL
      09                  ADD HL,BC           HL = RELOCTBL address.
      3E5E                LD A,RELOCTBLITEMS
      F5        L0        PUSH AF             Save RELOCTBLITEMS.
      4E                  LD C,(HL)           Get RELOCTBL item low.
      23                  INC HL
      46                  LD B,(HL)           Get RELOCTBL item high.
      23                  INC HL
      E5                  PUSH HL             Save RELOCTBL position.
      C5                  PUSH BC
      E1                  POP HL              HL = RELOCTBL item.
      19                  ADD HL,DE           Convert item's offset
      2B                  DEC HL              to program address.
      7E                  LD A,(HL)           Get program address low.
      23                  INC HL
      BB                  CP E
      2008                JR NZ,L1            No match so update it.
      7E                  LD A,(HL)           Get program address high.
      BA                  CP D
      2004                JR NZ,L1            No match so update it.
      E1                  POP HL              This address was found
      F1                  POP AF              to be up-to-date so no
      1808                JR L2               point in continuing.
      72        L1        LD (HL),D           Store address of
      2B                  DEC HL              FUNCTIONS.
      73                  LD (HL),E
      E1                  POP HL              Retrieve RELOCTBL pos.
      F1                  POP AF              Retrieve RELOCTBLITEMS.
      3D                  DEC A
      20E1                JR NZ,L0
      3E01      L2        LD A,01             Select GETADDR.
      CD0100              CALL FUNCTIONS
      016302              LD BC,DISASM
      09                  ADD HL,BC
      E9                  JP (HL)             Jump to DISASM.
0045: FE01      SF1       CP 01
      2007                JR NZ,SF2
      E1        GETADDR   POP HL              Get address of 0004.
      E5                  PUSH HL
      2B                  DEC HL
      2B                  DEC HL
      2B                  DEC HL
      2B                  DEC HL              Return HL = address
      C9                  RET                 of offset 0000.
0050: FE02      SF2       CP 02
      202F                JR NZ,SF3
      3E01      DISADDF   LD A,01             Select GETADDR.
      CD0100              CALL FUNCTIONS
      010502              LD BC,DIS           Convert offset DIS to
      09                  ADD HL,BC           an absolute address.
      C1                  POP BC              Discard most recent PC.
      C1                  POP BC              Retrieve list address.
      7E        L0        LD A,(HL)           Locate end of DIS.
      FEFF                CP FF
      2803                JR Z,L1
      23                  INC HL
      18F8                JR L0
      14        L1        INC D               INC as we test first.
      15        L2        DEC D               Point to Dth item in list.
      2808                JR Z,L4
      0A        L3        LD A,(BC)
      03                  INC BC              I'm not testing for FE as
      FEFF                CP FF               I'm expecting valid lists.
      20FA                JR NZ,L3
      18F5                JR L2               Next item.
      0A        L4        LD A,(BC)           Copy string from list
      03                  INC BC              and append to DIS.
      77                  LD (HL),A           Copy from (BC) to (HL).
      23                  INC HL
      FEFF                CP FF
      20F8                JR NZ,L4
      0A        L5        LD A,(BC)           Locate end of list.
      03                  INC BC
      FEFE                CP FE               FE is list end so exit.
      20FA                JR NZ,L5
      C5                  PUSH BC             Return to instruction
      C9                  RET                 following list.
0083: FE03      SF3       CP 03
      2016                JR NZ,SF4
      3E01      DISADDB   LD A,01             Select GETADDR.
      CD0100              CALL FUNCTIONS
      010502              LD BC,DIS           Convert offset DIS to
      09                  ADD HL,BC           an absolute address.
      7E        L0        LD A,(HL)           Locate end of DIS.
      FEFF                CP FF
      2803                JR Z,L1
      23                  INC HL
      18F8                JR L0
      72        L1        LD (HL),D           Write D.
      23                  INC HL
      36FF                LD (HL),FF          Terminate with FF.
      C9                  RET
009D: FE04      SF4       CP 04
      200E                JR NZ,SF5
      D5        DISADDW   PUSH DE
      53                  LD D,E
      3E03                LD A,03             Select DISADDB.
      CD0100              CALL FUNCTIONS      Write E.
      D1                  POP DE
      3E03                LD A,03             Select DISADDB.
      CD0100              CALL FUNCTIONS      Write D.
      C9                  RET
00AF: FE05      SF5       CP 05
      2056                JR NZ,SF6
      7B        DISADDT   LD A,E
      FE00                CP 00
      2005                JR NZ,L1
      019101              LD BC,TBLC          TBLC
      181E                JR L5
      FE01      L1        CP 01
      2005                JR NZ,L2
      01A501              LD BC,TBLR          TBLR
      1815                JR L5
      FE02      L2        CP 02
      2005                JR NZ,L3
      01B501              LD BC,TBLS          TBLS
      180C                JR L5
      FE03      L3        CP 03
      2005                JR NZ,L4
      01C001              LD BC,TBLQ          TBLQ
      1803                JR L5
      01CB01    L4        LD BC,TBLX          TBLX
      3E01      L5        LD A,01             Select GETADDR.
00DD: CD0100              CALL FUNCTIONS      Convert table offset to
      09                  ADD HL,BC           an absolute address.
      E5                  PUSH HL             Preserve table address.
      3E01                LD A,01             Select GETADDR.
      CD0100              CALL FUNCTIONS
      010502              LD BC,DIS           Convert offset DIS to
      09                  ADD HL,BC           an absolute address.
      C1                  POP BC              Retrieve table address.
      7E        L0        LD A,(HL)           Locate end of DIS.
      FEFF                CP FF
      2803                JR Z,L1
      23                  INC HL
      18F8                JR L0
      14        L1        INC D               INC as we test first.
      15        L2        DEC D               Point to Dth item in list.
      2808                JR Z,L4
      0A        L3        LD A,(BC)
      03                  INC BC
      FEFF                CP FF
      20FA                JR NZ,L3
      18F5                JR L2               Next item.
      0A        L4        LD A,(BC)           Copy string from list
      03                  INC BC              and append to DIS.
      77                  LD (HL),A           Copy from (BC) to (HL).
      23                  INC HL
      FEFF                CP FF
      20F8                JR NZ,L4
      C9                  RET
0109: FE06      SF6       CP 06
      202D                JR NZ,SF7
      3E01      DISINSB   LD A,01             Select GETADDR.
      CD0100              CALL FUNCTIONS
      010502              LD BC,DIS           Convert offset DIS to
      09                  ADD HL,BC           an absolute address.
      7B                  LD A,E
      FE00      L0        CP 00
      2804                JR Z,L1
      23                  INC HL              Advance to offset E
      3D                  DEC A               within DIS.
      18F8                JR L0
      E5        L1        PUSH HL
      C1                  POP BC              BC = insertion point.
      7E        L2        LD A,(HL)           Locate end of DIS.
      FEFF                CP FF
      2803                JR Z,L3
      23                  INC HL
      18F8                JR L2
      23        L3        INC HL
      77                  LD (HL),A           Move byte forward.
      2B                  DEC HL
      7D                  LD A,L 
      B9                  CP C
      2004                JR NZ,L4
      7C                  LD A,H              Have we ventured back
      B8                  CP B                to the insertion point?
      2804                JR Z,L5
      2B        L4        DEC HL              Move back through DIS.
      7E                  LD A,(HL)
      18F1                JR L3
      72        L5        LD (HL),D           Insert byte.
      C9                  RET
013A: FE07      SF7       CP 07
      2046                JR NZ,SFMORE
      3E01      DISREPBWS LD A,01             Select GETADDR.
      CD0100              CALL FUNCTIONS
      C1                  POP BC              Discard most recent PC.
      010502              LD BC,DIS           Convert offset DIS to
      09                  ADD HL,BC           an absolute address.
      43                  LD B,E
      1E00                LD E,00             This will be the offset
      7E        L0        LD A,(HL)           for DISINSB.
      B8                  CP B                Find byte to replace.
      2809                JR Z,L1
      23                  INC HL
      1C                  INC E
      FEFF                CP FF
      20F6                JR NZ,L0
      C1                  POP BC              Retrieve list address.
      1824                JR L6               Didn't find byte in DIS.
0158: C1        L1        POP BC              Retrieve list address.
      14                  INC D               INC as we test first.
      15        L2        DEC D               Point to Dth item in list.
      2808                JR Z,L4
      0A        L3        LD A,(BC)
      03                  INC BC              I'm not testing for FE as
      FEFF                CP FF               I'm expecting valid lists.
      20FA                JR NZ,L3
      18F5                JR L2               Next item.
      0A        L4        LD A,(BC)           Copy across and overwrite
      FEFF                CP FF               initial byte if not FF.
      2812                JR Z,L6             Null string found.
      77                  LD (HL),A
      03        L5        INC BC              Insert rest of string.
      1C                  INC E
      0A                  LD A,(BC)
      FEFF                CP FF               String was only 1 byte
      280A                JR Z,L6             in length.
      C5                  PUSH BC
      57                  LD D,A
      3E06                LD A,6              Select DISINSB.
0176: CD0100              CALL FUNCTIONS
      C1                  POP BC
      18EF                JR L5
      0A        L6        LD A,(BC)           Locate end of list.
      03                  INC BC
      FEFE                CP FE               FE is list end so exit.
      20FA                JR NZ,L6
      C5                  PUSH BC             Return to instruction
      C9                  RET                 following list.
0184: F5        SFMORE    PUSH AF             No more room up here so
      C5                  PUSH BC             we'll add a few more
      E5                  PUSH HL             functions at the end.
      3E01                LD A,01             Select GETADDR.
0189: CD0100              CALL FUNCTIONS
      01980A              LD BC,MOREFUNCS     Convert offset MOREFUNCS
      09                  ADD HL,BC           to an absolute address.
      E9                  JP (HL)             Jump to MOREFUNCS.

0191: 333FFF    TBLC      DEFB "NZ" FF
      3FFF                DEFB "Z" FF
      3328FF              DEFB "NC" FF
      28FF                DEFB "C" FF
      3534FF              DEFB "PO" FF
      352AFF              DEFB "PE" FF
      35FF                DEFB "P" FF
      32FF                DEFB "M" FF

01A5: 27FF      TBLR      DEFB "B" FF
      28FF                DEFB "C" FF
      29FF                DEFB "D" FF
      2AFF                DEFB "E" FF
      2DFF                DEFB "H" FF
      31FF                DEFB "L" FF
      BDFF                DEFB "X" FF         Inverse X.
      26FF                DEFB "A" FF

01B5: 2728FF    TBLS      DEFB "BC" FF
      292AFF              DEFB "DE" FF
      BEFF                DEFB "Y" FF         Inverse Y.
      3835FF              DEFB "SP" FF

01C0: 2728FF    TBLQ      DEFB "BC" FF
      292AFF              DEFB "DE" FF
      BEFF                DEFB "Y" FF         Inverse Y.
      262BFF              DEFB "AF" FF

01CB: 26292900261AFF TBLX DEFB "ADD A," FF
      26292800261AFF      DEFB "ADC A," FF
      383A2700FF          DEFB "SUB " FF
      38272800261AFF      DEFB "SBC A," FF
      26332900FF          DEFB "AND " FF
      3D343700FF          DEFB "XOR " FF
      343700FF            DEFB "OR " FF
      283500FF            DEFB "CP " FF

01F7: 00 * 5    DISADDR   DEFB 00 * 5         "4082 "
01FC: 00 * 9    DISBYTS   DEFB 00 * 9         "213A67   "
0205: FF * 19   DIS       DEFB FF * 19        "LD HL,673A",FF ...

0218: 00        CLASS     DEFB 00
      00        INDEX     DEFB 00
      00        FPART     DEFB 00
      00        GPART     DEFB 00
      00        HPART     DEFB 00
      00        JPART     DEFB 00
      00        KPART     DEFB 00
021F: 0000      ADDRESS   DEFW 0000
      00        BYTCNT    DEFB 00
      00        SPARE     DEFB 00

;                   After DD/FD ED alternating bits   Opcodes
0223: 00        VALIDS    DEFB 0 0 0 0-0 0 0 0        00 01 02 03
      00                  DEFB 0 0 0 0-0 0 0 0        04 05 06 07
      20                  DEFB 0 0 1 0-0 0 0 0        08 09 0A 0B
      00                  DEFB 0 0 0 0-0 0 0 0        0C 0D 0E 0F

      00                  DEFB 0 0 0 0-0 0 0 0        10 11 12 13
      00                  DEFB 0 0 0 0-0 0 0 0        14 15 16 17
      20                  DEFB 0 0 1 0-0 0 0 0        18 19 1A 1B
      00                  DEFB 0 0 0 0-0 0 0 0        1C 1D 1E 1F

      2A                  DEFB 0 0 1 0-1 0 1 0        20 21 22 23
      00                  DEFB 0 0 0 0-0 0 0 0        24 25 26 27
      2A                  DEFB 0 0 1 0-1 0 1 0        28 29 2A 2B
      00                  DEFB 0 0 0 0-0 0 0 0        2C 2D 2E 2F

      00                  DEFB 0 0 0 0-0 0 0 0        30 31 32 33
      A8                  DEFB 1 0 1 0-1 0 0 0        34 35 36 37
      20                  DEFB 0 0 1 0-0 0 0 0        38 39 3A 3B
      00                  DEFB 0 0 0 0-0 0 0 0        3C 3D 3E 3F

      55                  DEFB 0 1 0 1-0 1 0 1        40 41 42 43
      5D                  DEFB 0 1 0 1-1 1 0 1        44 45 46 47
      55                  DEFB 0 1 0 1-0 1 0 1        48 49 4A 4B
      19                  DEFB 0 0 0 1-1 0 0 1        4C 4D 4E 4F

      55                  DEFB 0 1 0 1-0 1 0 1        50 51 52 53
      0D                  DEFB 0 0 0 0-1 1 0 1        54 55 56 57
      55                  DEFB 0 1 0 1-0 1 0 1        58 59 5A 5B
      0D                  DEFB 0 0 0 0-1 1 0 1        5C 5D 5E 5F

      54                  DEFB 0 1 0 1-0 1 0 0        60 61 62 63
      09                  DEFB 0 0 0 0-1 0 0 1        64 65 66 67
      54                  DEFB 0 1 0 1-0 1 0 0        68 69 6A 6B
      09                  DEFB 0 0 0 0-1 0 0 1        6C 6D 6E 6F

      AF                  DEFB 1 0 1 0-1 1 1 1        70 71 72 73
      A2                  DEFB 1 0 1 0-0 0 1 0        74 75 76 77
      55                  DEFB 0 1 0 1-0 1 0 1        78 79 7A 7B
      08                  DEFB 0 0 0 0-1 0 0 0        7C 7D 7E 7F

      00                  DEFB 0 0 0 0-0 0 0 0        80 81 82 83
      08                  DEFB 0 0 0 0-1 0 0 0        84 85 86 87
      00                  DEFB 0 0 0 0-0 0 0 0        88 89 8A 8B
      08                  DEFB 0 0 0 0-1 0 0 0        8C 8D 8E 8F

      00                  DEFB 0 0 0 0-0 0 0 0        90 91 92 93
      08                  DEFB 0 0 0 0-1 0 0 0        94 95 96 97
      00                  DEFB 0 0 0 0-0 0 0 0        98 99 9A 9B
      08                  DEFB 0 0 0 0-1 0 0 0        9C 9D 9E 9F

      55                  DEFB 0 1 0 1-0 1 0 1        A0 A1 A2 A3
      08                  DEFB 0 0 0 0-1 0 0 0        A4 A5 A6 A7
      55                  DEFB 0 1 0 1-0 1 0 1        A8 A9 AA AB
      08                  DEFB 0 0 0 0-1 0 0 0        AC AD AE AF

      55                  DEFB 0 1 0 1-0 1 0 1        B0 B1 B2 B3
      08                  DEFB 0 0 0 0-1 0 0 0        B4 B5 B6 B7
      55                  DEFB 0 1 0 1-0 1 0 1        B8 B9 BA BB
      08                  DEFB 0 0 0 0-1 0 0 0        BC BD BE BF

      00                  DEFB 0 0 0 0-0 0 0 0        C0 C1 C2 C3
      00                  DEFB 0 0 0 0-0 0 0 0        C4 C5 C6 C7
      00                  DEFB 0 0 0 0-0 0 0 0        C8 C9 CA CB
      00                  DEFB 0 0 0 0-0 0 0 0        CC CD CE CF

      00                  DEFB 0 0 0 0-0 0 0 0        D0 D1 D2 D3
      00                  DEFB 0 0 0 0-0 0 0 0        D4 D5 D6 D7
      00                  DEFB 0 0 0 0-0 0 0 0        D8 D9 DA DB
      00                  DEFB 0 0 0 0-0 0 0 0        DC DD DE DF

      22                  DEFB 0 0 1 0-0 0 1 0        E0 E1 E2 E3
      20                  DEFB 0 0 1 0-0 0 0 0        E4 E5 E6 E7
      22                  DEFB 0 0 1 0-0 0 1 0        E8 E9 EA EB
      00                  DEFB 0 0 0 0-0 0 0 0        EC ED EE EF

      00                  DEFB 0 0 0 0-0 0 0 0        F0 F1 F2 F3
      00                  DEFB 0 0 0 0-0 0 0 0        F4 F5 F6 F7
      20                  DEFB 0 0 1 0-0 0 0 0        F8 F9 FA FB
      00                  DEFB 0 0 0 0-0 0 0 0        FC FD FE FF

0263: 3E01      DISASM    LD A,01             Select GETADDR.
      CD0100              CALL FUNCTIONS
      010502              LD BC,DIS           Convert offset DIS to
      09                  ADD HL,BC           an absolute address.
      36FF                LD (HL),FF          Reset DIS string.
      3E01                LD A,01             Select GETADDR.
      CD0100              CALL FUNCTIONS
      011802              LD BC,CLASS         Convert offset CLASS to
      09                  ADD HL,BC           an absolute address.
      3600                LD (HL),00          Reset CLASS.
      23                  INC HL
      3600                LD (HL),00          Reset INDEX.
      010600              LD BC,0006          Create ADDRESS address.
      09                  ADD HL,BC
      5E                  LD E,(HL)
      23                  INC HL
      56                  LD D,(HL)           DE = address at ADDRESS.

0283: D5        VALIDCHK  PUSH DE             Because the disassembler
      E1                  POP HL              algorithm mixes INDEXes,
      7E                  LD A,(HL)           prefixed instructions
      FECB                CP CB               must be validated first.
      2019                JR NZ,L1            Is it CBxx?
      23                  INC HL
      7E                  LD A,(HL)           Validate next byte.
      E6F0                AND F0
      FE30                CP 30               Filter out 30 to 37 as
      207A                JR NZ,SETFGHJK      they are the only invalid
      7E                  LD A,(HL)           instructions after CB.
      E608                AND 08
      FE08                CP 08
      2873                JR Z,SETFGHJK
0299: 3E01      L0        LD A,01             Select GETADDR.
      CD0100              CALL FUNCTIONS
      010009              LD BC,COMPFINAL     Convert offset COMPFINAL
      09                  ADD HL,BC           to an absolute address.
      E9                  JP (HL)             Jump to COMPFINAL.
02A3: FEDD      L1        CP DD               Is it DDCBddxx or
      2804                JR Z,L2             FDCBddxx?
      FEFD                CP FD
      2019                JR NZ,L3
02AB: 23        L2        INC HL
      7E                  LD A,(HL)           Validate next byte.
      FECB                CP CB
      2013                JR NZ,L3
      23                  INC HL              Point past displacement.
      23                  INC HL
      7E                  LD A,(HL)           Validate next byte.
      FE36                CP 36               Valid instructions are ?6
      28E1                JR Z,L0             and ?E except 36 only.
      E60F                AND 0F
      FE06                CP 06
      284E                JR Z,SETFGHJK
      FE0E                CP 0E
      284A                JR Z,SETFGHJK
      18D5                JR L0
02C4: D5        L3        PUSH DE             Prepare to use the VALIDS
      E1                  POP HL              table.
      0E00                LD C,00
      7E                  LD A,(HL)
      FEDD                CP DD               Is it DDxx?
      2804                JR Z,L4
      FEFD                CP FD               Is it FDxx?
      2003                JR NZ,L5
02D1: 0C        L4        INC C               DD and FD need an extra
      1804                JR L6               shift right.
02D4: FEED      L5        CP ED               Is it EDxx?
      2034                JR NZ,SETFGHJK      Must be ordinary then.
02D8: 23        L6        INC HL
      7E                  LD A,(HL)           Retrieve relevant bit
      CB2F                SRA A               from VALIDS table.
      CB2F                SRA A
      E63F                AND 3F              Erase top 2 bits.
      47                  LD B,A              Save VALIDS offset.
      3C                  INC A               To-
      CB27                SLA A               calculate-
      CB27                SLA A               shift-
      96                  SUB (HL)            right-
      3D                  DEC A               amount:
      CB27                SLA A               ((byte/4+1)*4-byte-1)*2
      81                  ADD A,C             Then add C from earlier.
      4F                  LD C,A              Final shift right value.
      C5                  PUSH BC
      3E01                LD A,01             Select GETADDR.
02EF: CD0100              CALL FUNCTIONS
      012302              LD BC,VALIDS        Convert offset VALIDS to
      09                  ADD HL,BC           an absolute address.
      C1                  POP BC
      C5                  PUSH BC
      48                  LD C,B
      0600                LD B,00             Add table offset that
      09                  ADD HL,BC           was saved earlier.
      C1                  POP BC
      7E                  LD A,(HL)           Get byte from VALIDS.
      0C                  INC C               Add 1 as we test first.
02FF: 0D        L7        DEC C
      2804                JR Z,L8
      CB2F                SRA A               Shift A right by C bits.
      18F9                JR L7
0306: E601      L8        AND 01              Isolate bit 0.
      FE00                CP 00               Is instruction invalid?
      288D                JR Z,L0             All that work for 1 bit!
                
030C: 3E01      SETFGHJK  LD A,01             Select GETADDR.
      CD0100              CALL FUNCTIONS
      011C02              LD BC,HPART         Convert offset HPART
      09                  ADD HL,BC           to an absolute address.
      1A                  LD A,(DE)           Calculate H part.
      F5                  PUSH AF
      E607                AND 07
      77                  LD (HL),A           Store H part.
      F1                  POP AF      
      CB3F                SRL A               Calculate G part.
      CB3F                SRL A
      CB3F                SRL A
      F5                  PUSH AF
      E607                AND 07
      2B                  DEC HL              Create GPART address.
      77                  LD (HL),A           Store G part.
      F5                  PUSH AF             Push G part.
      E601                AND 01              Calculate K part.
      23                  INC HL              Create KPART address.
      23                  INC HL
      23                  INC HL
      77                  LD (HL),A           Store K part.
      F1                  POP AF              Pop G part.
      CB3F                SRL A               Calculate J part.
      2B                  DEC HL              Create JPART address.
      77                  LD (HL),A           Store J part.
      F1                  POP AF
      CB3F                SRL A               Calculate F part.
      CB3F                SRL A
      CB3F                SRL A
      2B                  DEC HL              Create FPART address.
      2B                  DEC HL
      2B                  DEC HL
      77                  LD (HL),A           Store F part.

033D: 3E01      SETIDXCLS LD A,01             Select GETADDR.
      CD0100              CALL FUNCTIONS
      011802              LD BC,CLASS         Convert offset CLASS to
      09                  ADD HL,BC           an absolute address.
      E5                  PUSH HL             HL holds CLASS address.
      C1                  POP BC
      03                  INC BC              BC holds INDEX address.
      7E                  LD A,(HL)
      FE00      ISCLS0    CP 00               Is CLASS 0?
      280D                JR Z,CLSIS0
034E: E5                  PUSH HL
      C5                  PUSH BC
      3E01                LD A,01             Select GETADDR.
      CD0100              CALL FUNCTIONS
      012407              LD BC,ISCLS1        Convert offset ISCLS1
      09                  ADD HL,BC           to an absolute address.
      C1                  POP BC              HL is popped after jump.
      E9                  JP (HL)             Jump to ISCLS1.
035B: 1A        CLSIS0    LD A,(DE)           Get byte to disassemble.
      FECB                CP CB               Is byte CB?
      2015                JR NZ,ISIDX0
      0A                  LD A,(BC)
      FE00                CP 00               Is INDEX 0?
      2801                JR Z,L0
      13                  INC DE              Jump over displacement.
      3601      L0        LD (HL),01          Set CLASS to 1.
      13                  INC DE              Point to next byte.
      18A1                JR SETFGHJK         Get and split next byte.

036B: 00 * 10             DEFB 00 * 10        Spare.

0375: 0A        ISIDX0    LD A,(BC)
      FE00                CP 00               Is INDEX 0?
      201E                JR NZ,CLS0CONT
037A: 1A                  LD A,(DE)           Get byte to disassemble.
      FEED                CP ED               Is byte ED?
      2005                JR NZ,ISBYTDD
037F: 3602                LD (HL),02          Set CLASS to 2.
      13                  INC DE              Point to next byte.
      1888                JR SETFGHJK         Get and split next byte.
0384: FEDD      ISBYTDD   CP DD               Is byte DD?
      2006                JR NZ,ISBYTFD
0388: 3E01                LD A,1
      02                  LD (BC),A           Set INDEX to 1.
      13                  INC DE              Point to next byte.
      18F4                JR SETFGHJK         Get and split next byte.
038E: FEFD      ISBYTFD   CP FD               Is byte FD?
      2006                JR NZ,CLS0CONT
0392: 3E02                LD A,2
      02                  LD (BC),A           Set INDEX to 2.
      13                  INC DE              Point to next byte.
      18F4                JR SETFGHJK         Get and split next byte.

0398: 03        CLS0CONT  INC BC              Point to FPART.
      0A                  LD A,(BC)           Get F part.
      FE00                CP 00               Is F 0?
      2054                JR NZ,CLS0ISF1
039E: 03                  INC BC
      03                  INC BC              Point to HPART.
      0A                  LD A,(BC)           Get H part.
      FE00                CP 00               Is H 0?
      204F                JR NZ,CLS0F0ISH1
03A5: 0B                  DEC BC              Point to GPART.
      0A                  LD A,(BC)           Get G part.
      FE04                CP 04               Is G <4?
      3023                JR NC,CLS0F0H0GGT3
03AB: 57                  LD D,A              Select Gth item.
      3E02                LD A,02             Select DISADDF.
      CD0100              CALL FUNCTIONS
      333435FF            DEFB "NOP" FF
      2A3D00262B1A262B0BFF DEFB "EX AF,AF"" FF
      292F333F00BFFF      DEFB "DJNZ Z" FF    Inverse Z.
      2F3700BFFF          DEFB "JR Z" FF      Inverse Z.
      FE                  DEFB FE
      1822                JR COMPFINAL
03CE: C5     CLS0F0H0GGT3 PUSH BC             Preserve GPART.
      1600                LD D,00             Select list item 0.
      3E02                LD A,02             Select DISADDF.
      CD0100              CALL FUNCTIONS
      2F3700FFFE          DEFB "JR " FF FE
      C1                  POP BC              Retrieve GPART.
      0A                  LD A,(BC)           Get G part.
      D604                SUB 04
      57                  LD D,A
      1E00                LD E,00             Select TBLC.
      3E05                LD A,05             Select DISADDT.
03E4: CD0100              CALL FUNCTIONS
      1E1A                LD E,','
      16BF                LD D,'Z'            Inverse Z.
      3E04                LD A,04             Select DISADDW.
      CD0100              CALL FUNCTIONS      Write DE (written ED).

      184F                JR COMPFINAL        Chain jump.
03F2: 184F                JR CLS0ISF1         Chain jump.

03F4: FE01     CLS0F0ISH1 CP 01               Is H 1?
      204D                JR NZ,CLS0F0ISH2
      03                  INC BC
      03                  INC BC              Point to KPART.
      0A                  LD A,(BC)           Get K part.
      FE00                CP 00               Is K 0?
      2023                JR NZ,CLS0F0H1KIS1
      C5                  PUSH BC             Preserve KPART.
      1600                LD D,00             Select list item 0.
      3E02                LD A,02             Select DISADDF.
0404: CD0100              CALL FUNCTIONS
      312900FFFE          DEFB "LD " FF FE
      C1                  POP BC              Retrieve KPART.
      0B                  DEC BC              Point to JPART.
      0A                  LD A,(BC)           Get J part.
      57                  LD D,A
      1E02                LD E,02             Select TBLS.
      3E05                LD A,05             Select DISADDT.
0414: CD0100              CALL FUNCTIONS
      1E1A                LD E,','
      16BC                LD D,'W'            Inverse W.
      3E04                LD A,04             Select DISADDW.
041D: CD0100              CALL FUNCTIONS      Write DE (written ED).
      181F                JR COMPFINAL
0422: 0000   CLS0F0H1KIS1 DEFW 0000           K must be 1.
      0000                DEFW 0000           Spare.
      C5                  PUSH BC             Preserve KPART.
      1600                LD D,00             Select list item 0.
      3E02                LD A,02             Select DISADDF.
042B: CD0100              CALL FUNCTIONS
      26292900BE1AFFFE    DEFB "ADD Y," FF FE  Inverse Y.
      C1                  POP BC              Retrieve KPART.
      0B                  DEC BC              Point to JPART.
      0A                  LD A,(BC)           Get J part.
      57                  LD D,A
      1E02                LD E,02             Select TBLS.
      3E05                LD A,05             Select DISADDT.
043E: CD0100              CALL FUNCTIONS

      1851                JR COMPFINAL        Chain jump.
0443: 1851                JR CLS0ISF1         Chain jump.

0445: FE02     CLS0F0ISH2 CP 02               Is H 2?
      204F                JR NZ,CLS0F0ISH3
      C5                  PUSH BC             Preserve HPART.
      1600                LD D,00             Select list item 0.
      3E02                LD A,02             Select DISADDF.
044E: CD0100              CALL FUNCTIONS
      312900FFFE          DEFB "LD " FF FE
      C1                  POP BC              Retrieve HPART.
      0B                  DEC BC              Point to GPART.
      0A                  LD A,(BC)           Get G part.
      57                  LD D,A
      3E02                LD A,02             Select DISADDF.
045C: CD0100              CALL FUNCTIONS
      102728111A26FF      DEFB "(BC),A" FF
      261A10272811FF      DEFB "A,(BC)" FF
      10292A111A26FF      DEFB "(DE),A" FF
      261A10292A11FF      DEFB "A,(DE)" FF
      10BC111ABEFF        DEFB "(W),Y" FF     Inverse W and Y.
      BE1A10BC11FF        DEFB "Y,(W)" FF     Inverse W and Y.
      10BC111A26FF        DEFB "(W),A" FF     Inverse W.
      261A10BC11FF        DEFB "A,(W)" FF     Inverse W.
      FE                  DEFB FE

      183A                JR COMPFINAL        Chain jump.
0496: 183A                JR CLS0ISF1         Chain jump.

0498: FE03     CLS0F0ISH3 CP 03               Is H 3?
      2038                JR NZ,CLS0F0ISH4
      03                  INC BC
      03                  INC BC              Point to KPART.
      0A                  LD A,(BC)           Get K part.
      FE00                CP 00               Is K 0?
      2010                JR NZ,CLS0F0H3KIS1
      C5                  PUSH BC             Preserve KPART.
      1600                LD D,00             Select list item 0.
      3E02                LD A,02             Select DISADDF.
04A8: CD0100              CALL FUNCTIONS
      2E332800FFFE        DEFB "INC " FF FE
      1812                JR L0
04B3: 0000   CLS0F0H3KIS1 DEFW 0000           K must be 1.
      0000                DEFW 0000           Spare.
      C5                  PUSH BC             Preserve KPART.
      1600                LD D,00             Select list item 0.
      3E02                LD A,02             Select DISADDF.
04BC: CD0100              CALL FUNCTIONS
      292A2800FFFE        DEFB "DEC " FF FE
      C1        L0        POP BC              Retrieve KPART.
      0B                  DEC BC              Point to JPART.
      0A                  LD A,(BC)           Get J part.
      57                  LD D,A
      1E02                LD E,02             Select TBLS.
      3E05                LD A,05             Select DISADDT.
04CD: CD0100              CALL FUNCTIONS

      1833                JR COMPFINAL        Chain jump.
04D2: 1833                JR CLS0ISF1         Chain jump.

04D4: FE04     CLS0F0ISH4 CP 04               Is H 4?
      2010                JR NZ,CLS0F0ISH5
      C5                  PUSH BC             Preserve HPART.
      1600                LD D,00             Select list item 0.
      3E02                LD A,02             Select DISADDF.
04DD: CD0100              CALL FUNCTIONS
      2E332800FFFE        DEFB "INC " FF FE
      1812                JR L0
04E8: FE05     CLS0F0ISH5 CP 05               Is H 5?
      201D                JR NZ,CLS0F0ISH6
      C5                  PUSH BC             Preserve HPART.
      1600                LD D,00             Select list item 0.
      3E02                LD A,02             Select DISADDF.
04F1: CD0100              CALL FUNCTIONS
      292A2800FFFE        DEFB "DEC " FF FE
      C1        L0        POP BC              Retrieve HPART.
      0B                  DEC BC              Point to GPART.
      0A                  LD A,(BC)           Get G part.
      57                  LD D,A
      1E01                LD E,01             Select TBLR.
      3E05                LD A,05             Select DISADDT.
0502: CD0100              CALL FUNCTIONS

      1854                JR COMPFINAL        Chain jump.
0507: 1854                JR CLS0ISF1         Chain jump.

0509: FE06     CLS0F0ISH6 CP 06               Is H 6?
      2023                JR NZ,CLS0F0HIS7
      C5                  PUSH BC             Preserve HPART.
      1600                LD D,00             Select list item 0.
      3E02                LD A,02             Select DISADDF.
0512: CD0100              CALL FUNCTIONS
      312900FFFE          DEFB "LD " FF FE
      C1                  POP BC              Retrieve HPART.
      0B                  DEC BC              Point to GPART.
      0A                  LD A,(BC)           Get G part.
      57                  LD D,A
      1E01                LD E,01             Select TBLR.
      3E05                LD A,05             Select DISADDT.
0522: CD0100              CALL FUNCTIONS
      1E1A                LD E,','
      16BB                LD D,'V'            Inverse V.
      3E04                LD A,04             Select DISADDW.
052B: CD0100              CALL FUNCTIONS      Write DE (written ED).
      182B                JR COMPFINAL

0530: 0B       CLS0F0HIS7 DEC BC              H must be 7.
      0A                  LD A,(BC)           Get G part.
      57                  LD D,A
      3E02                LD A,02             Select DISADDF.
0535: CD0100              CALL FUNCTIONS
      37312826FF          DEFB "RLCA" FF
      37372826FF          DEFB "RRCA" FF
      373126FF            DEFB "RLA" FF
      373726FF            DEFB "RRA" FF
      292626FF            DEFB "DAA" FF
      283531FF            DEFB "CPL" FF
      38282BFF            DEFB "SCF" FF
      28282BFF            DEFB "CCF" FF
      FE                  DEFB FE

      185F                JR COMPFINAL        Chain jump.

055D: FE01      CLS0ISF1  CP 01               Is F 1?
      2041                JR NZ,CLS0ISF2
      1A                  LD A,(DE)           Get byte to disassemble.
      3C                  INC A
      FE77                CP 77               Is byte 76+1?
      200F                JR NZ,CLS0F1NE76
      1600                LD D,00             Select list item 0.
      3E02                LD A,02             Select DISADDF.
056B: CD0100              CALL FUNCTIONS
      2D263139FFFE        DEFB "HALT" FF FE
      1846                JR COMPFINAL
      C5       CLS0F1NE76 PUSH BC             Preserve FPART.
      1600                LD D,00             Select list item 0.
      3E02                LD A,02             Select DISADDF.
057B: CD0100              CALL FUNCTIONS
      312900FFFE          DEFB "LD " FF FE
      C1                  POP BC              Retrieve FPART.
      03                  INC BC              Point to GPART.
      C5                  PUSH BC             Preserve GPART.
      0A                  LD A,(BC)           Get G part.
      57                  LD D,A
      1E01                LD E,01             Select TBLR.
      3E05                LD A,05             Select DISADDT.
058C: CD0100              CALL FUNCTIONS
      161A                LD D,','
      3E03                LD A,03             Select DISADDB.
0593: CD0100              CALL FUNCTIONS
      1819                JR L0               Reuse code below.

0598: 00 * 10             DEFB 00 * 10        Spare.

05A2: FE02      CLS0ISF2  CP 02               Is F 2?
      2018                JR NZ,CLS0FIS3
      03                  INC BC              Point to GPART.
      C5                  PUSH BC             Preserve GPART.
      0A                  LD A,(BC)           Get G part.
      57                  LD D,A
      1E04                LD E,04             Select TBLX.
      3E05                LD A,05             Select DISADDT.
05AE: CD0100              CALL FUNCTIONS
      C1        L0        POP BC              Retrieve GPART.
      03                  INC BC              Point to HPART.
      0A                  LD A,(BC)           Get H part.
      57                  LD D,A
      1E01                LD E,01             Select TBLR.
      3E05                LD A,05             Select DISADDT.
05B9: CD0100              CALL FUNCTIONS

      1820                JR COMPFINAL        Chain jump.

05BE: 03        CLS0FIS3  INC BC              F must be 3.
      03                  INC BC              Point to HPART.
      0A                  LD A,(BC)           Get H part.
      FE00                CP 00               Is H 0?
      201B                JR NZ,CLS0F3ISH1
      C5                  PUSH BC             Preserve HPART.
      1600                LD D,00             Select list item 0.
      3E02                LD A,02             Select DISADDF.
05CA: CD0100              CALL FUNCTIONS
      372A3900FFFE        DEFB "RET " FF FE
      C1                  POP BC              Retrieve HPART.
      0B                  DEC BC              Point to GPART.
      0A                  LD A,(BC)           Get G part.
      57                  LD D,A
      1E00                LD E,00             Select TBLC.
      3E05                LD A,05             Select DISADDT.
05DB: CD0100              CALL FUNCTIONS
      
      184A                JR COMPFINAL        Chain jump.

05E0: FE01     CLS0F3ISH1 CP 01               Is H 1?
      2048                JR NZ,CLS0F3ISH2
      03                  INC BC
      03                  INC BC              Point to KPART.
      0A                  LD A,(BC)           Get K part.
      FE00                CP 00               Is K 0?
      201B                JR NZ,CLS0F3H1KIS1
      C5                  PUSH BC             Preserve KPART.
      1600                LD D,00             Select list item 0.
      3E02                LD A,02             Select DISADDF.
05F0: CD0100              CALL FUNCTIONS
      35343500FFFE        DEFB "POP " FF FE
      C1                  POP BC              Retrieve KPART.
      0B                  DEC BC              Point to JPART.
      0A                  LD A,(BC)           Get J part.
      57                  LD D,A
      1E03                LD E,03             Select TBLQ.
      3E05                LD A,05             Select DISADDT.
0601: CD0100              CALL FUNCTIONS
      1824                JR COMPFINAL 
      0000   CLS0F3H1KIS1 DEFW 0000           K must be 1.
      0000                DEFW 0000           Spare.
      0B                  DEC BC              Point to JPART.
      0A                  LD A,(BC)           Get J part.
      57                  LD D,A
      3E02                LD A,02             Select DISADDF.
060F: CD0100              CALL FUNCTIONS
      372A39FF            DEFB "RET" FF
      2A3D3DFF            DEFB "EXX" FF
      2F350010BE11FF      DEFB "JP (Y)" FF    Inverse Y.
      31290038351ABEFF    DEFB "LD SP,Y" FF   Inverse Y.
      FE                  DEFB FE
      
      1866                JR COMPFINAL        Chain jump.
      
062C: FE02     CLS0F3ISH2 CP 02               Is H 2?
      2023                JR NZ,CLS0F3ISH3
      C5                  PUSH BC             Preserve HPART.
      1600                LD D,00             Select list item 0.
      3E02                LD A,02             Select DISADDF.
0635: CD0100              CALL FUNCTIONS
      2F3500FFFE          DEFB "JP " FF FE
063D: C1        L0        POP BC              Retrieve HPART.
      0B                  DEC BC              Point to GPART.
      0A                  LD A,(BC)           Get G part.
      57                  LD D,A
      1E00                LD E,00             Select TBLC.
      3E05                LD A,05             Select DISADDT.
0645: CD0100              CALL FUNCTIONS
      1E1A                LD E,','
      16BC                LD D,'W'            Inverse W.
      3E04                LD A,04             Select DISADDW.
064E: CD0100              CALL FUNCTIONS      Write DE (written ED).
      183F                JR COMPFINAL
      FE03     CLS0F3ISH3 CP 03               Is H 3?
      203D                JR NZ,CLS0F3ISH4
      0B                  DEC BC              Point to GPART.
      0A                  LD A,(BC)           Get G part.
      57                  LD D,A
      3E02                LD A,02             Select DISADDF.
065C: CD0100              CALL FUNCTIONS
      2F3500BCFF          DEFB "JP W" FF      Inverse W.
      FF                  DEFB FF             This is CB.
      343A390010BB111A26FF DEFB "OUT (V),A" FF   Inverse V.
      2E3300261A10BB11FF  DEFB "IN A,(V)" FF     Inverse V.
      2A3D00103835111ABEFF  DEFB "EX (SP),Y" FF  Inverse Y.
      2A3D00292A1A2D31FF  DEFB "EX DE,HL" FF
      292EFF              DEFB "DI" FF
      2A2EFF              DEFB "EI" FF
      FE                  DEFB FE
      
      1851                JR COMPFINAL        Chain jump.

0694: FE04     CLS0F3ISH4 CP 04               Is H 4?
      2011                JR NZ,CLS0F3ISH5
      C5                  PUSH BC             Preserve HPART.
      1600                LD D,00             Select list item 0.
      3E02                LD A,02             Select DISADDF.
069D: CD0100              CALL FUNCTIONS
      2826313100FFFE      DEFB "CALL " FF FE
      1894                JR L0               Reuse code above.
06A9: FE05     CLS0F3ISH5 CP 05               Is H 5?
      203A                JR NZ,CLS0F3ISH6
      03                  INC BC
      03                  INC BC              Point to KPART.
      0A                  LD A,(BC)           Get K part.
      FE00                CP 00               Is K 0?
      201C                JR NZ,CLS0F3H5KIS1
      C5                  PUSH BC             Preserve KPART.
      1600                LD D,00             Select list item 0.
      3E02                LD A,02             Select DISADDF.
06B9: CD0100              CALL FUNCTIONS
      353A382D00FFFE      DEFB "PUSH " FF FE
      C1                  POP BC              Retrieve KPART.
      0B                  DEC BC              Point to JPART.
      0A                  LD A,(BC)           Get J part.
      57                  LD D,A
      1E03                LD E,03             Select TBLQ.
      3E05                LD A,05             Select DISADDT.
06CB: CD0100              CALL FUNCTIONS
      1815                JR COMPFINAL 
      1600   CLS0F3H5KIS1 LD D,00             K must be 1. Item 0.
      3E02                LD A,02             Select DISADDF.
06D4: CD0100              CALL FUNCTIONS
      2826313100FFFE      DEFB "CALL " FF FE
      16BC                LD D,'W'            Inverse W.
      3E03                LD A,03             Select DISADDB.
06E2: CD0100              CALL FUNCTIONS
      
      183B                JR COMPFINAL        Chain jump.

06E7: FE06     CLS0F3ISH6 CP 06               Is H 6?
      2013                JR NZ,CLS0F3HIS7
      0B                  DEC BC              Point to GPART.
      0A                  LD A,(BC)           Get G part.
      57                  LD D,A
      1E04                LD E,04             Select TBLX.
      3E05                LD A,05             Select DISADDT.
06F2: CD0100              CALL FUNCTIONS
      16BB                LD D,'V'            Inverse V.
      3E03                LD A,03             Select DISADDB.
06F9: CD0100              CALL FUNCTIONS
      1824                JR COMPFINAL
      C5       CLS0F3HIS7 PUSH BC             H must be 7.
      1600                LD D,00             Select list item 0.
      3E02                LD A,02             Select DISADDF.
0703: CD0100              CALL FUNCTIONS
      37383900FFFE        DEFB "RST " FF FE
      C1                  POP BC              Retrieve HPART.
      0B                  DEC BC              Point to GPART.
      0A                  LD A,(BC)           Get G part.
      A7                  AND A               Clear carry flag.
      1F                  RRA                 A = G / 2.
      C61C                ADD A,'0'
      5F                  LD E,A
      0A                  LD A,(BC)           Get G part.
      87                  ADD A,A             A = G * 2.
      87                  ADD A,A             A = G * 4.
      87                  ADD A,A             A = G * 8.
      E60F                AND 0F              All the above amounts
      C61C                ADD A,'0'           to choose Gth item:
      57                  LD D,A              00/08/10/18/20/28/30/38
      3E04                LD A,04             Select DISADDW.
071F: CD0100              CALL FUNCTIONS      Write DE (written ED).

      186D                JR COMPFINAL        Chain jump.

0724: E1        ISCLS1    POP HL              Retrieve CLASS.
      7E                  LD A,(HL)
      FE01                CP 01               Is CLASS 1?
      2069                JR NZ,CLSIS2
072A: 03                  INC BC              Point to FPART.
      0A                  LD A,(BC)           Get F part.
      FE00                CP 00               Is F 0?
      2039                JR NZ,CLS1FISGT0
0730: 03                  INC BC              Point to GPART.
      C5                  PUSH BC
      0A                  LD A,(BC)           Get G part.
      57                  LD D,A
      3E02                LD A,02             Select DISADDF.
0736: CD0100              CALL FUNCTIONS
      37312800FF          DEFB "RLC " FF
      37372800FF          DEFB "RRC " FF
      373100FF            DEFB "RL " FF
      373700FF            DEFB "RR " FF
      38312600FF          DEFB "SLA " FF
      38372600FF          DEFB "SRA " FF
      FF                  DEFB FF
      38373100FF          DEFB "SRL " FF
      FE                  DEFB FE
075C: C1        L0        POP BC              Retrieve GPART.
      03                  INC BC              Point to HPART.
      0A                  LD A,(BC)           Get H part.
      57                  LD D,A
      1E01                LD E,01             Select TBLR.
      3E05                LD A,05             Select DISADDT.
0764: CD0100              CALL FUNCTIONS
      1828                JR COMPFINAL
0769: C5       CLS1FISGT0 PUSH BC             Preserve FPART.
      57                  LD D,A
      3E02                LD A,02             Select DISADDF.
076D: CD0100              CALL FUNCTIONS
      FF                  DEFB FF
      272E3900FF          DEFB "BIT " FF
      372A3800FF          DEFB "RES " FF
      382A3900FF          DEFB "SET " FF
      FE                  DEFB FE
      C1                  POP BC              Retrieve FPART.
      03                  INC BC              Point to GPART.
      C5                  PUSH BC             Preserve GPART.
      0A                  LD A,(BC)           Get G part.
      C61C                ADD A,'0'           A = '0' to '7'.
      5F                  LD E,A
      161A                LD D,','
      3E04                LD A,04             Select DISADDW.
078C: CD0100              CALL FUNCTIONS      Write DE (written ED).
      18CB                JR L0               Reuse code above.
      
      1844                JR COMPFINAL        Chain jump.

0793: 03        CLSIS2    INC BC              CLASS must be 2 then.
      0A                  LD A,(BC)           Get F part.
      FE00                CP 00               Is F 0?
      283E                JR Z,COMPFINAL      F = 0 is invalid.
      FE01                CP 01               Is F 1?
      203C                JR NZ,CLS2ISF2
      03                  INC BC
      03                  INC BC              Point to HPART.
      0A                  LD A,(BC)           Get H part.
      FE02                CP 02               Is H < 2?
      3037                JR NC,CLS2F1ISH2
      F5                  PUSH AF             Preserve H part.
      C5                  PUSH BC             Preserve HPART.
      57                  LD D,A
      3E02                LD A,02             Select DISADDF.
07A9: CD0100              CALL FUNCTIONS      I'm checking H0 and H1
      2E3300FF            DEFB "IN " FF       both together because
      343A39001028111AFF  DEFB "OUT (C)," FF  it's saves ~16 bytes.
      FE                  DEFB FE
      C1                  POP BC              Retrieve HPART.
      0B                  DEC BC              Point to GPART.
      0A                  LD A,(BC)           Get G part.
      57                  LD D,A
      1E01                LD E,01             Select TBLR.
      3E05                LD A,05             Select DISADDT.
07C2: CD0100              CALL FUNCTIONS
      F1                  POP AF              Retrieve H part.
      FE00                CP 00               Is H 0?
      200D                JR NZ,COMPFINAL
      1600                LD D,00             Select list item 0.
      3E02                LD A,02             Select DISADDF.
07CE: CD0100              CALL FUNCTIONS
      1A102811FFFE        DEFB ",(C)" FF FE

      1866                JR COMPFINAL        Chain jump.
      1866                JR CLS2ISF2         Chain jump.

07DB: FE02     CLS2F1ISH2 CP 02               Is H 2?
      2027                JR NZ,CLS2F1ISH3
      03                  INC BC
      C5                  PUSH BC             Preserve JPART.
      03                  INC BC              Point to KPART.
      0A                  LD A,(BC)           Get K part.
      57                  LD D,A
      3E02                LD A,02             Select DISADDF.
07E6: CD0100              CALL FUNCTIONS
      382728002D311AFF    DEFB "SBC HL," FF
      262928002D311AFF    DEFB "ADC HL," FF
      FE                  DEFB FE
      C1                  POP BC              Retrieve JPART.
      0A                  LD A,(BC)           Get J part.
      57                  LD D,A
      1E02                LD E,02             Select TBLS.
      3E05                LD A,05             Select DISADDT.
0801: CD0100              CALL FUNCTIONS
      1839                JR COMPFINAL
0806: FE03     CLS2F1ISH3 CP 03               Is H 3?
      2039                JR NZ,CLS2F1ISH4
      03                  INC BC
      03                  INC BC              Point to KPART.
      0A                  LD A,(BC)           Get K part.
      F5                  PUSH AF             Preserve K part.
      C5                  PUSH BC             Preserve KPART.
      57                  LD D,A
      3E02                LD A,02             Select DISADDF.
0812: CD0100              CALL FUNCTIONS
      31290010BC111AFF    DEFB "LD (W)," FF   Inverse W.
      312900FF            DEFB "LD " FF
      FE                  DEFB FE
      C1                  POP BC              Retrieve KPART.
      0B                  DEC BC              Point to JPART.
      0A                  LD A,(BC)           Get J part.
      57                  LD D,A
      1E02                LD E,02             Select TBLS.
      3E05                LD A,05             Select DISADDT.
082A: CD0100              CALL FUNCTIONS
      F1                  POP AF              Retrieve K part.
      FE00                CP 00               Is K 0?
      280D                JR Z,COMPFINAL
      1600                LD D,00             Select list item 0.
      3E02                LD A,02             Select DISADDF.
0836: CD0100              CALL FUNCTIONS
      1A10BC11FFFE        DEFB ",(W)" FF FE   Inverse W.

      187A                JR COMPFINAL        Chain jump.
      187A                JR CLS2ISF2         Chain jump.

0843: FE04     CLS2F1ISH4 CP 04               Is H 4?
      200E                JR NZ,CLS2F1ISH5
      1600                LD D,00             Select list item 0.
      3E02                LD A,02             Select DISADDF.
084B: CD0100              CALL FUNCTIONS
      332A2CFFFE          DEFB "NEG" FF FE
      1866                JR COMPFINAL
0855: FE05     CLS2F1ISH5 CP 05               Is H 5?
      2016                JR NZ,CLS2F1ISH6
      03                  INC BC
      03                  INC BC              Point to KPART.
      0A                  LD A,(BC)           Get K part.
      57                  LD D,A
      3E02                LD A,02             Select DISADDF.
085F: CD0100              CALL FUNCTIONS
      372A3933FF          DEFB "RETN" FF
      372A392EFF          DEFB "RETI" FF
      FE                  DEFB FE
      184C                JR COMPFINAL
086F: FE06     CLS2F1ISH6 CP 06               Is H 6?
      201B                JR NZ,CLS2F1HIS7
      0B                  DEC BC              Point to GPART.
      0A                  LD A,(BC)           Get G part.
      57                  LD D,A
      3E02                LD A,02             Select DISADDF.
0878: CD0100              CALL FUNCTIONS
      2E32001CFF          DEFB "IM 0" FF      G won't be > 3
      FF                  DEFB FF             so I've truncated
      2E32001DFF          DEFB "IM 1" FF      the list to save
      2E32001EFF          DEFB "IM 2" FF      space.
      FE                  DEFB FE
088C: 182D                JR COMPFINAL
      0B       CLS2F1HIS7 DEC BC              H must be 7 then.
      0A                  LD A,(BC)           Get G part.
      57                  LD D,A
      3E02                LD A,02             Select DISADDF.
0893: CD0100              CALL FUNCTIONS
      3129002E1A26FF      DEFB "LD I,A" FF    G won't be > 5
      312900371A26FF      DEFB "LD R,A" FF    so I've truncated
      312900261A2EFF      DEFB "LD A,I" FF    the list to save
      312900261A37FF      DEFB "LD A,R" FF    space.
      373729FF            DEFB "RRD" FF
      373129FF            DEFB "RLD" FF
      FE                  DEFB FE

      1843                JR COMPFINAL        Chain jump.

08BD: FE02      CLS2ISF2  CP 02               Is F 2?
      203F                JR NZ,COMPFINAL     F can't be 3.
      03                  INC BC              Point to GPART.
      0A                  LD A,(BC)           Get G part.
      57                  LD D,A
      C5                  PUSH BC             Preserve GPART.
      03                  INC BC              Point to HPART.
      0A                  LD A,(BC)           Get H part.
      FE03                CP 03               I'm implementing a
      2005                JR NZ,L0            fix here for the
      CB4A                BIT 1,D             errors of OTI and
      2001                JR NZ,L0            OTD: I've added a
      3C                  INC A               special H=4 case for
      57        L0        LD D,A              H=3 and (G=4 or G=5).
      3E02                LD A,02             Select DISADDF.
08D3: CD0100              CALL FUNCTIONS
      3129FF              DEFB "LD" FF        H won't normally
      2835FF              DEFB "CP" FF        be > 3.
      2E33FF              DEFB "IN" FF
      3439FF              DEFB "OT" FF
      343A39FF            DEFB "OUT" FF       Special condition.
      FE                  DEFB FE
      C1                  POP BC              Retrieve GPART.
      0A                  LD A,(BC)           Get G part.
      D604                SUB 4               G was 4 to 7 but
      57                  LD D,A              now it's 0 to 3.
      3E02                LD A,02             Select DISADDF.
08EE: CD0100              CALL FUNCTIONS
      2EFF                DEFB "I" FF
      29FF                DEFB "D" FF
      2E37FF              DEFB "IR" FF
      2937FF              DEFB "DR" FF
      FE                  DEFB FE

08FC: 0000                DEFW 0000           Spare.
      0000                DEFW 0000           Spare.

0900: 3E01      COMPFINAL LD A,01             Compute final output.
0902: CD0100              CALL FUNCTIONS      Keep this available as
      E5                  PUSH HL             it will be used a lot.

      011F02    PUTADDR   LD BC,ADDRESS       Convert offset ADDRESS
      09                  ADD HL,BC           to an absolute address.
      5E                  LD E,(HL)
      23                  INC HL
      56                  LD D,(HL)           DE = address at ADDRESS.
      E1                  POP HL              Retrieve address of
      E5                  PUSH HL             offset 0000.
      01F701              LD BC,DISADDR       Convert offset DISADDR
      09                  ADD HL,BC           to an absolute address.
      0602                LD B,2              Convert 2 bytes.
      D5        L0        PUSH DE
      3E08                LD A,08             Select HEXTOCHAR.
0918: CD0100              CALL FUNCTIONS
      72                  LD (HL),D
      23                  INC HL
      73                  LD (HL),E
      23                  INC HL
      D1                  POP DE
      53                  LD D,E
      10F2                DJNZ L0             B is zero so we'll use
      70                  LD (HL),B           it to write a space.

0924: E1        RSTBYTCNT POP HL              Retrieve address of
      E5                  PUSH HL             offset 0000.
      012102              LD BC,BYTCNT        Convert offset BYTCNT
      09                  ADD HL,BC           to an absolute address.
      3601                LD (HL),01          Reset BYTCNT to at
      E5                  PUSH HL             least 1 byte.
      D1                  POP DE              DE = BYTCNT.
      
092E: E1        CALCBYTES POP HL              Retrieve address of
      E5                  PUSH HL             offset 0000.
      010502              LD BC,DIS           Convert offset DIS to
      09                  ADD HL,BC           an absolute address.
      7E                  LD A,(HL)
      FEFF                CP FF               Is DIS empty?
      286A                JR Z,PUTBYTES
0939: E1                  POP HL              Retrieve address of
      E5                  PUSH HL             offset 0000.
      011802              LD BC,CLASS         Convert offset CLASS to
      09                  ADD HL,BC           an absolute address.
      E5                  PUSH HL
      C1                  POP BC              BC = CLASS.
      D5                  PUSH DE
      E1                  POP HL              HL = BYTCNT.
      0A                  LD A,(BC)
      FE00                CP 00               Is CLASS 0?
      2801                JR Z,L0
      34                  INC (HL)            Increment BYTCNT.
      03        L0        INC BC              Point to INDEX.
      0A                  LD A,(BC)
      FE00                CP 00               Is INDEX 0?
      2801                JR Z,L1
      34                  INC (HL)            Increment BYTCNT.
      E5        L1        PUSH HL
      D1                  POP DE              DE = BYTCNT.

0952: E1        REPLACE   POP HL              Retrieve address of
      E5                  PUSH HL             offset 0000.
      C5                  PUSH BC             Preserve INDEX.
      010502              LD BC,DIS           Convert offset DIS to
      09                  ADD HL,BC           an absolute address.
      C1                  POP BC              Retrieve INDEX.
      7E        L0        LD A,(HL)
      FEFF                CP FF               Are we at DIS end?
      2844                JR Z,PUTBYTES       Chain jump.
095F: C5                  PUSH BC             Preserve INDEX.
      D5                  PUSH DE             Preserve BYTCNT.
      E5                  PUSH HL             Preserve DIS offset.
      FEBD                CP BD               Inverse X.
      2030                JR NZ,L2
0966: 0A                  LD A,(BC)           Get INDEX.
      1EBD                LD E,'X'            Inverse X.
      57        L1        LD D,A
      3E07                LD A,07             Select DISREPBWS.
096C: CD0100              CALL FUNCTIONS
      102D3111FF          DEFB "(HL)" FF      X: INDEX=0
      102E3D15BB11FF      DEFB "(IX+V)" FF    X: INDEX=1. Inverse V.
      102E3E15BB11FF      DEFB "(IY+V)" FF    X: INDEX=2. Inverse V.
      2D31FF              DEFB "HL" FF        Y: INDEX=0
      2E3DFF              DEFB "IX" FF        Y: INDEX=1
      2E3EFF              DEFB "IY" FF        Y: INDEX=2
098B: 1C1CFF              DEFB "00" FF        Byte.
      1C1C1C1CFF          DEFB "0000" FF      Word.
      FE                  DEFB FE
      187A                JR REPLEND
0996: FEBE      L2        CP BE               Inverse Y.
      200B                JR NZ,L3
      0A                  LD A,(BC)           Get INDEX.
      C603                ADD A,3
      1EBE                LD E,'Y'            Inverse Y.

      18C8                JR L1               Chain jump. ^
      18B7                JR L0               Chain jump. ^
      1869                JR PUTBYTES         Chain jump. v

09A5: FEBB      L3        CP BB               Inverse V.
      2030                JR NZ,L6
      0B                  DEC BC              Point to CLASS.
      0A                  LD A,(BC)           Get CLASS.
      03                  INC BC              Point to INDEX.
      FE01                CP 01
      2009                JR NZ,L4
      0A                  LD A,(BC)           Get INDEX.
      FE00                CP 00               CLASS=1 and INDEX<>0
      2804                JR Z,L4             means DD/FDCBddxx.
      3E0A                LD A,0A             Select GETPREBYT.
      1802                JR L5
      3E09      L4        LD A,09             Select GETCURBYT.
      D5        L5        PUSH DE             Preserve BYTCNT.
09BC: CD0100              CALL FUNCTIONS
      57                  LD D,A
      3E08                LD A,08             Select HEXTOCHAR.
09C2: CD0100              CALL FUNCTIONS
      3E01                LD A,01             Select GETADDR.
09C7: CD0100              CALL FUNCTIONS
      018B09              LD BC,098B          Convert offset 098B
      09                  ADD HL,BC           to an absolute address.
      72                  LD (HL),D
      23                  INC HL
      73                  LD (HL),E
      E1                  POP HL              Retrieve BYTCNT.
      34                  INC (HL)            Increment BYTCNT.
      3E06                LD A,06
      1EBB                LD E,'V'            Inverse V.
      18C6                JR L1
09D9: FEBC      L6        CP BC               Inverse W.
      2035                JR NZ,L8
      D5                  PUSH DE
      E1                  POP HL
      34                  INC (HL)            Increment BYTCNT.
      3E01                LD A,01             Select GETADDR.
09E2: CD0100              CALL FUNCTIONS
      018E09              LD BC,098E          Convert offset 098E
      09                  ADD HL,BC           to an absolute address.
      0602                LD B,2
      C5        L7        PUSH BC             Preserve loop count.
      D5                  PUSH DE             Preserve BYTCNT.
      E5                  PUSH HL             Preserve table offset.
      3E0B                LD A,0B             Select GETCURBYT
      90                  SUB B               then GETPREBYT.
09F1: CD0100              CALL FUNCTIONS
      57                  LD D,A
      3E08                LD A,08             Select HEXTOCHAR.
09F7: CD0100              CALL FUNCTIONS
      E1                  POP HL              Retrieve table offset.
      72                  LD (HL),D
      23                  INC HL
      73                  LD (HL),E
      23                  INC HL
      D1                  POP DE              Retrieve BYTCNT.
      C1                  POP BC              Retrieve loop count.
      10E8                DJNZ L7
0A03: D5                  PUSH DE
      E1                  POP HL
      34                  INC (HL)            Increment BYTCNT.
      3E07                LD A,07
      1EBC                LD E,'W'            Inverse W.

0A0A: 1893                JR L1               Chain jump. ^
      1893                JR L0               Chain jump. ^
      1851                JR PUTBYTES         Chain jump. v
      1849                JR REPLEND          Chain jump. v

0A12: FEBF      L8        CP BF               Inverse Z.
      2045                JR NZ,REPLEND       Chain jump. v
      D5                  PUSH DE             Preserve BYTCNT.
      3E01                LD A,01             Select GETADDR.
0A19: CD0100              CALL FUNCTIONS
      E5                  PUSH HL
      011F02              LD BC,ADDRESS       Convert offset ADDRESS
      09                  ADD HL,BC           to an absolute address.
      5E                  LD E,(HL)
      23                  INC HL
      56                  LD D,(HL)           DE = address at ADDRESS.
      3E09                LD A,09             Select GETCURBYT.
0A26: CD0100              CALL FUNCTIONS
      2600                LD H,00
      6F                  LD L,A
      CB7D                BIT 7,L             Sign extend the byte.
      2801                JR Z,L9
      25                  DEC H
      19        L9        ADD HL,DE
      23                  INC HL              Add 2.
      23                  INC HL
      E5                  PUSH HL
      D1                  POP DE              DE = jump address.
      E1                  POP HL
      018E09              LD BC,098E          Convert offset 098E
      09                  ADD HL,BC           to an absolute address.
      0602                LD B,2
0A3D: C5        L10       PUSH BC             Preserve loop count.
      D5                  PUSH DE             Preserve jump address.
      E5                  PUSH HL             Preserve table offset.
      CB40                BIT 0,B
      2801                JR Z,L11
      53                  LD D,E
      3E08      L11       LD A,08             Select HEXTOCHAR.
0A47: CD0100              CALL FUNCTIONS
      E1                  POP HL              Retrieve table offset.
      72                  LD (HL),D
      23                  INC HL
      73                  LD (HL),E
      23                  INC HL
      D1                  POP DE              Retrieve jump address.
      C1                  POP BC              Retrieve loop count.
      10EA                DJNZ L10
0A53: E1                  POP HL              Retrieve BYTCNT.
      34                  INC (HL)            Increment BYTCNT.
      3E07                LD A,07
      1EBF                LD E,'Z'            Inverse Z.
      18AF                JR L1
0A5B: E1        REPLEND   POP HL              Retrieve DIS offset.
      D1                  POP DE              Retrieve BYTCNT.
      C1                  POP BC              Retrieve INDEX.
      23                  INC HL              Point to next char.
      18AB                JR L0

0A61: E1        PUTBYTES  POP HL
      E5                  PUSH HL
      011F02              LD BC,ADDRESS       Convert offset ADDRESS
      09                  ADD HL,BC           to an absolute address.
      5E                  LD E,(HL)
      23                  INC HL
      56                  LD D,(HL)           DE = address at ADDRESS.
      23                  INC HL              Point to BYTCNT.
      46                  LD B,(HL)           Get BYTCNT.
      0E09                LD C,09             Total characters.
      E1                  POP HL              Retrieve address of
      E5                  PUSH HL             offset 0000.
      C5                  PUSH BC
      01FC01              LD BC,DISBYTS       Convert offset DISBYTS
      09                  ADD HL,BC           to an absolute address.
      C1                  POP BC
0A76: D5        L0        PUSH DE             Preserve address.
      1A                  LD A,(DE)
      57                  LD D,A
      3E08                LD A,08             Select HEXTOCHAR.
0A7B: CD0100              CALL FUNCTIONS
      72                  LD (HL),D
      23                  INC HL
      73                  LD (HL),E
      23                  INC HL
      D1                  POP DE              Retrieve address.
      13                  INC DE
      0D                  DEC C
      0D                  DEC C
      10EE                DJNZ L0
0A88: 41                  LD B,C
      AF                  XOR A
      77        L1        LD (HL),A
      23                  INC HL
      10FC                DJNZ L1

0A8E: E1        UPDADDR   POP HL
      011F02              LD BC,ADDRESS       Convert offset ADDRESS
      09                  ADD HL,BC           to an absolute address.
      73                  LD (HL),E
      23                  INC HL
      72                  LD (HL),D
      C9                  RET                 
      00                  NOP                 Spare.

0A98: E1        MOREFUNCS POP HL              More functions.
      C1                  POP BC
      F1                  POP AF
0A9B: FE08      SF8       CP 08
      2012                JR NZ,SF9
      5A        HEXTOCHAR LD E,D              We'll store the high
      7B                  LD A,E              nibble in D and the
      1F                  RRA                 low nibble in E.
      1F                  RRA
      1F                  RRA
      1F                  RRA
      E60F                AND 0F
      C61C                ADD A,1C
      57                  LD D,A
      7B                  LD A,E
      E60F                AND 0F
      C61C                ADD A,1C
      5F                  LD E,A
      C9                  RET
0AB1: FE09      SF9       CP 09
      2804                JR Z,GETCURBYT
      FE0A      SFA       CP 0A
      2020                JR NZ,SFB
      E1        GETCURBYT POP HL              Get address of 0004.
      E5                  PUSH HL
      C5                  PUSH BC
      D5                  PUSH DE
      011F02              LD BC,ADDRESS       Convert offset ADDRESS
      09                  ADD HL,BC           to an absolute address.
      2B                  DEC HL              Work back from +4.
      2B                  DEC HL
      FE09                CP 09
      2804                JR Z,L0
      7E                  LD A,(HL)           Get BYTCNT.
      3D                  DEC A               Subtract 1.
      1801                JR L1
      7E        L0        LD A,(HL)           Get BYTCNT.
      2B        L1        DEC HL
      56                  LD D,(HL)
      2B                  DEC HL
      5E                  LD E,(HL)           DE = address at ADDRESS.
      83                  ADD A,E             Add BYTCNT to DE.
      3001                JR NC,L2
      14                  INC D
      5F        L2        LD E,A
      1A                  LD A,(DE)           Get byte.
      D1                  POP DE
      C1                  POP BC
      C9                  RET
0AD9: C9        SFB       RET

0ADA: 3E00      RELOCTBL  DEFW 003E           Relocation table.
      5700                DEFW 0057
      8A00                DEFW 008A
      A600                DEFW 00A6
      AC00                DEFW 00AC
      DE00                DEFW 00DE
      E500                DEFW 00E5
      1001                DEFW 0110
      4101                DEFW 0141
      7701                DEFW 0177
      8A01                DEFW 018A
      6602                DEFW 0266
      7102                DEFW 0271
      9C02                DEFW 029C
      F002                DEFW 02F0
      0F03                DEFW 030F
      4003                DEFW 0340
      5303                DEFW 0353
      AF03                DEFW 03AF
      D403                DEFW 03D4
      E503                DEFW 03E5
      EE03                DEFW 03EE
      0504                DEFW 0405
      1504                DEFW 0415
      1E04                DEFW 041E
      2C04                DEFW 042C
      3F04                DEFW 043F
      4F04                DEFW 044F
      5D04                DEFW 045D
      A904                DEFW 04A9
      BD04                DEFW 04BD
      CE04                DEFW 04CE
      DE04                DEFW 04DE
      F204                DEFW 04F2
      0305                DEFW 0503
      1305                DEFW 0513
      2305                DEFW 0523
      2C05                DEFW 052C
      3605                DEFW 0536
      6C05                DEFW 056C
      7C05                DEFW 057C
      8D05                DEFW 058D
      9405                DEFW 0594
      AF05                DEFW 05AF
      BA05                DEFW 05BA
      CB05                DEFW 05CB
      DC05                DEFW 05DC
      F105                DEFW 05F1
      0206                DEFW 0602
      1006                DEFW 0610
      3606                DEFW 0636
      4606                DEFW 0646
      4F06                DEFW 064F
      5D06                DEFW 065D
      9E06                DEFW 069E
      BA06                DEFW 06BA
      CC06                DEFW 06CC
      D506                DEFW 06D5
      E306                DEFW 06E3
      F306                DEFW 06F3
      FA06                DEFW 06FA
      0407                DEFW 0704
      2007                DEFW 0720
      3707                DEFW 0737
      6507                DEFW 0765
      6E07                DEFW 076E
      8D07                DEFW 078D
      AA07                DEFW 07AA
      C307                DEFW 07C3
      CF07                DEFW 07CF
      E707                DEFW 07E7
      0208                DEFW 0802
      1308                DEFW 0813
      2B08                DEFW 082B
      3708                DEFW 0837
      4C08                DEFW 084C
      6008                DEFW 0860
      7908                DEFW 0879
      9408                DEFW 0894
      D408                DEFW 08D4
      EF08                DEFW 08EF
      0309                DEFW 0903
      1909                DEFW 0919
      6D09                DEFW 096D
      BD09                DEFW 09BD
      C309                DEFW 09C3
      C809                DEFW 09C8
      E309                DEFW 09E3
      F209                DEFW 09F2
      F809                DEFW 09F8
      1A0A                DEFW 0A1A
      270A                DEFW 0A27
      480A                DEFW 0A48
      7C0A                DEFW 0A7C           94 entries.
2966 bytes.

; This small program is required to integrate DISASM into
; HEXLD3E only. It should be inserted into the A$ string
; within the BASIC program below. Use Dump Sinclair (P) to
; find the "UNASSEMBLE" string and then you can locate the
; address of the first character after the A$=".

0000: 213A67    POKEOFF   LD HL,0002          Offset 0002.
      3642                LD (HL),42
      23                  INC HL
      3667                LD (HL),67

0008: 010200    PUTADDR   LD BC,0002
      211364              LD HL,ADDRESS       Src HEXLD3E.
      115769              LD DE,ADDRESS       Dest DISASM.
      EDB0                LDIR

0013: CD3867    DISASM    CALL 0000           Offset 0000.

0016: 212F69    WRITEDIS  LD HL,DISADDR
      7E        L0        LD A,(HL)
      FEFF                CP FF
      2804                JR Z,L1
      D7                  RST 10              Print character.
      23                  INC HL
      18F7                JR L0
      3E75      L1        LD A,75
      3C                  INC A
      D7                  RST 10              Print newline.

0026: 010200    GETADDR   LD BC,0002
      215769              LD HL,ADDRESS       Src DISASM.
      111364              LD DE,ADDRESS       Dest HEXLD3E.
      EDB0                LDIR

0031: 18E0                JR DISASM
51 bytes.

The BASIC Part
  40 PRINT "U. UNASSEMBLE"
3199 STOP
3200 GOSUB 4000
3210 PRINT "UNASSEMBLE";
3220 GOSUB 3800
3230 CLEAR
3240 LET A$="At least 51 characters"
3250 RAND USR (PEEK 16400+256*PEEK 16401+3)

The above lines are in addition to the BASIC lines of
HEXLD3E which you still need to restore the machine
code to its correct destination.

Operating Instructions
Type RUN to use HEXLD3E's menu and then press "U".

Download available for 16K ZX81 -> sif-disasm.p

Previous | Contents | Next