CPU-Z80-Disassembler

 view release on metacpan or  search on metacpan

t/data/zx81.ctl  view on Meta::CPAN

	:;

0008:C
	:#; -------------------
	:#; THE 'ERROR' RESTART
	:#; -------------------
	:#; The error restart deals immediately with an error. ZX computers execute the 
	:#; same code in runtime as when checking syntax. If the error occurred while 
	:#; running a program then a brief report is produced. If the error occurred
	:#; while entering a BASIC line or in input etc., then the error marker indicates
	:#; the exact point at which the error lies.
	:#
	:#;; ERROR-1
0008 2A1640     ld hl, ($4016)	:C ERROR_1
	:; fetch character address from CH_ADD.

000B:C
000B 221840     ld ($4018), hl	:C
	:; and set the error pointer X_PTR.

000E:C
000E 1846       jr $0056	:C
	:; forward to continue at ERROR-2.
	:;

0010:C
	:#; -------------------------------
	:#; THE 'PRINT A CHARACTER' RESTART
	:#; -------------------------------
	:#; This restart prints the character in the accumulator using the alternate
	:#; register set so there is no requirement to save the main registers.
	:#; There is sufficient room available to separate a space (zero) from other
	:#; characters as leading spaces need not be considered with a space.
	:#
	:#;; PRINT-A
0010 A7         and a	:C PRINT_A
	:; test for zero - space.

0011:C
0011 C2F107     jp nz, $07F1	:C
	:; jump forward if not to PRINT-CH.
	:;

0014:C
0014 C3F507     jp $07F5	:C
	:; jump forward to PRINT-SP.
	:;
	:; ---
	:;

0017:B
0017-0017 FF	:B
	:; unused location.
	:;

0018:C
	:#; ---------------------------------
	:#; THE 'COLLECT A CHARACTER' RESTART
	:#; ---------------------------------
	:#; The character addressed by the system variable CH_ADD is fetched and if it
	:#; is a non-space, non-cursor character it is returned else CH_ADD is 
	:#; incremented and the new addressed character tested until it is not a space.
	:#
	:#;; GET-CHAR
0018 2A1640     ld hl, ($4016)	:C GET_CHAR
	:; set HL to character address CH_ADD.

001B:C
001B 7E         ld a, (hl)	:C
	:; fetch addressed character to A.
	:;

001C:C
	:#;; TEST-SP
001C A7         and a	:C TEST_SP
	:; test for space.

001D:C
001D C0         ret nz	:C
	:; return if not a space
	:;

001E:C
001E 00         nop	:C
	:; else trickle through

001F:C
001F 00         nop	:C
	:; to the next routine.
	:;

0020:C
	:#; ------------------------------------
	:#; THE 'COLLECT NEXT CHARACTER' RESTART
	:#; ------------------------------------
	:#; The character address in incremented and the new addressed character is 
	:#; returned if not a space, or cursor, else the process is repeated.
	:#
	:#;; NEXT-CHAR
0020 CD4900     call $0049	:C NEXT_CHAR
	:; routine CH-ADD+1 gets next immediate
	:; character.

0023:C
0023 18F7       jr $001C	:C
	:; back to TEST-SP.
	:;

0025:B
	:#; ---
	:#
0025-0027 FFFFFF	:B
	:; unused locations.
	:;

0028:C
	:#; ---------------------------------------
	:#; THE 'FLOATING POINT CALCULATOR' RESTART
	:#; ---------------------------------------
	:#; this restart jumps to the recursive floating-point calculator.
	:#; the ZX81's internal, FORTH-like, stack-based language.
	:#;
	:#; In the five remaining bytes there is, appropriately, enough room for the
	:#; end-calc literal - the instruction which exits the calculator.
	:#
	:#;; FP-CALC
0028 C39D19     jp $199D	:C FP_CALC
	:; jump immediately to the CALCULATE routine.
	:;

002B:C
	:#; ---
	:#
	:#;; end-calc
002B F1         pop af	:C end_calc
	:; drop the calculator return address RE-ENTRY

002C:C
002C D9         exx	:C
	:; switch to the other set.
	:;

002D:C
002D E3         ex (sp), hl	:C
	:; transfer H'L' to machine stack for the
	:; return address.
	:; when exiting recursion then the previous
	:; pointer is transferred to H'L'.
	:;

002E:C
002E D9         exx	:C
	:; back to main set.

002F:C
002F C9         ret	:C
	:; return.

t/data/zx81.ctl  view on Meta::CPAN


0043:C
0043 FB         ei	:C
	:; (4) Enable Interrupts.  [ R is now $DE ].
	:;

0044:C
0044 E9         jp (hl)	:C
	:; (4) jump to the echo display file in upper
	:;     memory and execute characters $00 - $3F 
	:;     as NOP instructions.  The video hardware 
	:;     is able to read these characters and, 
	:;     with the I register is able to convert 
	:;     the character bitmaps in this ROM into a 
	:;     line of bytes. Eventually the NEWLINE/HALT
	:;     will be encountered before R reaches $FF. 
	:;     It is however the transition from $FF to 
	:;     $80 that triggers the next interrupt.
	:;     [ The Refresh register is now $DF ]
	:;

0045:C
	:#; ---
	:#
	:#;; SCAN-LINE
0045 D1         pop de	:C SCAN_LINE
	:; (10) discard the address after NEWLINE as the 
	:;      same text line has to be done again
	:;      eight times. 
	:;

0046:C
0046 C8         ret z	:C
	:; (5)  Harmless Nonsensical Timing.
	:;      (condition never met)
	:;

0047:C
0047 18F8       jr $0041	:C
	:; (12) back to WAIT-INT
	:;

0049:C
	:#;   Note. that a computer with less than 4K or RAM will have a collapsed
	:#;   display file and the above mechanism deals with both types of display.
	:#;
	:#;   With a full display, the 32 characters in the line are treated as NOPS
	:#;   and the Refresh register rises from $E0 to $FF and, at the next instruction 
	:#;   - HALT, the interrupt occurs.
	:#;   With a collapsed display and an initial NEWLINE/HALT, it is the NOPs 
	:#;   generated by the HALT that cause the Refresh value to rise from $E0 to $FF,
	:#;   triggering an Interrupt on the next transition.
	:#;   This works happily for all display lines between these extremes and the 
	:#;   generation of the 32 character, 1 pixel high, line will always take 128 
	:#;   clock cycles.
	:#
	:#; ---------------------------------
	:#; THE 'INCREMENT CH-ADD' SUBROUTINE
	:#; ---------------------------------
	:#; This is the subroutine that increments the character address system variable
	:#; and returns if it is not the cursor character. The ZX81 has an actual 
	:#; character at the cursor position rather than a pointer system variable
	:#; as is the case with prior and subsequent ZX computers.
	:#
	:#;; CH-ADD+1
0049 2A1640     ld hl, ($4016)	:C CH_ADD_1
	:; fetch character address to CH_ADD.
	:;

004C:C
	:#;; TEMP-PTR1
004C 23         inc hl	:C TEMP_PTR1
	:; address next immediate location.
	:;

004D:C
	:#;; TEMP-PTR2
004D 221640     ld ($4016), hl	:C TEMP_PTR2
	:; update system variable CH_ADD.
	:;

0050:C
0050 7E         ld a, (hl)	:C
	:; fetch the character.

0051:C
0051 FE7F       cp $7F	:C
	:; compare to cursor character.

0053:C
0053 C0         ret nz	:C
	:; return if not the cursor.
	:;

0054:C
0054 18F6       jr $004C	:C
	:; back for next character to TEMP-PTR1.
	:;

0056:C
	:#; --------------------
	:#; THE 'ERROR-2' BRANCH
	:#; --------------------
	:#; This is a continuation of the error restart.
	:#; If the error occurred in runtime then the error stack pointer will probably
	:#; lead to an error report being printed unless it occurred during input.
	:#; If the error occurred when checking syntax then the error stack pointer
	:#; will be an editing routine and the position of the error will be shown
	:#; when the lower screen is reprinted.
	:#
	:#;; ERROR-2
0056 E1         pop hl	:C ERROR_2
	:; pop the return address which points to the
	:; DEFB, error code, after the RST 08.

0057:C
0057 6E         ld l, (hl)	:C
	:; load L with the error code. HL is not needed
	:; anymore.
	:;

0058:C
	:#;; ERROR-3
0058 FD7500     ld (iy), l	:C ERROR_3
	:; place error code in system variable ERR_NR

005B:C
005B ED7B0240   ld sp, ($4002)	:C
	:; set the stack pointer from ERR_SP

005F:C
005F CD0702     call $0207	:C
	:; routine SLOW/FAST selects slow mode.

0062:C
0062 C3BC14     jp $14BC	:C
	:; exit to address on stack via routine SET-MIN.
	:;

0065:B
	:#; ---
	:#
0065-0065 FF	:B
	:; unused.
	:;

0066:C
	:#; ------------------------------------
	:#; THE 'NON MASKABLE INTERRUPT' ROUTINE
	:#; ------------------------------------
	:#;   Jim Westwood's technical dodge using Non-Maskable Interrupts solved the
	:#;   flicker problem of the ZX80 and gave the ZX81 a multi-tasking SLOW mode 

t/data/zx81.ctl  view on Meta::CPAN

	:; /

00A9:B
00A9-00A9 E3	:B
	:; STOP

00AA:B
00AA-00AA E1	:B
	:; LPRINT

00AB:B
00AB-00AB E4	:B
	:; SLOW

00AC:B
00AC-00AC E5	:B
	:; FAST

00AD:B
00AD-00AD E2	:B
	:; LLIST

00AE:B
00AE-00AE C0	:B
	:; ""

00AF:B
00AF-00AF D9	:B
	:; OR

00B0:B
00B0-00B0 E0	:B
	:; STEP

00B1:B
00B1-00B1 DB	:B
	:; <=

00B2:B
00B2-00B2 DD	:B
	:; <>

00B3:B
00B3-00B3 75	:B
	:; EDIT

00B4:B
00B4-00B4 DA	:B
	:; AND

00B5:B
00B5-00B5 DE	:B
	:; THEN

00B6:B
00B6-00B6 DF	:B
	:; TO

00B7:B
00B7-00B7 72	:B
	:; cursor-left

00B8:B
00B8-00B8 77	:B
	:; RUBOUT

00B9:B
00B9-00B9 74	:B
	:; GRAPHICS

00BA:B
00BA-00BA 73	:B
	:; cursor-right

00BB:B
00BB-00BB 70	:B
	:; cursor-up

00BC:B
00BC-00BC 71	:B
	:; cursor-down

00BD:B
00BD-00BD 0B	:B
	:; "

00BE:B
00BE-00BE 11	:B
	:; )

00BF:B
00BF-00BF 10	:B
	:; (

00C0:B
00C0-00C0 0D	:B
	:; $

00C1:B
00C1-00C1 DC	:B
	:; >=

00C2:B
00C2-00C2 79	:B
	:; FUNCTION

00C3:B
00C3-00C3 14	:B
	:; =

00C4:B
00C4-00C4 15	:B
	:; +

00C5:B
00C5-00C5 16	:B
	:; -

00C6:B
00C6-00C6 D8	:B
	:; **

00C7:B
00C7-00C7 0C	:B
	:; ukp

00C8:B
00C8-00C8 1A	:B
	:; ,

00C9:B
00C9-00C9 12	:B
	:; >

00CA:B
00CA-00CA 13	:B
	:; <

00CB:B
00CB-00CB 17	:B
	:; *

t/data/zx81.ctl  view on Meta::CPAN

03F6:C
03F6 ED56       im 1	:C
	:; select Z80 Interrupt Mode 1.
	:;

03F8:C
03F8 FD210040   ld iy, $4000	:C
	:; set IY to the start of RAM so that the 
	:; system variables can be indexed.

03FC:C
03FC FD363B40   ld (iy+$3B), $40	:C
	:; set CDFLAG 0100 0000. Bit 6 indicates 
	:; Compute nad Display required.
	:;

0400:C
0400 217D40     ld hl, $407D	:C
	:; The first location after System Variables -
	:; 16509 decimal.

0403:C
0403 220C40     ld ($400C), hl	:C
	:; set system variable D_FILE to this value.

0406:C
0406 0619       ld b, $19	:C
	:; prepare minimal screen of 24 NEWLINEs
	:; following an initial NEWLINE.
	:;

0408:C
	:#;; LINE
0408 3676       ld (hl), $76	:C LINE
	:; insert NEWLINE (HALT instruction)

040A:C
040A 23         inc hl	:C
	:; point to next location.

040B:C
040B 10FB       djnz $0408	:C
	:; loop back for all twenty five to LINE
	:;

040D:C
040D 221040     ld ($4010), hl	:C
	:; set system variable VARS to next location
	:;

0410:C
0410 CD9A14     call $149A	:C
	:; routine CLEAR sets $80 end-marker and the 
	:; dynamic memory pointers E_LINE, STKBOT and
	:; STKEND.
	:;

0413:C
	:#;; N/L-ONLY
0413 CDAD14     call $14AD	:C N_L_ONLY
	:; routine CURSOR-IN inserts the cursor and 
	:; end-marker in the Edit Line also setting
	:; size of lower display to two lines.
	:;

0416:C
0416 CD0702     call $0207	:C
	:; routine SLOW/FAST selects COMPUTE and DISPLAY
	:;

0419:C
	:#; ---------------------------
	:#; THE 'BASIC LISTING' SECTION
	:#; ---------------------------
	:#;
	:#;
	:#
	:#;; UPPER
0419 CD2A0A     call $0A2A	:C UPPER
	:; routine CLS

041C:C
041C 2A0A40     ld hl, ($400A)	:C
	:; sv E_PPC_lo

041F:C
041F ED5B2340   ld de, ($4023)	:C
	:; sv S_TOP_lo

0423:C
0423 A7         and a	:C
	:;

0424:C
0424 ED52       sbc hl, de	:C
	:;

0426:C
0426 EB         ex de, hl	:C
	:;

0427:C
0427 3004       jr nc, $042D	:C
	:; to ADDR-TOP
	:;

0429:C
0429 19         add hl, de	:C
	:;

042A:C
042A 222340     ld ($4023), hl	:C
	:; sv S_TOP_lo
	:;

042D:C
	:#;; ADDR-TOP
042D CDD809     call $09D8	:C ADDR_TOP
	:; routine LINE-ADDR

0430:C

t/data/zx81.ctl  view on Meta::CPAN

0459:C
0459 56         ld d, (hl)	:C
	:;

045A:C
045A E5         push hl	:C
	:;

045B:C
045B EB         ex de, hl	:C
	:;

045C:C
045C 23         inc hl	:C
	:;

045D:C
045D CDD809     call $09D8	:C
	:; routine LINE-ADDR

0460:C
0460 CDBB05     call $05BB	:C
	:; routine LINE-NO

0463:C
0463 E1         pop hl	:C
	:;
	:;

0464:C
	:#;; KEY-INPUT
0464 FDCB2D6E   bit 5, (iy+$2D)	:C KEY_INPUT
	:; sv FLAGX

0468:C
0468 2008       jr nz, $0472	:C
	:; forward to LOWER
	:;

046A:C
046A 72         ld (hl), d	:C
	:;

046B:C
046B 2B         dec hl	:C
	:;

046C:C
046C 73         ld (hl), e	:C
	:;

046D:C
046D 18AA       jr $0419	:C
	:; to UPPER
	:;

046F:C
	:#; ----------------------------
	:#; THE 'EDIT LINE COPY' SECTION
	:#; ----------------------------
	:#; This routine sets the edit line to just the cursor when
	:#; 1) There is not enough memory to edit a BASIC line.
	:#; 2) The edit key is used during input.
	:#; The entry point LOWER
	:#
	:#
	:#;; EDIT-INP
046F CDAD14     call $14AD	:C EDIT_INP
	:; routine CURSOR-IN sets cursor only edit line.
	:;

0472:C
	:#; ->
	:#
	:#;; LOWER
0472 2A1440     ld hl, ($4014)	:C LOWER
	:; fetch edit line start from E_LINE.
	:;

0475:C
	:#;; EACH-CHAR
0475 7E         ld a, (hl)	:C EACH_CHAR
	:; fetch a character from edit line.

0476:C
0476 FE7E       cp $7E	:C
	:; compare to the number marker.

0478:C
0478 2008       jr nz, $0482	:C
	:; forward if not to END-LINE
	:;

047A:C
047A 010600     ld bc, $0006	:C
	:; else six invisible bytes to be removed.

047D:C
047D CD600A     call $0A60	:C
	:; routine RECLAIM-2

0480:C
0480 18F3       jr $0475	:C
	:; back to EACH-CHAR
	:;

0482:C
	:#; ---
	:#
	:#;; END-LINE
0482 FE76       cp $76	:C END_LINE
	:;

0484:C
0484 23         inc hl	:C
	:;

0485:C
0485 20EE       jr nz, $0475	:C
	:; to EACH-CHAR
	:;

0487:C
	:#;; EDIT-LINE
0487 CD3705     call $0537	:C EDIT_LINE
	:; routine CURSOR sets cursor K or L.
	:;

048A:C
	:#;; EDIT-ROOM
048A CD1F0A     call $0A1F	:C EDIT_ROOM
	:; routine LINE-ENDS

048D:C
048D 2A1440     ld hl, ($4014)	:C
	:; sv E_LINE_lo

0490:C
0490 FD3600FF   ld (iy), $FF	:C
	:; sv ERR_NR

0494:C
0494 CD6607     call $0766	:C
	:; routine COPY-LINE

0497:C
0497 FDCB007E   bit 7, (iy)	:C
	:; sv ERR_NR

049B:C
049B 2024       jr nz, $04C1	:C
	:; to DISPLAY-6
	:;

049D:C
049D 3A2240     ld a, ($4022)	:C
	:; sv DF_SZ

04A0:C
04A0 FE18       cp $18	:C
	:;

04A2:C
04A2 301D       jr nc, $04C1	:C
	:; to DISPLAY-6
	:;

04A4:C
04A4 3C         inc a	:C
	:;

04A5:C
04A5 322240     ld ($4022), a	:C
	:; sv DF_SZ

04A8:C
04A8 47         ld b, a	:C
	:;

04A9:C
04A9 0E01       ld c, $01	:C
	:;

04AB:C
04AB CD1809     call $0918	:C
	:; routine LOC-ADDR

t/data/zx81.ctl  view on Meta::CPAN

05BE 20F7       jr nz, $05B7	:C
	:; to ZERO-DE
	:;

05C0:C
05C0 56         ld d, (hl)	:C
	:;

05C1:C
05C1 23         inc hl	:C
	:;

05C2:C
05C2 5E         ld e, (hl)	:C
	:;

05C3:C
05C3 C9         ret	:C
	:;
	:;

05C4:C
	:#; ----------------------
	:#; THE 'EDIT KEY' ROUTINE
	:#; ----------------------
	:#;
	:#;
	:#
	:#;; EDIT-KEY
05C4 CD1F0A     call $0A1F	:C EDIT_KEY
	:; routine LINE-ENDS clears lower display.
	:;

05C7:C
05C7 216F04     ld hl, $046F	:C
	:; Address: EDIT-INP

05CA:C
05CA E5         push hl	:C
	:; ** is pushed as an error looping address.
	:;

05CB:C
05CB FDCB2D6E   bit 5, (iy+$2D)	:C
	:; test FLAGX

05CF:C
05CF C0         ret nz	:C
	:; indirect jump if in input mode
	:; to L046F, EDIT-INP (begin again).
	:;

05D0:C
	:#;
	:#
05D0 2A1440     ld hl, ($4014)	:C
	:; fetch E_LINE

05D3:C
05D3 220E40     ld ($400E), hl	:C
	:; and use to update the screen cursor DF_CC
	:;

05D6:C
	:#; so now RST $10 will print the line numbers to the edit line instead of screen.
	:#; first make sure that no newline/out of screen can occur while sprinting the
	:#; line numbers to the edit line.
	:#
05D6 212118     ld hl, $1821	:C
	:; prepare line 0, column 0.

05D9:C
05D9 223940     ld ($4039), hl	:C
	:; update S_POSN with these dummy values.
	:;

05DC:C
05DC 2A0A40     ld hl, ($400A)	:C
	:; fetch current line from E_PPC may be a 
	:; non-existent line e.g. last line deleted.

05DF:C
05DF CDD809     call $09D8	:C
	:; routine LINE-ADDR gets address or that of
	:; the following line.

05E2:C
05E2 CDBB05     call $05BB	:C
	:; routine LINE-NO gets line number if any in DE
	:; leaving HL pointing at second low byte.
	:;

05E5:C
05E5 7A         ld a, d	:C
	:; test the line number for zero.

05E6:C
05E6 B3         or e	:C
	:;

05E7:C
05E7 C8         ret z	:C
	:; return if no line number - no program to edit.
	:;

05E8:C
05E8 2B         dec hl	:C
	:; point to high byte.

05E9:C
05E9 CDA50A     call $0AA5	:C
	:; routine OUT-NO writes number to edit line.
	:;

05EC:C
05EC 23         inc hl	:C
	:; point to length bytes.

05ED:C
05ED 4E         ld c, (hl)	:C
	:; low byte to C.

05EE:C
05EE 23         inc hl	:C
	:;

05EF:C
05EF 46         ld b, (hl)	:C
	:; high byte to B.
	:;

05F0:C
05F0 23         inc hl	:C
	:; point to first character in line.

05F1:C
05F1 ED5B0E40   ld de, ($400E)	:C
	:; fetch display file cursor DF_CC
	:;

05F5:C
05F5 3E7F       ld a, $7F	:C
	:; prepare the cursor character.

05F7:C
05F7 12         ld (de), a	:C
	:; and insert in edit line.

05F8:C
05F8 13         inc de	:C
	:; increment intended destination.
	:;

05F9:C
05F9 E5         push hl	:C
	:; * save start of BASIC.
	:;

05FA:C
05FA 211D00     ld hl, $001D	:C
	:; set an overhead of 29 bytes.

05FD:C
05FD 19         add hl, de	:C
	:; add in the address of cursor.

05FE:C
05FE 09         add hl, bc	:C
	:; add the length of the line.

05FF:C
05FF ED72       sbc hl, sp	:C
	:; subtract the stack pointer.
	:;

0601:C
0601 E1         pop hl	:C
	:; * restore pointer to start of BASIC.
	:;

0602:C
0602 D0         ret nc	:C
	:; return if not enough room to L046F EDIT-INP.
	:; the edit key appears not to work.
	:;

0603:C
0603 EDB0       ldir	:C
	:; else copy bytes from program to edit line.
	:; Note. hidden floating point forms are also
	:; copied to edit line.
	:;

0605:C
0605 EB         ex de, hl	:C
	:; transfer free location pointer to HL
	:;

0606:C
0606 D1         pop de	:C
	:; ** remove address EDIT-INP from stack.
	:;

0607:C
0607 CDA614     call $14A6	:C
	:; routine SET-STK-B sets STKEND from HL.
	:;

060A:C
060A 1891       jr $059D	:C
	:; back to ENDED-2 and after 3 more jumps
	:; to L0472, LOWER.
	:; Note. The LOWER routine removes the hidden 
	:; floating-point numbers from the edit line.
	:;

060C:C
	:#; -------------------------
	:#; THE 'NEWLINE KEY' ROUTINE
	:#; -------------------------
	:#;
	:#;
	:#
	:#;; N/L-KEY
060C CD1F0A     call $0A1F	:C N_L_KEY

t/data/zx81.ctl  view on Meta::CPAN

	:;

0789:C
0789 FE7F       cp $7F	:C
	:;

078B:C
078B 2810       jr z, $079D	:C
	:; to OUT-CURS
	:;

078D:C
078D FE76       cp $76	:C
	:;

078F:C
078F 285D       jr z, $07EE	:C
	:; to OUT-CH
	:;

0791:C
0791 CB77       bit 6, a	:C
	:;

0793:C
0793 2805       jr z, $079A	:C
	:; to NOT-TOKEN
	:;

0795:C
0795 CD4B09     call $094B	:C
	:; routine TOKENS

0798:C
0798 18D3       jr $076D	:C
	:; to MORE-LINE
	:;

079A:C
	:#; ---
	:#
	:#
	:#;; NOT-TOKEN
079A D7         rst $10	:C NOT_TOKEN
	:; PRINT-A

079B:C
079B 18D0       jr $076D	:C
	:; to MORE-LINE
	:;

079D:C
	:#; ---
	:#
	:#;; OUT-CURS
079D 3A0640     ld a, ($4006)	:C OUT_CURS
	:; Fetch value of system variable MODE

07A0:C
07A0 06AB       ld b, $AB	:C
	:; Prepare an inverse [F] for function cursor.
	:;

07A2:C
07A2 A7         and a	:C
	:; Test for zero -

07A3:C
07A3 2005       jr nz, $07AA	:C
	:; forward if not to FLAGS-2
	:;

07A5:C
07A5 3A0140     ld a, ($4001)	:C
	:; Fetch system variable FLAGS.

07A8:C
07A8 06B0       ld b, $B0	:C
	:; Prepare an inverse [K] for keyword cursor.
	:;

07AA:C
	:#;; FLAGS-2
07AA 1F         rra	:C FLAGS_2
	:; 00000?00 -> 000000?0

07AB:C
07AB 1F         rra	:C
	:; 000000?0 -> 0000000?

07AC:C
07AC E601       and $01	:C
	:; 0000000?    0000000x
	:;

07AE:C
07AE 80         add a, b	:C
	:; Possibly [F] -> [G]  or  [K] -> [L]
	:;

07AF:C
07AF CDF507     call $07F5	:C
	:; routine PRINT-SP prints character 

07B2:C
07B2 18B9       jr $076D	:C
	:; back to MORE-LINE
	:;

07B4:C
	:#; -----------------------
	:#; THE 'NUMBER' SUBROUTINE
	:#; -----------------------
	:#;
	:#;
	:#
	:#;; NUMBER
07B4 FE7E       cp $7E	:C NUMBER
	:;

07B6:C
07B6 C0         ret nz	:C
	:;
	:;

07B7:C
07B7 23         inc hl	:C
	:;

07B8:C
07B8 23         inc hl	:C
	:;

07B9:C
07B9 23         inc hl	:C
	:;

07BA:C
07BA 23         inc hl	:C

t/data/zx81.ctl  view on Meta::CPAN

	:#;
	:#;
	:#
	:#;; CLEAR
149A 2A1040     ld hl, ($4010)	:C CLEAR
	:; sv VARS_lo

149D:C
149D 3680       ld (hl), $80	:C
	:;

149F:C
149F 23         inc hl	:C
	:;

14A0:C
14A0 221440     ld ($4014), hl	:C
	:; sv E_LINE_lo
	:;

14A3:C
	:#; -----------------------
	:#; THE 'X-TEMP' SUBROUTINE
	:#; -----------------------
	:#;
	:#;
	:#
	:#;; X-TEMP
14A3 2A1440     ld hl, ($4014)	:C X_TEMP
	:; sv E_LINE_lo
	:;

14A6:C
	:#; ----------------------
	:#; THE 'SET-STK' ROUTINES
	:#; ----------------------
	:#;
	:#;
	:#
	:#;; SET-STK-B
14A6 221A40     ld ($401A), hl	:C SET_STK_B
	:; sv STKBOT
	:;

14A9:C
	:#;
	:#
	:#;; SET-STK-E
14A9 221C40     ld ($401C), hl	:C SET_STK_E
	:; sv STKEND

14AC:C
14AC C9         ret	:C
	:;
	:;

14AD:C
	:#; -----------------------
	:#; THE 'CURSOR-IN' ROUTINE
	:#; -----------------------
	:#; This routine is called to set the edit line to the minimum cursor/newline
	:#; and to set STKEND, the start of free space, at the next position.
	:#
	:#;; CURSOR-IN
14AD 2A1440     ld hl, ($4014)	:C CURSOR_IN
	:; fetch start of edit line from E_LINE

14B0:C
14B0 367F       ld (hl), $7F	:C
	:; insert cursor character
	:;

14B2:C
14B2 23         inc hl	:C
	:; point to next location.

14B3:C
14B3 3676       ld (hl), $76	:C
	:; insert NEWLINE character

14B5:C
14B5 23         inc hl	:C
	:; point to next free location.
	:;

14B6:C
14B6 FD362202   ld (iy+$22), $02	:C
	:; set lower screen display file size DF_SZ
	:;

14BA:C
14BA 18EA       jr $14A6	:C
	:; exit via SET-STK-B above
	:;

14BC:C
	:#; ------------------------
	:#; THE 'SET-MIN' SUBROUTINE
	:#; ------------------------
	:#;
	:#;
	:#
	:#;; SET-MIN
14BC 215D40     ld hl, $405D	:C SET_MIN
	:; normal location of calculator's memory area

14BF:C
14BF 221F40     ld ($401F), hl	:C
	:; update system variable MEM

14C2:C
14C2 2A1A40     ld hl, ($401A)	:C
	:; fetch STKBOT

14C5:C
14C5 18E2       jr $14A9	:C
	:; back to SET-STK-E
	:;
	:;

14C7:C
	:#; ------------------------------------
	:#; THE 'RECLAIM THE END-MARKER' ROUTINE
	:#; ------------------------------------
	:#
	:#;; REC-V80
14C7 ED5B1440   ld de, ($4014)	:C REC_V80
	:; sv E_LINE_lo

14CB:C



( run in 1.073 second using v1.01-cache-2.11-cpan-39bf76dae61 )