; Goldfish Demo by Andy Guevara
;
;DATE:  MARCH 15, 1982
;
; Retyped Dec. 11, 2007 by Adam Trionfo (See End Comments)
;
;SYSTEM EQUATES
;
SYSTEM  EQU     0FFH
SYSSUK  EQU     0FFH
RCALL   EQU     04H
MCALL   EQU     06H
ACTINT  EQU     0EH
BMUSIC  EQU     12H
EMUSIC  EQU     14H
FILL    EQU     1AH
RECTAN  EQU     1CH
VWRIT   EQU     1EH
WRITR   EQU     20H
RESTOR  EQU     2EH
STRDIS  EQU     34H
RELAB1  EQU     3AH
VECT    EQU     3EH
GETNUM  EQU     4EH
PAWS    EQU     50H
INDEXW  EQU     5AH
INDEXB  EQU     5CH
MOVEB   EQU     5EH
RANGED  EQU     76H
QUIT    EQU     78H
MSKTD   EQU     7EH
DISP    EQU     0D7H
STRING  EQU     0DFH
CLEAR   EQU     2347H
SPAC    EQU     2451H
NUMDIS  EQU     23D4H
RGDIS   EQU     245EH
MODE    EQU     4FADH
SCRN    EQU     4FB8H
KEYGET  EQU     2496H
NUMPLY  EQU     4FF3H
GAMSTB  EQU     4FF8H
COORD   EQU     4FC3H
POPT    EQU     4FC5H
HIT     EQU     4FBDH
SHOTS   EQU     4FC6H
CT5     EQU     4FDAH
CT6     EQU     4FDBH
CT7     EQU     4FDCH
GTSECS  EQU     4FEDH
GTMINS  EQU     4FEEH
PACT    EQU     4FB7H
XPOS    EQU     0AH
YPOS    EQU     6
XYPOS   EQU     (YPOS SHL 8)+XPOS
XDIM    EQU     140
YDIM    EQU     67
PATX    EQU     02      ;FISH PATTERN X SIZE
PATY    EQU     07      ;    " Y SIZE
;
;
;
        ORG     4B40H
INIT
        LD      A,08
        OUT     (0EH),A ;TURN OFF TAPE OUTPUT
        LD      SP,4FACH
        LD      HL,INIT-4000H  ;SCREEN SIZE
        LD      (SCRN),HL  ; FOR CLEARING
        LD      A,132
        OUT     (0AH),A ;BLANK LINE
        CALL    CLEAR
        DEFB    SYSSUK
        DEFB    ACTINT  ;START INTERRUPTS
        LD      A,0FAH  ; BLUE BACKGROUND
        OUT     (04),A
        LD      A,07
        OUT     (05),A  ;COLOR #1
        LD      (GTSECS),A  ;7 SECOND DELAY
;
        DEFB    SYSSUK
        DEFB    00
;
        DEFB    STRDIS+1
        DEFW    0010H
        DEFB    04
        DEFW    TBFM
;
        DEFB    STRDIS+1
        DEFW    0C34H
        DEFB    04
        DEFW    PMSG
;
        DEFB    STRDIS+1
        DEFW    1918H
        DEFB    01001100B  ;COLOR 3, 2X
        DEFW    BMSG
;
        DEFB    02      ;EXIT
        LD      BC,0707H
CSA     OUT     (C),B   ;COLOR #3
        PUSH    BC
        DEFB    SYSSUK
        DEFB    PAWS+1
        DEFB    3       ;1/20 SECOND
        POP     BC
        LD      A,8     ;CHANGE THE COLOR
        ADD     A,B
        LD      B,A
        LD      A,(GTSECS)  ;CHECK TIME
        AND     A
        JR      NZ,CSA
        CALL    CLEAR
        JP      CSTRT
;
;
;
TBFM    DEFM    'THE BIT FIDDLERS'
        DEFB    00
PMSG    DEFM    'PRESENT'
        DEFB    00
BMSG    DEFM    'GOLDFISH    DEMO'
        DEFB    00
TMSG    DEFM    'PLEASE ENTER THE TIME:'
        DEFB    00
HRMSG   DEFM    'HOUR: '
        DEFB    00
MINMSG  DEFM    'MINS: '
        DEFB    00
CMSG    DEFM    'HIT * KEY TO CHANGE ENTRIES'
        DEFB    0DH
        DEFM    '    ANY OTHER TO CONTINUE'
        DEFB    00
;
;
;COLD START
;
CSTRT   LD      SP,4FACH
CS1     CALL    CLEAR
        LD      HL,1918H  ;SETUP COORDINATES
        LD      (COORD),HL
        DEFB    STRING
        DEFW    TMSG
        LD      HL,2218H
        LD      (COORD),HL
        DEFB    STRING
        DEFW    HRMSG
        DEFB    SYSSUK  ;GET TIME
        DEFB    GETNUM+1
        DEFW    2230H
        DEFB    04
        DEFB    0C2H
        DEFW    CT6
        LD      A,(HL)  ;TEST INPUT
        CP      13H
        JR      NC,CS1  ;GO BACK IF TOO BIG
        AND     A
        JR      Z,CS1   ;OR ZERO
        LD      HL,3018H
        LD      (COORD),HL
        DEFB    STRING
        DEFW    MINMSG  ;GET MINUTES
        DEFB    SYSSUK
        DEFB    GETNUM+1
        DEFW    3030H
        DEFB    04
        DEFB    42H
        DEFW    CT7
        LD      A,(HL)  ;TEST INPUT
        CP      60H
        JR      NC,CS1  ; TOO BIG, START OVER
        LD      HL,3818H
        LD      (COORD),HL
        DEFB    STRING
        DEFW    CMSG
        CALL    KEYGET  ;ASK IF CHANGES
        LD      A,B     ; GET RESPONSE
        CP      21      ; STAR?
        JR      Z,CS1   ;YEP, GO BACK AND CHANGE
        LD      HL,GTSECS
        LD      (HL),59H  ;ZERO OUT SECONDS
        INC     HL      ;SET UP MINUTES
        LD      A,(CT7) ;GET MINUTES INFO
        LD      B,A     ;PUT IN B
        LD      A,59H
        SUB     B       ;ADJUST FOR SYSTEM TIMER
                        ;IT COUNTS DOWN
        LD      (HL),A
;LET'S GET ON WITH IT
        DEFB    SYSTEM
        DEFB    ACTINT  ;START INTERRUPTS
        CALL    CLEAR
        XOR     A
        OUT     (04),A  ;BLACK MAIN BACKGROUND
;
        LD      (MODE),A
        LD      A,0FDH  ;LT. BLUE
        OUT     (6),A   ;COLOR #2
        LD      A,7DH   ;ORANGE
        OUT     (5),A   ;COLOR #1
        LD      A,0ACH  ;LT GREEEN
        OUT     (7),A   ;COLOR #3
;
; PUT IN THE CAT
;
        DEFB    SYSSUK
        DEFB    RECTAN+1
        DEFB    120
        DEFB    49
        DEFB    40
        DEFB    24
        DEFB    01010101B
        XOR     A       ;SET COLOR MASK
        LD      HL,TABAD  ;TABLE ADDRESS
        CALL    DRAW
        LD      A,0FFH  ;ALL ONES
        LD      HL,TAB2
        CALL    DRAW    ; DO THE EYES
;
;
; PAINT THE BOWL
        DEFB    SYSSUK
        DEFB    00      ;START INTERPRETER
        DEFB    RECTAN+1
        DEFW    XYPOS
        DEFB    2
        DEFB    YDIM+2
        DEFB    0AAH    ;COLOR #2...L. BLUE
        DEFB    RECTAN+1
        DEFB    XPOS+2
        DEFB    YPOS+YDIM
        DEFB    XDIM
        DEFB    2
        DEFB    0AAH    ;COLOR #0...BLUE
;WATER UPPER LINE
        DEFB    RECTAN+1
        DEFW    XYPOS+502H  ;DOWN 5 LINES, OVER 2
        DEFB    XDIM
        DEFB    1       ;THIN LINE
        DEFB    0AAH    ;LT. BLUE
;RIGHT SIDE
        DEFB    RECTAN+1
        DEFB    XPOS+XDIM
        DEFB    YPOS
        DEFB    2
        DEFB    YDIM
        DEFB    0AAH
        DEFB    02      ;EXIT INTERPRETER
;SET UP BOTTOM OF BOWL
        LD      H,3
        LD      L,XDIM/4
        LD      (CSTRT-2),HL  ;FAKE OUT SYSTEM
        LD      D,YPOS+YDIM-3
        LD      E,XPOS+2
        XOR     A
        DEFB    SYSTEM
        DEFB    RELAB1  ;3AH
        EX      DE,HL
        LD      DE,CSTRT-2
        DEFB    SYSTEM
        DEFB    RESTOR
;DROP THE REST OF CURTAIN
        LD      A,150
        OUT     (0AH),A
;INITIAL WRITES
        LD      B,7     ;# OF FISH
IW1     DEFB    SYSSUK
        DEFB    RANGED+1
        DEFB    XDIM-5  ;GET A RANDOM X POSITION
        ADD     A,5     ;RANGE IT PROPERLY
        LD      (VBX),A ;PUT IT IN VECTOR BLOCK
        DEFB    SYSSUK
        DEFB    RANGED+1
        DEFB    YDIM-10 ;GET RANDOM Y
        ADD     A,10    ;RANGE IT
        LD      (VBY),A ;PUT IN VB
        CALL RANDELT    ;GET A RANDOM DELTA X
        LD      (VBDX),A ;PUT IN VB
        CALL RANDELT    ;GET DELTA Y
        LD      (VBDY),A
        LD      A,B     ;SET UP TIMER FOR THIS FISH
        DEFB    SYSSUK
        DEFB    INDEXW+1  ;GET PACKET ADDRESS
        DEFW    PACTAB-2  ;PACKET ADDRESS TABLE
        LD      HL,4    ;LOOK AT TIMER FOR THIS FISH
        ADD     HL,DE   ;DE IS FIRST ENTRY IN PACKET
                        ;FIRST INTRO IS X POSITION
        LD      (HL),80H  ;A NUMBER
                        ;INTO THE TIMER
        CALL    WRITE1  ;PUT THIS FISH ON SCREEN
        DJNZ    IW1     ;DO THE NEXT FISH
;INITIALIZE TIME CHECKS
        LD      HL,GAMSTB  ;GAME STATUS BYTE
        SET     0,(HL)  ;DO CHECKS
;SYSTEM WILL SET BIT 7 WHEN TIME TO FLIP HOURS
;
;LET'S START EVERYTHING
GO
        CALL    TIME    ;DO THE CLOCK
        LD      B,7     ;# OF FISH
G1      LD      A,B
        DEFB    SYSSUK  ;GET PACKET ADDRESS FROM TABLE
        DEFB    INDEXW+1
        DEFW    PACTAB-2  ;-2 SINCE ZERO ENTRY NOT USED
        EX      DE,HL   ;MOVE ANSWER TO HL
        LD      A,(HL)  ;GET X POS.
        LD      (VBX),A ;STUFF IT INTO VB
        LD      E,A     ;SAVE IT IN E
                        ;DE USED IN REL. WRITE
        INC     HL
        LD      A,(HL)  ;YPOS
        LD      (VBY),A
        LD      D,A     ;SAVE IT IN D
        INC     HL      ;LOOKING AT DELTA XLOW
        LD      A,(HL)  ;GET IT
        LD      (VBDX),A  ;PUT IT IN VB
        CALL    CKFLOP  ;TEST IF NEG. DELTA
                        ;AND FLOP PICTURE ACCORDINGLY
        INC     HL
        LD      A,(HL)  ;GET    DELTA YLOW
        LD      (VBDY),A
        BIT     7,A     ;FIX DELTA Y HI
        LD      A,0FFH
        JR      NZ,G2
        XOR     A
G2      LD      (VBDY+1),A
        INC     HL      ;SAVE TIMER ADDR
        PUSH    HL
        LD      A,03H   ;TIMEBASE
        LD      (VBTB),A
;UPDATE THE VECTOR BLOCK
        DEFB    SYSSUK
        DEFB    VECT+1
        DEFW    VB
        DEFW    LMTTBL
;PUT BLANK OUT OF SIGHT
        CALL    WAIT
        LD      A,20H   ;MAGIC REG.
        LD      HL,(PATAD)  ;GET READY FOR REL. WRITE
;WRITE1 PUTS A FISH ON THE SCREEN
;WRITR IS USED TO ERASE IT
        DEFB    SYSTEM
        DEFB    WRITR
        POP     HL      ;RETRIEVE TIMER ADDR.
        CALL    WRITE1  ;FIX MAG. REG. AND WRITE
        DJNZ    G1      ;GO BACK AND GET ANOTHER FISH
        JP      GO      ;ALL DONE? THEN START OVER.
;SUBROUTINES
WRITE1
        CALL    TIMECK  ;CHECK TIMER
        CALL    CKFLOP  ; GET RIGHT ORIENTATION
        LD      HL,(PATAD)   ;GET PATTERN ADDRESS
        LD      IX,VB
        DEFB    SYSTEM
        DEFB    VWRIT   ;WRITE FROM VECTOR
;
        LD      A,B     ;GET BACK INDEX
        DEFB    SYSSUK
        DEFB    INDEXW+1
        DEFW    PACTAB-2 ; GET PACKET ADDRESS FOR THIS FISH
        EX      DE,HL
        LD      A,(VBX) ;TAKE FROM VB
        LD      (HL),A  ;PUT IN PACKET
        INC     HL
        LD      A,(VBY)
        LD      (HL),A
        INC     HL
        LD      A,(VBDX)
        LD      (HL),A
        INC     HL
        LD      A,(VBDY)
        LD      (HL),A
        RET
;
TIMECK
;ENTERS WITH HL POINTING TO TIMER IN PACKET
        DEC     (HL)    ;STEP TIMER
        RET     NZ      ;NOT TIMED OUT YET
;
        DEFB    SYSSUK  ;GET A NEW TIME
        DEFB    RANGED+1
        DEFB    50H     ;SOMETHING LESS THAN 50H
        LD      (HL),A  ;PUT INTO PACKET
        CALL    RANDELT ;GET A RANDOM DELTA Y
        LD      (VBDY),A
        CALL    RANDELT ;DO IT FOR DX
        LD      (VBDX),A
        RET             ;AND GO HOME
;
CKFLOP  PUSH    HL      ;SAVE HL REGISTERS
        LD      A,(VBDX)  ;GET DELTA X
        BIT     7,A     ;TEST IF IT'S NEG.
        LD      A,0
        LD      HL,PAT  ;POSITIVE RESPONSES
        JR      Z,CK2
        LD      A,0FFH  ;NEGATIVE RESPONSES
        LD      HL,PAT2
CK2     LD      (VBDX+1),A
        LD      (PATAD),HL
        POP     HL
        RET
;
RANDELT DEFB    SYSSUK  ;GET A RANDOM DELTA
        DEFB    RANGED+1
        DEFB    7FH
        LD      C,A     ;CHECK IF IT'S EVEN/ODD
        RRA             ;SHIFT LO BIT INTO CARRY
        LD      A,C     ;RESTORE IT
        RET     NC      ;IF EVEN, GO HOME
        CPL             ;IF OD, INVERT
        RET             ;AND GO HOME
;
;
;
;DRAW EXPECTS TABLE ADDRESS IN HL
;FIRST ENTRY IS NUMBER OF RECTANGLES TO DRAW
DRAW
        LD      B,(HL)
DR1     PUSH    BC
        INC     HL
        LD      E,(HL)  ;GET X POS
        INC     HL
        LD      D,(HL)  ;GET Y POS
        INC     HL
        LD      C,(HL)  ;GET X SIZE INFO
        INC     HL
        LD      B,(HL)  ;Y SZ
                        ;A IS SET COMING IN
        DEFB    SYSTEM
        DEFB    RECTAN
        POP     BC
        DJNZ    DR1
        RET
;
TIME
        LD      HL,GAMSTB  ;SEE IF HOURS TO FLIP
        BIT     7,(HL)
        JR      NZ,T0   ;DONE--FLIP
        LD      HL,GTSECS  ;GET THE SECONDS COUNTER
        LD      A,(CT7) ;CHECK SECONDS TIMER
        XOR     (HL)    ;SEE IF SAME
        RET     Z       ;GO HOME IF SO
        LD      A,(HL)  ;ELSE UPDATE SECONDS TIMER
        LD      (CT7),A
        INC     HL      ;CHECK MINS TRACKER
        LD      A,(CT5)
        XOR     (HL)
        CALL    NZ,SOUND
        LD      A,(HL)
        LD      (CT5),A ;UPDATE TIMER
        JR      T2      ;AND DISPLAY NEW TIME
T0      LD      A,(CT6) ;GET HOURS INFO
        INC     A       ; INC HOURS
        DAA
        CP      13H
        JR      C,T1    ;IF A<13 MOVE ON
        LD      A,1
T1      LD      (CT6),A ;EITHER CASE, RESULT TO HRS
        LD      A,59H   ;RESET MINUTES
        LD      (GTMINS),A
        LD      (GTSECS),A  ;AND SECONDS
        RES     7,(HL)  ;CLEAR GAME OVER INFO
;CONTINUE
T2
        LD      A,(CT6) ;GET HOURS INFO
        LD      H,YPOS-1  ;X POSITION
        LD      L,60
        LD      (COORD),HL
;
        CP      10H     ;A STILL HAS HOURS INFO
        JR      NC,T3
        PUSH    AF      ;SAVE HRS
        CALL    SPAC
        POP     AF      ;RESTORE HRS INFO
        CALL    NUMDIS  ;DISPLAY IT
        JR      T4
T3      CALL    RGDIS   ;DISPLAY 2 DIGITS
T4      LD      A,':'
        DEFB    DISP
        LD      HL,GTMINS
        LD      A,59H
        SUB     (HL)    ;ADJUST MINUTES FOR DISPLAY
        CALL    RGDIS
        LD      A,':'
        DEFB    DISP
        DEC     HL      ;TO GTSECS
        LD      A,59H
        SUB     (HL)    ;ADJUST
        CALL    RGDIS   ;SHOW IT
        LD      DE,(COORD)  ;ERASE CURSOR
        LD      BC,0503H  ;3X5 BOX
        XOR     A       ;COLOR 0
        DEFB    SYSTEM
        DEFB    RECTAN
        RET             ;ALL DONE
;
SOUND
        PUSH    HL      ;SAVE HL
        DEFB    SYSSUK  ; START MUSIC
        DEFB    BMUSIC+1
        DEFW    4F12H   ;WHERE MUSIC STACK IS
        DEFB    0C0H    ;INFO BYTE
        DEFW    SCORE
        POP     HL
        RET             ; GO HOME
;
SCORE
        DEFB    80H     ;MASTER
        DEFB    09H     ;OSCIL. OFFSET
        DEFB    0B0H    ;VOLUME
        DEFB    09H     ;VOL. B=0, VOL. A=9
        DEFB    2FH     ;VOL. C=F, NOISE ON
;
        DEFB    0E0H    ;LEGSTA
        DEFB    04      ;NOTE LENGTH
        DEFB    50H     ;PITCH
        DEFB    03      ;LENGTH
        DEFB    4CH     ;PITCH
        DEFB    08      ;L
        DEFB    46H     ;P
        DEFB    10H
        DEFB    45H
        DEFB    08
        DEFB    46H
        DEFB    02
        DEFB    47H
        DEFB    0F0H    ;QUIET
;
TABAD
        DEFB    19      ;NO. OF RECTANS
        DEFB    120     ;X POS
        DEFB    49      ;Y POS
        DEFB    24      ;X SZ
        DEFB    1       ;Y SZ
;
        DEFB    120,57,1,18
        DEFB    121,61,1,14
        DEFB    122,50,20,1
        DEFB    122,65,1,10
        DEFB    123,51,17,1
        DEFB    123,69,1,6
        DEFB    124,52,15,1
        DEFB    124,70,1,5
        DEFB    125,53,3,1
        DEFB    125,71,1,4
        DEFB    126,72,2,3
        DEFB    136,53,2,1
        DEFB    145,49,1,4
        DEFB    146,49,1,3
        DEFB    147,49,3,2
        DEFB    150,49,3,1
        DEFB    129,64,5,1
        DEFB    130,65,3,1
;
TAB2
        DEFB    2
        DEFB    126,59,3,3
        DEFB    135,59,3,3
;
WAIT    HALT            ;HOLD EVERYTHING
        ; INTERRUPT ROUTINE WILL CONTINUE FROM HERE
        RET
;
;VECTOR BLOCK
VB
VBMR    DEFB    20H     ;MAGIC REGISTER
        DEFB    80H     ;STATUS
VBTB    DEFB    00      ;TIMEBASE
VBDX    DEFB    00      ;DELTA X LOW
        DEFB    00      ;DELTA X HI
        DEFB    00      ;XPOS. LOW
VBX     DEFB    00      ;XPOS. HI
        DEFB    03      ;X LIMIT CHECK
VBDY    DEFB    05      ;DELTA Y LO
        DEFB    00      ;DELTA Y HI
        DEFB    00      ;Y POS LO
VBY     DEFB    00      ;Y POS HI
        DEFB    03      ;Y CHECKS
;
;LIMIT TABLE
LMTTBL  DEFB    XPOS+2  ;X LOWER LIMIT
        DEFB    XPOS+XDIM-(PATX*4)  ;X UPPER
        DEFB    YPOS+7  ;Y LOWER
        DEFB    YPOS+YDIM-PATY
;
;FISH PATTERN
PAT
        DEFW    00      ;PATTERN OFFSET
        DEFB    PATX    ;PATTERN SIZE (BYTES)
                        ;4 PIXELS PER BYTE
        DEFB    PATY    ;Y SIZE (LINES)
        DEFB    40H,50H
        DEFB    0A2H,0A8H
        DEFB    55H,55H
        DEFB    2AH,0A1H
        DEFB    55H,15H
        DEFB    0A1H,41H
        DEFB    40H,54H
;
;PATTERN 2: FACING THE OTHER WAY
PAT2
        DEFW    00
        DEFB    PATX
        DEFB    PATY
        DEFB    05H,01H
        DEFB    2AH,8AH
        DEFB    55H,55H
        DEFB    4AH,0A8H
        DEFB    54H,55H
        DEFB    41H,4AH
        DEFB    15H,01H
;
PATAD   DEFW    0       ;PATTERN ADDRESS TO USE
;PACKET TABLE
PACTAB  DEFW    PACK1
        DEFW    PACK2
        DEFW    PACK3
        DEFW    PACK4
        DEFW    PACK5
        DEFW    PACK6
        DEFW    PACK7
;
PACK1   DEFS    5       ; 5 BYTES OF INFO PER PACKET
PACK2   DEFS    5
PACK3   DEFS    5
PACK4   DEFS    5
PACK5   DEFS    5
PACK6   DEFS    5
PACK7   DEFS    5
;
COLMSK          ;COLOR MASK STORAGE
;
END
;
; Goldfish Demo by Andy Guevara
; March 15, 1982
; -----------------------------
;
; This program is for the Bally Astrocade game console and
; the Machine Language Manager cartridge.
;
; Overview
; --------
;
; 'Goldfish Demo' won't run unless it is loaded from tape into
; Machine Language Manager. The program is meant to reside at
; memory location $4B40. Here are the brief, hand-written
; instructions that I found with the source-code:
;
; Goldfish Instructions
;
; Hit RESET
; Hit CALL
; Enter B then WRITE for # of text lines
; Enter four WRITES
; Type * READ
; Start Recorder
; When done loading
; Type **4B40 CALL
;
; Time entered using keypad or JY(1)
;
;
; Assembling Instructions
; -----------------------
;
; To assemble this Z-80 source code using the ZMAC assembler:
;  
; zmac -d -o <outfile> -x <listfile> <filename>
;  
; For example, assemble this Astrocade Z-80 ROM file:
;
; zmac -i -m -o goldfish.bin -x goldfish.lst goldfish.asm
;
;
; End Comments - Changes/Updates (By Adam Trionfo)
; ------------------------------
;
; Version 1.01 (July 29, 2013)
;    - Replaced non-ASCII apostrophe mark with ASCII version
;      throughout entire document.
;    - Changed Zmac command line example to reflect file name change.    
;
; Version 1.0 (Dec. 11, 2007)
;
;    - Program first re-typed from source-code
;      provided by listing discovered in Astrocade
;      lot bought from Larry Anderson.  The lot contains
;      much of the printed material that was owned by Robert
;      Fabris, the publisher of 'The Arcadian' newsletter.
;
;    - All program lines correspond to the original program.
;
;    - Changed these lines to match syntax of ZMac:
;         35  - SPACE can't be used as an equate because Zmac uses
;               it as a pseudo-op.  Changed SPACE to SPAC
;         55  - (YPOS.SHL.8)+XPOS to (YPOS SHL 8)+XPOS
;         335 - LT is a reserved word (meaning less than).  Changed
;               LT to LMTTBL (Limit Table).
;         473 - SPACE can't be used as an equate because Zmac uses
;               it as a pseudo-op.  Changed SPACE to SPAC
;         581 - LT is a reserved word (meaning less than).  Changed
;               LT to LMTTBL (Limit Table).
;
;    - Checked this program for typing errors.  Compared the
;      listing of this program against the original listing.
;      It matches byte for byte.
;
; ***** End of Comments *****
