Source of Abersoft Forth
Description of the page content
Disassembled code of ZX Spectrum's Abersoft Forth, with some notes.
This is the result of the Abersoft Forth Disassembled project. The file can be downloaded from that page.
; ZX Spectrum Abersoft Forth
; Disassembled by Marcos Cruz (programandala.net), 2015
; http://programandala.net/en.program.abersoft_forth.html
; Original program by John Jones-Steel, 1983
; http://www.worldofspectrum.org/infoseekid.cgi?id=0008178
org 0x5E00
data_stack_bottom: equ 0xCB40
first_buffer: equ 0xCBE0
precedence_bit_mask: equ 0x40
ram_disc_bottom: equ 0xD000
ram_disc_top: equ 0xFBFF
rom_beeper: equ 0x03B5
rom_border_2297: equ 0x2297
rom_break_key: equ 0x1F54
rom_chan_open: equ 0x1601
rom_cls: equ 0x0D6B
rom_find_int1: equ 0x1E94
rom_key_decode: equ 0x0333
rom_key_scan: equ 0x028E
rom_key_test: equ 0x031E
rom_plot_22df: equ 0x22DF
rom_point_sub_22ce: equ 0x22CE
rom_s_attr_s_2583: equ 0x2583
rom_s_scrn_s_2538: equ 0x2538
rom_sa_all: equ 0x075A
rom_stack_fetch: equ 0x2BF1
smudge_bit_mask: equ 0x20
sys_attr_p: equ 0x5C8D
sys_coordx: equ 0x5C7D
sys_coordy: equ 0x5C7E
sys_flags2: equ 0x5C6A
sys_last_k: equ 0x5C08
sys_mask_p: equ 0x5C8E
sys_mode: equ 0x5C41
sys_nmiadd: equ 0x5CB0
sys_p_flag: equ 0x5C91
sys_scr_ct: equ 0x5C8C
sys_t_addr: equ 0x5C74
sys_udg: equ 0x5C7B
; ----------------------------------------------------------------
; User variables
user_variables_origin:
; Unused
defw 0x0000
defw 0x0000
defw 0x0000
s0_value:
defw 0x0000
r0_value:
defw 0x0000
tib_value:
defw 0x0000
width_value:
defw 0x0000
warning_value:
defw 0x0000
fence_value:
defw 0x0000
dp_value:
defw 0x0000
voc_link_value:
defw 0x0000
blk_value:
defw 0x0000
in_value:
defw 0x0000
out_value:
defw 0x0000
scr_value:
defw 0x0000
offset_value:
defw 0x0000
context_value:
defw 0x0000
current_value:
defw 0x0000
state_value:
defw 0x0000
base_value:
defw 0x0000
dpl_value:
defw 0x0000
fld_value:
defw 0x0000
csp_value:
defw 0x0000
r_hash_value:
defw 0x0000
hld_value:
defw 0x0000
; Unused
defw 0x0000
defw 0x0000
defw 0x0000
defw 0x0000
defw 0x0000
defw 0x0000
defw 0x0000
; ----------------------------------------------------------------
; Parameter area
origin:
; Entry points
cold_entry:
nop
jp cold_start
warm_entry:
nop
jp warm_start
fig_release:
defb 0x01
fig_revision:
defb 0x01
fig_user_version:
; XXX FIXME -- It should be 0x41 ("A").
defb 0x00
fig_implementation_attributes:
; Location: 0x0B +ORIGIN
defb 0x0E
; Bits: 76543210
; Bit names: ...WIEBA
; 0x0E = 00001110
; Legend:
; W: 0 = above sufficient
; 1 = other differences exist
; I: Interpreter:
; 0 = pre-incrementing
; 1 = post-incrementing
; E: Address must be even:
; 0 = yes
; 1 = no
; B: High byte @:
; 0 = low address
; 1 = high address
; A: CPU address:
; 0 = byte
; 1 = word
top_most_word_in_forth_voc:
defw udg_nfa
backspace_char:
defw 0x000C
init_user_pointer_value:
; XXX NOTE: The fig-Forth model uses this in `COLD`,
; but Abersoft Forth doesn't.
defw user_pointer_value
; ----------------------------------------------------------------
; User variables init values
init_s0_value:
defw data_stack_bottom
init_r0_value:
defw first_buffer
init_tib_value:
defw data_stack_bottom
init_width_value:
defw 0x001F
init_warning_value:
defw 0x0000
init_fence_value:
defw dictionary_pointer_after_cold
init_dp_value:
defw dictionary_pointer_after_cold
init_voc_link_value:
defw editor_vocabulary_link
cpu_name:
; CPU name stored as a 32-bit base 36 integer.
; XXX FIXME -- The number 0x0005B320 is "8080" in base 36,
; it should be 0x0000B250 ("Z80" in base 36).
defw 0x0005
defw 0xB320
user_pointer_value:
defw user_variables_origin
return_pointer_value:
defw 0xCBDE
; ----------------------------------------------------------------
; Interpreter
pushde:
push de
pushhl:
push hl
next:
ld a,(bc)
inc bc
ld l,a
ld a,(bc)
inc bc
ld h,a
next2:
ld e,(hl)
inc hl
ld d,(hl)
ex de,hl
jp (hl)
; ----------------------------------------------------------------
; Dictionary
lit_nfa:
defb 0x03+0x80,"LI","T"+0x80
lit_lfa:
defw 0x0000
lit_cfa:
defw lit_pfa
lit_pfa:
ld a,(bc)
inc bc
ld l,a
ld a,(bc)
inc bc
ld h,a
jp pushhl
execute_nfa:
defb 0x07+0x80,"EXECUT","E"+0x80
execute_lfa:
defw lit_nfa
execute_cfa:
defw execute_pfa
execute_pfa:
pop hl
jp next2
branch_nfa:
defb 0x06+0x80,"BRANC","H"+0x80
branch_lfa:
defw execute_nfa
branch_cfa:
defw branch_pfa
branch_pfa:
ld h,b
ld l,c
ld e,(hl)
inc hl
ld d,(hl)
dec hl
add hl,de
ld c,l
ld b,h
jp next
zero_branch_nfa:
defb 0x07+0x80,"0BRANC","H"+0x80
zero_branch_lfa:
defw branch_nfa
zero_branch_cfa:
defw zero_branch_pfa
zero_branch_pfa:
pop hl
ld a,l
or h
jr z,branch_pfa
inc bc
inc bc
jp next
paren_loop_nfa:
defb 0x06+0x80,"(LOOP",")"+0x80
paren_loop_lfa:
defw zero_branch_nfa
paren_loop_cfa:
defw paren_loop_pfa
paren_loop_pfa:
ld de,0x0001
l5ed3h:
ld hl,(return_pointer_value)
ld a,(hl)
add a,e
ld (hl),a
ld e,a
inc hl
ld a,(hl)
adc a,d
ld (hl),a
inc hl
inc d
dec d
ld d,a
jp m,l5eedh
ld a,e
sub (hl)
ld a,d
inc hl
sbc a,(hl)
jp l5ef2h
l5eedh:
ld a,(hl)
sub e
inc hl
ld a,(hl)
sbc a,d
l5ef2h:
jp m,branch_pfa
inc hl
ld (return_pointer_value),hl
inc bc
inc bc
jp next
paren_plus_loop_nfa:
defb 0x07+0x80,"(+LOOP",")"+0x80
paren_plus_loop_lfa:
defw paren_loop_nfa
paren_plus_loop_cfa:
defw paren_plus_loop_pfa
paren_plus_loop_pfa:
pop de
jr l5ed3h
paren_do_nfa:
defb 0x04+0x80,"(DO",")"+0x80
paren_do_lfa:
defw paren_plus_loop_nfa
paren_do_cfa:
defw paren_do_pfa
paren_do_pfa:
ld hl,(return_pointer_value)
; XXX FIXME -- Optimize:
; `ld de,-4 / add hl,de` is faster than four `dec hl`,
; and the same size.
; But the code of CP/M fig-Forth 1.1g is a bit better.
dec hl
dec hl
dec hl
dec hl
ld (return_pointer_value),hl
pop de
ld (hl),e
inc hl
ld (hl),d
pop de
inc hl
ld (hl),e
inc hl
ld (hl),d
jp next
i_nfa:
defb 0x01+0x80,"I"+0x80
i_lfa:
defw paren_do_nfa
i_cfa:
defw i_pfa
i_pfa:
ld hl,(return_pointer_value)
ld e,(hl)
inc hl
ld d,(hl)
push de
jp next
digit_nfa:
defb 0x05+0x80,"DIGI","T"+0x80
digit_lfa:
defw i_nfa
digit_cfa:
defw digit_pfa
digit_pfa:
pop hl
pop de
ld a,e
sub 0x30
jp m,l5f65h
cp 0x0A
jp m,l5f5ah
sub 0x07
cp 0x0A
jp m,l5f65h
l5f5ah:
cp l
jp p,l5f65h
ld e,a
ld hl,0x0001
jp pushde
l5f65h:
ld l,h
jp pushhl
paren_find_nfa:
defb 0x06+0x80,"(FIND",")"+0x80
paren_find_lfa:
defw digit_nfa
paren_find_cfa:
defw paren_find_pfa
paren_find_pfa:
pop de
l5f75h:
pop hl
push hl
ld a,(de)
xor (hl)
and 0x3F
jr nz,l5f9ch
l5f7dh:
inc hl
inc de
ld a,(de)
xor (hl)
add a,a
jr nz,l5f9ah
jr nc,l5f7dh
ld hl,0x0005
add hl,de
ex (sp),hl
l5f8bh:
dec de
ld a,(de)
or a
jp p,l5f8bh
ld e,a
ld d,0x00
ld hl,0x0001
jp pushde
l5f9ah:
jr c,l5fa2h
l5f9ch:
inc de
ld a,(de)
or a
jp p,l5f9ch
l5fa2h:
inc de
ex de,hl
ld e,(hl)
inc hl
ld d,(hl)
ld a,d
or e
jr nz,l5f75h
pop hl
ld hl,0x0000
jp pushhl
enclose_nfa:
defb 0x07+0x80,"ENCLOS","E"+0x80
enclose_lfa:
defw paren_find_nfa
enclose_cfa:
defw enclose_pfa
enclose_pfa:
pop de
pop hl
push hl
ld a,e
ld d,a
ld e,0xFF
dec hl
l5fc6h:
inc hl
inc e
cp (hl)
jr z,l5fc6h
ld d,0x00
push de
ld d,a
ld a,(hl)
and a
jr nz,l5fdch
ld d,0x00
inc e
push de
dec e
push de
jp next
l5fdch:
ld a,d
inc hl
inc e
cp (hl)
jr z,l5fedh
ld a,(hl)
and a
jr nz,l5fdch
ld d,0x00
push de
push de
jp next
l5fedh:
ld d,0x00
push de
inc e
push de
jp next
emit_nfa:
defb 0x04+0x80,"EMI","T"+0x80
emit_lfa:
defw enclose_nfa
emit_cfa:
defw do_colon
emit_pfa:
defw paren_emit_cfa
defw one_cfa
defw out_cfa
defw plus_store_cfa
defw semicolon_s_cfa
key_nfa:
defb 0x03+0x80,"KE","Y"+0x80
key_lfa:
defw emit_nfa
key_cfa:
defw key_pfa
key_pfa:
jp key_routine
question_terminal_nfa:
defb 0x09+0x80,"?TERMINA","L"+0x80
question_terminal_lfa:
defw key_nfa
question_terminal_cfa:
defw question_terminal_pfa
question_terminal_pfa:
ld hl,0x0000 ; XXX FIXME -- This command is unnecessary.
jp question_terminal_routine
cr_nfa:
defb 0x02+0x80,"C","R"+0x80
cr_lfa:
defw question_terminal_nfa
cr_cfa:
defw cr_pfa
cr_pfa:
jp cr_routine
cmove_nfa:
defb 0x05+0x80,"CMOV","E"+0x80
cmove_lfa:
defw cr_nfa
cmove_cfa:
defw cmove_pfa
cmove_pfa:
ld l,c
ld h,b
pop bc
pop de
ex (sp),hl
ld a,b
or c
jr z,l6046h
ldir
l6046h:
pop bc
jp next
u_star_nfa:
defb 0x02+0x80,"U","*"+0x80
u_star_lfa:
defw cmove_nfa
u_star_cfa:
defw u_star_pfa
u_star_pfa:
pop de
pop hl
push bc
ld b,h
ld a,l
call sub_606dh
push hl
ld h,a
ld a,b
ld b,h
call sub_606dh
pop de
ld c,d
add hl,bc
adc a,0x00
ld d,l
ld l,h
ld h,a
pop bc
; XXX FIXME -- Optimize: `jp pushde` instead of `push de` and `jp pushhl`:
push de
jp pushhl
sub_606dh:
ld hl,0x0000
ld c,0x08
l6072h:
add hl,hl
rla
jr nc,l6079h
add hl,de
adc a,0x00
l6079h:
dec c
jr nz,l6072h
ret
u_slash_mod_nfa:
defb 0x05+0x80,"U/MO","D"+0x80
u_slash_mod_lfa:
defw u_star_nfa
u_slash_mod_cfa:
defw u_slash_mod_pfa
u_slash_mod_pfa:
ld hl,0x0004
add hl,sp
ld e,(hl)
ld (hl),c
inc hl
ld d,(hl)
ld (hl),b
pop bc
pop hl
ld a,l
sub c
ld a,h
sbc a,b
jr c,l60a0h
ld hl,0xFFFF
ld de,0xFFFF
jr l60c0h
l60a0h:
ld a,0x10
l60a2h:
add hl,hl
rla
ex de,hl
add hl,hl
jr nc,l60aah
inc de
and a
l60aah:
ex de,hl
rra
push af
jr nc,l60b4h
and l
sbc hl,bc
jr l60bbh
l60b4h:
and a
sbc hl,bc
jr nc,l60bbh
add hl,bc
dec de
l60bbh:
inc de
pop af
dec a
jr nz,l60a2h
l60c0h:
pop bc
push hl
push de
jp next
and_nfa:
defb 0x03+0x80,"AN","D"+0x80
and_lfa:
defw u_slash_mod_nfa
and_cfa:
defw and_pfa
and_pfa:
pop de
pop hl
ld a,e
and l
ld l,a
ld a,d
and h
ld h,a
jp pushhl
or_nfa:
defb 0x02+0x80,"O","R"+0x80
or_lfa:
defw and_nfa
or_cfa:
defw or_pfa
or_pfa:
pop de
pop hl
ld a,e
or l
ld l,a
ld a,d
or h
ld h,a
jp pushhl
xor_nfa:
defb 0x03+0x80,"XO","R"+0x80
xor_lfa:
defw or_nfa
xor_cfa:
defw xor_pfa
xor_pfa:
pop de
pop hl
ld a,e
xor l
ld l,a
ld a,d
xor h
ld h,a
jp pushhl
sp_fetch_nfa:
defb 0x03+0x80,"SP","@"+0x80
sp_fetch_lfa:
defw xor_nfa
sp_fetch_cfa:
defw sp_fetch_pfa
sp_fetch_pfa:
ld hl,0x0000
add hl,sp
jp pushhl
sp_store_nfa:
defb 0x03+0x80,"SP","!"+0x80
sp_store_lfa:
defw sp_fetch_nfa
sp_store_cfa:
defw sp_store_pfa
sp_store_pfa:
; XXX FIXME -- Optimize: no need to use the DE register:
ld e,(ix+0x06)
ld d,(ix+0x07)
ex de,hl
ld sp,hl
jp next
rp_fetch_nfa:
defb 0x03+0x80,"RP","@"+0x80
rp_fetch_lfa:
defw sp_store_nfa
rp_fetch_cfa:
defw rp_fetch_pfa
rp_fetch_pfa:
ld hl,(return_pointer_value)
jp pushhl
rp_store_nfa:
defb 0x03+0x80,"RP","!"+0x80
rp_store_lfa:
defw rp_fetch_nfa
rp_store_cfa:
defw rp_store_pfa
rp_store_pfa:
; XXX FIXME -- Optimize: no need to use the DE register:
ld e,(ix+0x08)
ld d,(ix+0x09)
ex de,hl
ld (return_pointer_value),hl
jp next
semicolon_s_nfa:
defb 0x02+0x80,";","S"+0x80
semicolon_s_lfa:
defw rp_store_nfa
semicolon_s_cfa:
defw semicolon_s_pfa
semicolon_s_pfa:
ld hl,(return_pointer_value)
ld c,(hl)
inc hl
ld b,(hl)
inc hl
ld (return_pointer_value),hl
jp next
leave_nfa:
defb 0x05+0x80,"LEAV","E"+0x80
leave_lfa:
defw semicolon_s_nfa
leave_cfa:
defw leave_pfa
leave_pfa:
ld hl,(return_pointer_value)
ld e,(hl)
inc hl
ld d,(hl)
inc hl
ld (hl),e
inc hl
ld (hl),d
jp next
to_r_nfa:
defb 0x02+0x80,">","R"+0x80
to_r_lfa:
defw leave_nfa
to_r_cfa:
defw to_r_pfa
to_r_pfa:
pop de
ld hl,(return_pointer_value)
dec hl
ld (hl),d
dec hl
ld (hl),e
ld (return_pointer_value),hl
jp next
from_r_nfa:
defb 0x02+0x80,"R",">"+0x80
from_r_lfa:
defw to_r_nfa
from_r_cfa:
defw from_r_pfa
from_r_pfa:
ld hl,(return_pointer_value)
ld e,(hl)
inc hl
ld d,(hl)
inc hl
ld (return_pointer_value),hl
push de
jp next
r_nfa:
defb 0x01+0x80,"R"+0x80
r_lfa:
defw from_r_nfa
r_cfa:
defw i_pfa
zero_equals_nfa:
defb 0x02+0x80,"0","="+0x80
zero_equals_lfa:
defw r_nfa
zero_equals_cfa:
defw zero_equals_pfa
zero_equals_pfa:
pop hl
ld a,l
or h
ld hl,0x0000
jr nz,l61aeh
inc hl
l61aeh:
jp pushhl
zero_less_than_nfa:
defb 0x02+0x80,"0","<"+0x80
zero_less_than_lfa:
defw zero_equals_nfa
zero_less_than_cfa:
defw zero_less_than_pfa
zero_less_than_pfa:
pop hl
add hl,hl
ld hl,0x0000
jr nc,l61c0h
inc hl
l61c0h:
jp pushhl
plus_nfa:
defb 0x01+0x80,"+"+0x80
plus_lfa:
defw zero_less_than_nfa
plus_cfa:
defw plus_pfa
plus_pfa:
pop de
pop hl
add hl,de
jp pushhl
d_plus_nfa:
defb 0x02+0x80,"D","+"+0x80
d_plus_lfa:
defw plus_nfa
d_plus_cfa:
defw d_plus_pfa
d_plus_pfa:
ld hl,0x0006
add hl,sp
ld e,(hl)
ld (hl),c
inc hl
ld d,(hl)
ld (hl),b
pop bc
pop hl
add hl,de
ex de,hl
pop hl
adc hl,bc
pop bc
; XXX FIXME -- Optimize: `jp pushde` instead of `push de` and `jp pushhl`:
push de
jp pushhl
minus_nfa:
defb 0x05+0x80,"MINU","S"+0x80
minus_lfa:
defw d_plus_nfa
minus_cfa:
defw minus_pfa
minus_pfa:
pop de
ld hl,0x0000
and a
sbc hl,de
jp pushhl
dminus_nfa:
defb 0x06+0x80,"DMINU","S"+0x80
dminus_lfa:
defw minus_nfa
dminus_cfa:
defw dminus_pfa
dminus_pfa:
pop hl
pop de
sub a
sub e
ld e,a
ld a,0x00
sbc a,d
ld d,a
ld a,0x00
sbc a,l
ld l,a
ld a,0x00
sbc a,h
ld h,a
; XXX FIXME -- Optimize: `jp pushde` instead of `push de` and `jp pushhl`:
push de
jp pushhl
over_nfa:
defb 0x04+0x80,"OVE","R"+0x80
over_lfa:
defw dminus_nfa
over_cfa:
defw over_pfa
over_pfa:
pop de
pop hl
push hl
jp pushde
drop_nfa:
defb 0x04+0x80,"DRO","P"+0x80
drop_lfa:
defw over_nfa
drop_cfa:
defw drop_pfa
drop_pfa:
pop hl
jp next
swap_nfa:
defb 0x04+0x80,"SWA","P"+0x80
swap_lfa:
defw drop_nfa
swap_cfa:
defw swap_pfa
swap_pfa:
pop hl
ex (sp),hl
jp pushhl
dup_nfa:
defb 0x03+0x80,"DU","P"+0x80
dup_lfa:
defw swap_nfa
dup_cfa:
defw dup_pfa
dup_pfa:
pop hl
push hl
jp pushhl
two_dup_nfa:
defb 0x04+0x80,"2DU","P"+0x80
two_dup_lfa:
defw dup_nfa
two_dup_cfa:
defw two_dup_pfa
two_dup_pfa:
pop hl
pop de
push de
push hl
jp pushde
plus_store_nfa:
defb 0x02+0x80,"+","!"+0x80
plus_store_lfa:
defw two_dup_nfa
plus_store_cfa:
defw plus_store_pfa
plus_store_pfa:
pop hl
pop de
ld a,(hl)
add a,e
ld (hl),a
inc hl
ld a,(hl)
adc a,d
ld (hl),a
jp next
toggle_nfa:
defb 0x06+0x80,"TOGGL","E"+0x80
toggle_lfa:
defw plus_store_nfa
toggle_cfa:
defw toggle_pfa
toggle_pfa:
pop de
pop hl
ld a,(hl)
xor e
ld (hl),a
jp next
fetch_nfa:
defb 0x01+0x80,"@"+0x80
fetch_lfa:
defw toggle_nfa
fetch_cfa:
defw fetch_pfa
fetch_pfa:
pop hl
ld e,(hl)
inc hl
ld d,(hl)
push de
jp next
c_fetch_nfa:
defb 0x02+0x80,"C","@"+0x80
c_fetch_lfa:
defw fetch_nfa
c_fetch_cfa:
defw c_fetch_pfa
c_fetch_pfa:
pop hl
ld l,(hl)
ld h,0x00
jp pushhl
two_fetch_nfa:
defb 0x02+0x80,"2","@"+0x80
two_fetch_lfa:
defw c_fetch_nfa
two_fetch_cfa:
defw two_fetch_pfa
two_fetch_pfa:
pop hl
inc hl
inc hl
ld e,(hl)
inc hl
ld d,(hl)
push de
dec hl
dec hl
ld d,(hl)
dec hl
ld e,(hl)
push de
jp next
store_nfa:
defb 0x01+0x80,"!"+0x80
store_lfa:
defw two_fetch_nfa
store_cfa:
defw store_pfa
store_pfa:
pop hl
pop de
ld (hl),e
inc hl
ld (hl),d
jp next
c_store_nfa:
defb 0x02+0x80,"C","!"+0x80
c_store_lfa:
defw store_nfa
c_store_cfa:
defw c_store_pfa
c_store_pfa:
pop hl
pop de
ld (hl),e
jp next
two_store_nfa:
defb 0x02+0x80,"2","!"+0x80
two_store_lfa:
defw c_store_nfa
two_store_cfa:
defw two_store_pfa
two_store_pfa:
pop hl
pop de
ld (hl),e
inc hl
ld (hl),d
inc hl
pop de
ld (hl),e
inc hl
ld (hl),d
jp next
colon_nfa:
defb 0x01+0x80+precedence_bit_mask,":"+0x80
colon_lfa:
defw two_store_nfa
colon_cfa:
defw do_colon
colon_pfa:
defw question_exec_cfa
defw store_csp_cfa
defw current_cfa
defw fetch_cfa
defw context_cfa
defw store_cfa
defw create_cfa
defw right_bracket_cfa
defw paren_semicolon_code_cfa
do_colon:
ld hl,(return_pointer_value)
dec hl
ld (hl),b
dec hl
ld (hl),c
ld (return_pointer_value),hl
inc de
ld c,e
ld b,d
jp next
semicolon_nfa:
defb 0x01+0x80+precedence_bit_mask,";"+0x80
semicolon_lfa:
defw colon_nfa
semicolon_cfa:
defw do_colon
semicolon_pfa:
defw question_csp_cfa
defw compile_cfa
defw semicolon_s_cfa
defw smudge_cfa
defw left_bracket_cfa
defw semicolon_s_cfa
noop_nfa:
defb 0x04+0x80,"NOO","P"+0x80
noop_lfa:
defw semicolon_nfa
noop_cfa:
defw do_colon
noop_pfa:
defw semicolon_s_cfa
constant_nfa:
defb 0x08+0x80,"CONSTAN","T"+0x80
constant_lfa:
defw noop_nfa
constant_cfa:
defw do_colon
constant_pfa:
defw create_cfa
defw smudge_cfa
defw comma_cfa
defw paren_semicolon_code_cfa
do_constant:
inc de
ex de,hl
ld e,(hl)
inc hl
ld d,(hl)
push de
jp next
variable_nfa:
defb 0x08+0x80,"VARIABL","E"+0x80
variable_lfa:
defw constant_nfa
variable_cfa:
defw do_colon
variable_pfa:
defw constant_cfa
defw paren_semicolon_code_cfa
do_variable:
inc de
push de
jp next
user_nfa:
defb 0x04+0x80,"USE","R"+0x80
user_lfa:
defw variable_nfa
user_cfa:
defw do_colon
user_pfa:
defw constant_cfa
defw paren_semicolon_code_cfa
do_user:
inc de
ex de,hl
ld e,(hl)
ld d,0x00
push ix
pop hl
add hl,de
jp pushhl
zero_nfa:
defb 0x01+0x80,"0"+0x80
zero_lfa:
defw user_nfa
zero_cfa:
defw do_constant
zero_pfa:
defw 0x0000
one_nfa:
defb 0x01+0x80,"1"+0x80
one_lfa:
defw zero_nfa
one_cfa:
defw do_constant
one_pfa:
defw 0x0001
two_nfa:
defb 0x01+0x80,"2"+0x80
two_lfa:
defw one_nfa
two_cfa:
defw do_constant
two_pfa:
defw 0x0002
three_nfa:
defb 0x01+0x80,"3"+0x80
three_lfa:
defw two_nfa
three_cfa:
defw do_constant
three_pfa:
defw 0x0003
b_l_nfa:
defb 0x02+0x80,"B","L"+0x80
b_l_lfa:
defw three_nfa
b_l_cfa:
defw do_constant
b_l_pfa:
defw 0x0020
c_slash_l_nfa:
defb 0x03+0x80,"C/","L"+0x80
c_slash_l_lfa:
defw b_l_nfa
c_slash_l_cfa:
defw do_constant
c_slash_l_pfa:
defw 0x0040
first_nfa:
defb 0x05+0x80,"FIRS","T"+0x80
first_lfa:
defw c_slash_l_nfa
first_cfa:
defw do_constant
first_pfa:
defw first_buffer
limit_nfa:
defb 0x05+0x80,"LIMI","T"+0x80
limit_lfa:
defw first_nfa
limit_cfa:
defw do_constant
limit_pfa:
defw ram_disc_bottom
b_slash_buf_nfa:
defb 0x05+0x80,"B/BU","F"+0x80
b_slash_buf_lfa:
defw limit_nfa
b_slash_buf_cfa:
defw do_constant
b_slash_buf_pfa:
defw 0x0080
b_slash_scr_nfa:
defb 0x05+0x80,"B/SC","R"+0x80
b_slash_scr_lfa:
defw b_slash_buf_nfa
b_slash_scr_cfa:
defw do_constant
b_slash_scr_pfa:
defw 0x0008
plus_origin_nfa:
defb 0x07+0x80,"+ORIGI","N"+0x80
plus_origin_lfa:
defw b_slash_scr_nfa
plus_origin_cfa:
defw do_colon
plus_origin_pfa:
defw lit_cfa,origin
defw plus_cfa
defw semicolon_s_cfa
s0_nfa:
defb 0x02+0x80,"S","0"+0x80
s0_lfa:
defw plus_origin_nfa
s0_cfa:
defw do_user
s0_pfa:
defb 0x06
nop ; XXX FIXME -- Unnecessary.
r0_nfa:
defb 0x02+0x80,"R","0"+0x80
r0_lfa:
defw s0_nfa
r0_cfa:
defw do_user
r0_pfa:
defb 0x08
nop ; XXX FIXME -- Unnecessary.
tib_nfa:
defb 0x03+0x80,"TI","B"+0x80
tib_lfa:
defw r0_nfa
tib_cfa:
defw do_user
tib_pfa:
defb 0x0A
width_nfa:
defb 0x05+0x80,"WIDT","H"+0x80
width_lfa:
defw tib_nfa
width_cfa:
defw do_user
width_pfa:
defb 0x0C
warning_nfa:
defb 0x07+0x80,"WARNIN","G"+0x80
warning_lfa:
defw width_nfa
warning_cfa:
defw do_user
warning_pfa:
defb 0x0E
fence_nfa:
defb 0x05+0x80,"FENC","E"+0x80
fence_lfa:
defw warning_nfa
fence_cfa:
defw do_user
fence_pfa:
defb 0x10
dp_nfa:
defb 0x02+0x80,"D","P"+0x80
dp_lfa:
defw fence_nfa
dp_cfa:
defw do_user
dp_pfa:
defb 0x12
voc_link_nfa:
defb 0x08+0x80,"VOC-LIN","K"+0x80
voc_link_lfa:
defw dp_nfa
voc_link_cfa:
defw do_user
voc_link_pfa:
defb 0x14
blk_nfa:
defb 0x03+0x80,"BL","K"+0x80
blk_lfa:
defw voc_link_nfa
blk_cfa:
defw do_user
blk_pfa:
defb 0x16
in_nfa:
defb 0x02+0x80,"I","N"+0x80
in_lfa:
defw blk_nfa
in_cfa:
defw do_user
in_pfa:
defb 0x18
out_nfa:
defb 0x03+0x80,"OU","T"+0x80
out_lfa:
defw in_nfa
out_cfa:
defw do_user
out_pfa:
defb 0x1A
scr_nfa:
defb 0x03+0x80,"SC","R"+0x80
scr_lfa:
defw out_nfa
scr_cfa:
defw do_user
scr_pfa:
defb 0x1C
offset_nfa:
defb 0x06+0x80,"OFFSE","T"+0x80
offset_lfa:
defw scr_nfa
offset_cfa:
defw do_user
offset_pfa:
defb 0x1E
context_nfa:
defb 0x07+0x80,"CONTEX","T"+0x80
context_lfa:
defw offset_nfa
context_cfa:
defw do_user
context_pfa:
defb 0x20
current_nfa:
defb 0x07+0x80,"CURREN","T"+0x80
current_lfa:
defw context_nfa
current_cfa:
defw do_user
current_pfa:
defb 0x22
state_nfa:
defb 0x05+0x80,"STAT","E"+0x80
state_lfa:
defw current_nfa
state_cfa:
defw do_user
state_pfa:
defb 0x24
base_nfa:
defb 0x04+0x80,"BAS","E"+0x80
base_lfa:
defw state_nfa
base_cfa:
defw do_user
base_pfa:
defb 0x26
dpl_nfa:
defb 0x03+0x80,"DP","L"+0x80
dpl_lfa:
defw base_nfa
dpl_cfa:
defw do_user
dpl_pfa:
defb 0x28
fld_nfa:
defb 0x03+0x80,"FL","D"+0x80
fld_lfa:
defw dpl_nfa
fld_cfa:
defw do_user
fld_pfa:
defb 0x2A
csp_nfa:
defb 0x03+0x80,"CS","P"+0x80
csp_lfa:
defw fld_nfa
csp_cfa:
defw do_user
csp_pfa:
defb 0x2C
r_hash_nfa:
defb 0x02+0x80,"R","#"+0x80
r_hash_lfa:
defw csp_nfa
r_hash_cfa:
defw do_user
r_hash_pfa:
defb 0x2E
hld_nfa:
defb 0x03+0x80,"HL","D"+0x80
hld_lfa:
defw r_hash_nfa
hld_cfa:
defw do_user
hld_pfa:
defb 0x30
one_plus_nfa:
defb 0x02+0x80,"1","+"+0x80
one_plus_lfa:
defw hld_nfa
one_plus_cfa:
defw do_colon
one_plus_pfa:
defw one_cfa
defw plus_cfa
defw semicolon_s_cfa
two_plus_nfa:
defb 0x02+0x80,"2","+"+0x80
two_plus_lfa:
defw one_plus_nfa
two_plus_cfa:
defw do_colon
two_plus_pfa:
defw two_cfa
defw plus_cfa
defw semicolon_s_cfa
here_nfa:
defb 0x04+0x80,"HER","E"+0x80
here_lfa:
defw two_plus_nfa
here_cfa:
defw do_colon
here_pfa:
defw dp_cfa
defw fetch_cfa
defw semicolon_s_cfa
allot_nfa:
defb 0x05+0x80,"ALLO","T"+0x80
allot_lfa:
defw here_nfa
allot_cfa:
defw do_colon
allot_pfa:
defw dp_cfa
defw plus_store_cfa
defw semicolon_s_cfa
comma_nfa:
defb 0x01+0x80,","+0x80
comma_lfa:
defw allot_nfa
comma_cfa:
defw do_colon
comma_pfa:
defw here_cfa
defw store_cfa
defw two_cfa
defw allot_cfa
defw semicolon_s_cfa
c_comma_nfa:
defb 0x02+0x80,"C",","+0x80
c_comma_lfa:
defw comma_nfa
c_comma_cfa:
defw do_colon
c_comma_pfa:
defw here_cfa
defw c_store_cfa
defw one_cfa
defw allot_cfa
defw semicolon_s_cfa
minus_sign_nfa:
defb 0x01+0x80,"-"+0x80
minus_sign_lfa:
defw c_comma_nfa
minus_sign_cfa:
defw minus_sign_pfa
minus_sign_pfa:
pop de
pop hl
and a
sbc hl,de
jp pushhl
equals_nfa:
defb 0x01+0x80,"="+0x80
equals_lfa:
defw minus_sign_nfa
equals_cfa:
defw do_colon
equals_pfa:
defw minus_sign_cfa
defw zero_equals_cfa
defw semicolon_s_cfa
less_than_nfa:
defb 0x01+0x80,"<"+0x80
less_than_lfa:
defw equals_nfa
less_than_cfa:
defw less_than_pfa
less_than_pfa:
pop de
pop hl
ld a,d
xor h
jp m,l6559h
and a
sbc hl,de
l6559h:
inc h
dec h
jp m,l6564h
ld hl,0x0000
jp pushhl
l6564h:
ld hl,0x0001
jp pushhl
u_less_than_nfa:
defb 0x02+0x80,"U","<"+0x80
u_less_than_lfa:
defw less_than_nfa
u_less_than_cfa:
defw do_colon
u_less_than_pfa:
defw two_dup_cfa
defw xor_cfa
defw zero_less_than_cfa
defw zero_branch_cfa,0x000C ; to branch_destination_0x6585
defw drop_cfa
defw zero_less_than_cfa
defw zero_equals_cfa
defw branch_cfa,0x0006 ; to branch_destination_0x6589
branch_destination_0x6585:
defw minus_sign_cfa
defw zero_less_than_cfa
branch_destination_0x6589:
defw semicolon_s_cfa
greater_than_nfa:
defb 0x01+0x80,">"+0x80
greater_than_lfa:
defw u_less_than_nfa
greater_than_cfa:
defw do_colon
greater_than_pfa:
defw swap_cfa
defw less_than_cfa
defw semicolon_s_cfa
rot_nfa:
defb 0x03+0x80,"RO","T"+0x80
rot_lfa:
defw greater_than_nfa
rot_cfa:
defw rot_pfa
rot_pfa:
pop de
pop hl
ex (sp),hl
jp pushde
space_nfa:
defb 0x05+0x80,"SPAC","E"+0x80
space_lfa:
defw rot_nfa
space_cfa:
defw do_colon
space_pfa:
defw b_l_cfa
defw emit_cfa
defw semicolon_s_cfa
minus_dup_nfa:
defb 0x04+0x80,"-DU","P"+0x80
minus_dup_lfa:
defw space_nfa
minus_dup_cfa:
defw do_colon
minus_dup_pfa:
defw dup_cfa
defw zero_branch_cfa,0x0004 ; to branch_destination_0x65C6
defw dup_cfa
branch_destination_0x65C6:
defw semicolon_s_cfa
traverse_nfa:
defb 0x08+0x80,"TRAVERS","E"+0x80
traverse_lfa:
defw minus_dup_nfa
traverse_cfa:
defw do_colon
traverse_pfa:
defw swap_cfa
branch_destination_0x65D7:
defw over_cfa
defw plus_cfa
defw lit_cfa,0x007F
defw over_cfa
defw c_fetch_cfa
defw less_than_cfa
defw zero_branch_cfa,0xFFF0 ; to branch_destination_0x65D7
defw swap_cfa
defw drop_cfa
defw semicolon_s_cfa
latest_nfa:
defb 0x06+0x80,"LATES","T"+0x80
latest_lfa:
defw traverse_nfa
latest_cfa:
defw do_colon
latest_pfa:
defw current_cfa
defw fetch_cfa
defw fetch_cfa
defw semicolon_s_cfa
lfa_nfa:
defb 0x03+0x80,"LF","A"+0x80
lfa_lfa:
defw latest_nfa
lfa_cfa:
defw do_colon
lfa_pfa:
defw lit_cfa,0x0004
defw minus_sign_cfa
defw semicolon_s_cfa
cfa_nfa:
defb 0x03+0x80,"CF","A"+0x80
cfa_lfa:
defw lfa_nfa
cfa_cfa:
defw do_colon
cfa_pfa:
defw two_cfa
defw minus_sign_cfa
defw semicolon_s_cfa
nfa_nfa:
defb 0x03+0x80,"NF","A"+0x80
nfa_lfa:
defw cfa_nfa
nfa_cfa:
defw do_colon
nfa_pfa:
defw lit_cfa,0x0005
defw minus_sign_cfa
defw lit_cfa,0xFFFF
defw traverse_cfa
defw semicolon_s_cfa
pfa_nfa:
defb 0x03+0x80,"PF","A"+0x80
pfa_lfa:
defw nfa_nfa
pfa_cfa:
defw do_colon
pfa_pfa:
defw one_cfa
defw traverse_cfa
defw lit_cfa,0x0005
defw plus_cfa
defw semicolon_s_cfa
store_csp_nfa:
defb 0x04+0x80,"!CS","P"+0x80
store_csp_lfa:
defw pfa_nfa
store_csp_cfa:
defw do_colon
store_csp_pfa:
defw sp_fetch_cfa
defw csp_cfa
defw store_cfa
defw semicolon_s_cfa
question_error_nfa:
defb 0x06+0x80,"?ERRO","R"+0x80
question_error_lfa:
defw store_csp_nfa
question_error_cfa:
defw do_colon
question_error_pfa:
defw swap_cfa
defw zero_branch_cfa,0x0008 ; to branch_destination_0x6672
defw error_cfa
defw branch_cfa,0x0004 ; to branch_destination_0x6674
branch_destination_0x6672:
defw drop_cfa
branch_destination_0x6674:
defw semicolon_s_cfa
question_comp_nfa:
defb 0x05+0x80,"?COM","P"+0x80
question_comp_lfa:
defw question_error_nfa
question_comp_cfa:
defw do_colon
question_comp_pfa:
defw state_cfa
defw fetch_cfa
defw zero_equals_cfa
defw lit_cfa,0x0011
defw question_error_cfa
defw semicolon_s_cfa
question_exec_nfa:
defb 0x05+0x80,"?EXE","C"+0x80
question_exec_lfa:
defw question_comp_nfa
question_exec_cfa:
defw do_colon
question_exec_pfa:
defw state_cfa
defw fetch_cfa
defw lit_cfa,0x0012
defw question_error_cfa
defw semicolon_s_cfa
question_pairs_nfa:
defb 0x06+0x80,"?PAIR","S"+0x80
question_pairs_lfa:
defw question_exec_nfa
question_pairs_cfa:
defw do_colon
question_pairs_pfa:
defw minus_sign_cfa
defw lit_cfa,0x0013
defw question_error_cfa
defw semicolon_s_cfa
question_csp_nfa:
defb 0x04+0x80,"?CS","P"+0x80
question_csp_lfa:
defw question_pairs_nfa
question_csp_cfa:
defw do_colon
question_csp_pfa:
defw sp_fetch_cfa
defw csp_cfa
defw fetch_cfa
defw minus_sign_cfa
defw lit_cfa,0x0014
defw question_error_cfa
defw semicolon_s_cfa
question_loading_nfa:
defb 0x08+0x80,"?LOADIN","G"+0x80
question_loading_lfa:
defw question_csp_nfa
question_loading_cfa:
defw do_colon
question_loading_pfa:
defw blk_cfa
defw fetch_cfa
defw zero_equals_cfa
defw lit_cfa,0x0016
defw question_error_cfa
defw semicolon_s_cfa
compile_nfa:
defb 0x07+0x80,"COMPIL","E"+0x80
compile_lfa:
defw question_loading_nfa
compile_cfa:
defw do_colon
compile_pfa:
defw question_comp_cfa
defw from_r_cfa
defw dup_cfa
defw two_plus_cfa
defw to_r_cfa
defw fetch_cfa
defw comma_cfa
defw semicolon_s_cfa
left_bracket_nfa:
defb 0x01+0x80+precedence_bit_mask,"["+0x80
left_bracket_lfa:
defw compile_nfa
left_bracket_cfa:
defw do_colon
left_bracket_pfa:
defw zero_cfa
defw state_cfa
defw store_cfa
defw semicolon_s_cfa
right_bracket_nfa:
defb 0x01+0x80,"]"+0x80
right_bracket_lfa:
defw left_bracket_nfa
right_bracket_cfa:
defw do_colon
right_bracket_pfa:
defw lit_cfa,0x00C0
defw state_cfa
defw store_cfa
defw semicolon_s_cfa
smudge_nfa:
defb 0x06+0x80,"SMUDG","E"+0x80
smudge_lfa:
defw right_bracket_nfa
smudge_cfa:
defw do_colon
smudge_pfa:
defw latest_cfa
defw lit_cfa,smudge_bit_mask
defw toggle_cfa
defw semicolon_s_cfa
hex_nfa:
defb 0x03+0x80,"HE","X"+0x80
hex_lfa:
defw smudge_nfa
hex_cfa:
defw do_colon
hex_pfa:
defw lit_cfa,0x0010
defw base_cfa
defw store_cfa
defw semicolon_s_cfa
decimal_nfa:
defb 0x07+0x80,"DECIMA","L"+0x80
decimal_lfa:
defw hex_nfa
decimal_cfa:
defw do_colon
decimal_pfa:
defw lit_cfa,0x000A
defw base_cfa
defw store_cfa
defw semicolon_s_cfa
paren_semicolon_code_nfa:
defb 0x07+0x80,"(;CODE",")"+0x80
paren_semicolon_code_lfa:
defw decimal_nfa
paren_semicolon_code_cfa:
defw do_colon
paren_semicolon_code_pfa:
defw from_r_cfa
defw latest_cfa
defw pfa_cfa
defw cfa_cfa
defw store_cfa
defw semicolon_s_cfa
semicolon_code_nfa:
defb 0x05+0x80+precedence_bit_mask,";COD","E"+0x80
semicolon_code_lfa:
defw paren_semicolon_code_nfa
semicolon_code_cfa:
defw do_colon
semicolon_code_pfa:
defw question_csp_cfa
defw compile_cfa
defw paren_semicolon_code_cfa
defw left_bracket_cfa
defw smudge_cfa
defw semicolon_s_cfa
builds_nfa:
defb 0x07+0x80,"<BUILD","S"+0x80
builds_lfa:
defw semicolon_code_nfa
builds_cfa:
defw do_colon
builds_pfa:
defw zero_cfa
defw constant_cfa
defw semicolon_s_cfa
does_nfa:
defb 0x05+0x80,"DOES",">"+0x80
does_lfa:
defw builds_nfa
does_cfa:
defw do_colon
does_pfa:
defw from_r_cfa
defw latest_cfa
defw pfa_cfa
defw store_cfa
defw paren_semicolon_code_cfa
do_does:
ld hl,(return_pointer_value)
dec hl
ld (hl),b
dec hl
ld (hl),c
ld (return_pointer_value),hl
inc de
ex de,hl
ld c,(hl)
inc hl
ld b,(hl)
inc hl
jp pushhl
count_nfa:
defb 0x05+0x80,"COUN","T"+0x80
count_lfa:
defw does_nfa
count_cfa:
defw do_colon
count_pfa:
defw dup_cfa
defw one_plus_cfa
defw swap_cfa
defw c_fetch_cfa
defw semicolon_s_cfa
type_nfa:
defb 0x04+0x80,"TYP","E"+0x80
type_lfa:
defw count_nfa
type_cfa:
defw do_colon
type_pfa:
defw minus_dup_cfa
defw zero_branch_cfa,0x0018 ; to branch_destination_0x6804
defw over_cfa
defw plus_cfa
defw swap_cfa
defw paren_do_cfa
branch_destination_0x67F6:
defw i_cfa
defw c_fetch_cfa
defw emit_cfa
defw paren_loop_cfa,0xFFF8 ; to branch_destination_0x67F6
defw branch_cfa,0x0004 ; to branch_destination_0x6806
branch_destination_0x6804:
defw drop_cfa
branch_destination_0x6806:
defw semicolon_s_cfa
minus_trailing_nfa:
defb 0x09+0x80,"-TRAILIN","G"+0x80
minus_trailing_lfa:
defw type_nfa
minus_trailing_cfa:
defw do_colon
minus_trailing_pfa:
defw dup_cfa
defw zero_cfa
defw paren_do_cfa
branch_destination_0x681C:
; XXX FIXME -- Optimize: `2DUP` instead of `OVER OVER`:
defw over_cfa
defw over_cfa
defw plus_cfa
defw one_cfa
defw minus_sign_cfa
defw c_fetch_cfa
defw b_l_cfa
defw minus_sign_cfa
defw zero_branch_cfa,0x0008 ; to branch_destination_0x6836
defw leave_cfa
defw branch_cfa,0x0006 ; to branch_destination_0x683A
branch_destination_0x6836:
defw one_cfa
defw minus_sign_cfa
branch_destination_0x683A:
defw paren_loop_cfa,0xFFE0 ; to branch_destination_0x681C
defw semicolon_s_cfa
paren_dot_quote_nfa:
defb 0x04+0x80,'(."',")"+0x80
paren_dot_quote_lfa:
defw minus_trailing_nfa
paren_dot_quote_cfa:
defw do_colon
paren_dot_quote_pfa:
defw r_cfa
defw count_cfa
defw dup_cfa
defw one_plus_cfa
defw from_r_cfa
defw plus_cfa
defw to_r_cfa
defw type_cfa
defw semicolon_s_cfa
dot_quote_nfa:
defb 0x02+0x80+precedence_bit_mask,".",'"'+0x80
dot_quote_lfa:
defw paren_dot_quote_nfa
dot_quote_cfa:
defw do_colon
dot_quote_pfa:
defw lit_cfa,0x0022
defw state_cfa
defw fetch_cfa
defw zero_branch_cfa,0x0014 ; to branch_destination_0x6880
defw compile_cfa
defw paren_dot_quote_cfa
defw word_cfa
defw here_cfa
defw c_fetch_cfa
defw one_plus_cfa
defw allot_cfa
defw branch_cfa,0x000A ; to branch_destination_0x6888
branch_destination_0x6880:
defw word_cfa
defw here_cfa
defw count_cfa
defw type_cfa
branch_destination_0x6888:
defw semicolon_s_cfa
expect_nfa:
defb 0x06+0x80,"EXPEC","T"+0x80
expect_lfa:
defw dot_quote_nfa
expect_cfa:
defw do_colon
expect_pfa:
defw over_cfa
defw plus_cfa
defw over_cfa
defw paren_do_cfa
branch_destination_0x689D:
defw key_cfa
defw dup_cfa
defw lit_cfa,0x000E
defw plus_origin_cfa
defw fetch_cfa
defw equals_cfa
defw zero_branch_cfa,0x002A ; to branch_destination_0x68D7
defw drop_cfa
defw dup_cfa
defw i_cfa
defw equals_cfa
defw dup_cfa
defw from_r_cfa
defw two_cfa
defw minus_sign_cfa
defw plus_cfa
defw to_r_cfa
defw zero_branch_cfa,0x000A ; to branch_destination_0x68CF
; XXX FIXME -- These useless `noop` can be removed, they are a patch to overwrite a bell in the original fig-Forth implementation:
defw noop_cfa
defw noop_cfa
defw branch_cfa,0x0032 ; to branch_destination_0x68FF
branch_destination_0x68CF:
defw lit_cfa,0x0008
defw branch_cfa,0x0028 ; to branch_destination_0x68FD
branch_destination_0x68D7:
defw dup_cfa
defw lit_cfa,0x000D
defw equals_cfa
defw zero_branch_cfa,0x000E ; to branch_destination_0x68EF
defw leave_cfa
defw drop_cfa
defw b_l_cfa
defw zero_cfa
defw branch_cfa,0x0004 ; to branch_destination_0x68F1
branch_destination_0x68EF:
defw dup_cfa
branch_destination_0x68F1:
defw i_cfa
defw c_store_cfa
defw zero_cfa
defw i_cfa
defw one_plus_cfa
defw store_cfa
branch_destination_0x68FD:
defw emit_cfa
branch_destination_0x68FF:
defw paren_loop_cfa,0xFF9C ; to branch_destination_0x689D
defw drop_cfa
defw semicolon_s_cfa
query_nfa:
defb 0x05+0x80,"QUER","Y"+0x80
query_lfa:
defw expect_nfa
query_cfa:
defw do_colon
query_pfa:
defw tib_cfa
defw fetch_cfa
defw lit_cfa,0x0050
defw expect_cfa
defw zero_cfa
defw in_cfa
defw store_cfa
defw semicolon_s_cfa
null_nfa:
defb 0x01+0x80+precedence_bit_mask,0x80
null_lfa:
defw query_nfa
null_cfa:
defw do_colon
null_pfa:
defw blk_cfa
defw fetch_cfa
defw zero_branch_cfa,0x002A ; to branch_destination_0x6959
defw one_cfa
defw blk_cfa
defw plus_store_cfa
defw zero_cfa
defw in_cfa
defw store_cfa
defw blk_cfa
defw fetch_cfa
defw b_slash_scr_cfa
defw one_cfa
defw minus_sign_cfa
defw and_cfa
defw zero_equals_cfa
defw zero_branch_cfa,0x0008 ; to branch_destination_0x6955
defw question_exec_cfa
defw from_r_cfa
defw drop_cfa
branch_destination_0x6955:
defw branch_cfa,0x0006 ; to branch_destination_0x695D
branch_destination_0x6959:
defw from_r_cfa
defw drop_cfa
branch_destination_0x695D:
defw semicolon_s_cfa
fill_nfa:
defb 0x04+0x80,"FIL","L"+0x80
fill_lfa:
defw null_nfa
fill_cfa:
defw fill_pfa
fill_pfa:
ld l,c
ld h,b
pop de
pop bc
ex (sp),hl
ex de,hl
l696eh:
ld a,b
or c
jr z,l6978h
ld a,l
ld (de),a
inc de
dec bc
jr l696eh
l6978h:
pop bc
jp next
erase_nfa:
defb 0x05+0x80,"ERAS","E"+0x80
erase_lfa:
defw fill_nfa
erase_cfa:
defw do_colon
erase_pfa:
defw zero_cfa
defw fill_cfa
defw semicolon_s_cfa
blanks_nfa:
defb 0x06+0x80,"BLANK","S"+0x80
blanks_lfa:
defw erase_nfa
blanks_cfa:
defw do_colon
blanks_pfa:
defw b_l_cfa
defw fill_cfa
defw semicolon_s_cfa
hold_nfa:
defb 0x04+0x80,"HOL","D"+0x80
hold_lfa:
defw blanks_nfa
hold_cfa:
defw do_colon
hold_pfa:
defw lit_cfa,0xFFFF
defw hld_cfa
defw plus_store_cfa
defw hld_cfa
defw fetch_cfa
defw c_store_cfa
defw semicolon_s_cfa
pad_nfa:
defb 0x03+0x80,"PA","D"+0x80
pad_lfa:
defw hold_nfa
pad_cfa:
defw do_colon
pad_pfa:
defw here_cfa
defw lit_cfa,0x0044
defw plus_cfa
defw semicolon_s_cfa
word_nfa:
defb 0x04+0x80,"WOR","D"+0x80
word_lfa:
defw pad_nfa
word_cfa:
defw do_colon
word_pfa:
defw blk_cfa
defw fetch_cfa
defw zero_branch_cfa,0x000C ; to branch_destination_0x69E3
defw blk_cfa
defw fetch_cfa
defw block_cfa
defw branch_cfa,0x0006 ; to branch_destination_0x69E7
branch_destination_0x69E3:
defw tib_cfa
defw fetch_cfa
branch_destination_0x69E7:
defw in_cfa
defw fetch_cfa
defw plus_cfa
defw swap_cfa
defw enclose_cfa
defw here_cfa
defw lit_cfa,0x0022
defw blanks_cfa
defw in_cfa
defw plus_store_cfa
defw over_cfa
defw minus_sign_cfa
defw to_r_cfa
defw r_cfa
defw here_cfa
defw c_store_cfa
defw plus_cfa
defw here_cfa
defw one_plus_cfa
defw from_r_cfa
defw cmove_cfa
defw semicolon_s_cfa
paren_number_nfa:
defb 0x08+0x80,"(NUMBER",")"+0x80
paren_number_lfa:
defw word_nfa
paren_number_cfa:
defw do_colon
branch_destination_0x6A22:
paren_number_pfa:
defw one_plus_cfa
defw dup_cfa
defw to_r_cfa
defw c_fetch_cfa
defw base_cfa
defw fetch_cfa
defw digit_cfa
defw zero_branch_cfa,0x002C ; to branch_destination_0x6A5E
defw swap_cfa
defw base_cfa
defw fetch_cfa
defw u_star_cfa
defw drop_cfa
defw rot_cfa
defw base_cfa
defw fetch_cfa
defw u_star_cfa
defw d_plus_cfa
defw dpl_cfa
defw fetch_cfa
defw one_plus_cfa
defw zero_branch_cfa,0x0008 ; to branch_destination_0x6A58
defw one_cfa
defw dpl_cfa
defw plus_store_cfa
branch_destination_0x6A58:
defw from_r_cfa
defw branch_cfa,0xFFC6 ; to branch_destination_0x6A22
branch_destination_0x6A5E:
defw from_r_cfa
defw semicolon_s_cfa
number_nfa:
defb 0x06+0x80,"NUMBE","R"+0x80
number_lfa:
defw paren_number_nfa
number_cfa:
defw do_colon
number_pfa:
defw zero_cfa
defw zero_cfa
defw rot_cfa
defw dup_cfa
defw one_plus_cfa
defw c_fetch_cfa
defw lit_cfa,0x002D
defw equals_cfa
defw dup_cfa
defw to_r_cfa
defw plus_cfa
defw lit_cfa,0xFFFF
branch_destination_0x6A89:
defw dpl_cfa
defw store_cfa
defw paren_number_cfa
defw dup_cfa
defw c_fetch_cfa
defw b_l_cfa
defw minus_sign_cfa
defw zero_branch_cfa,0x0016 ; to branch_destination_0x6AAF
defw dup_cfa
defw c_fetch_cfa
defw lit_cfa,0x002E
defw minus_sign_cfa
defw zero_cfa
defw question_error_cfa
defw zero_cfa
defw branch_cfa,0xFFDC ; to branch_destination_0x6A89
branch_destination_0x6AAF:
defw drop_cfa
defw from_r_cfa
defw zero_branch_cfa,0x0004 ; to branch_destination_0x6AB9
defw dminus_cfa
branch_destination_0x6AB9:
defw semicolon_s_cfa
minus_find_nfa:
defb 0x05+0x80,"-FIN","D"+0x80
minus_find_lfa:
defw number_nfa
minus_find_cfa:
defw do_colon
minus_find_pfa:
defw b_l_cfa
defw word_cfa
defw here_cfa
defw context_cfa
defw fetch_cfa
defw fetch_cfa
defw paren_find_cfa
defw dup_cfa
defw zero_equals_cfa
defw zero_branch_cfa,0x000A ; to branch_destination_0x6AE3
defw drop_cfa
defw here_cfa
defw latest_cfa
defw paren_find_cfa
branch_destination_0x6AE3:
defw semicolon_s_cfa
paren_abort_nfa:
defb 0x07+0x80,"(ABORT",")"+0x80
paren_abort_lfa:
defw minus_find_nfa
paren_abort_cfa:
defw do_colon
paren_abort_pfa:
defw abort_cfa
defw semicolon_s_cfa
error_nfa:
defb 0x05+0x80,"ERRO","R"+0x80
error_lfa:
defw paren_abort_nfa
error_cfa:
defw do_colon
error_pfa:
defw warning_cfa
defw fetch_cfa
defw zero_less_than_cfa
defw zero_branch_cfa,0x0004 ; to branch_destination_0x6B0B
defw paren_abort_cfa
branch_destination_0x6B0B:
defw here_cfa
defw count_cfa
defw type_cfa
defw paren_dot_quote_cfa
defb 0x02,"? "
defw message_cfa
defw sp_store_cfa
defw blk_cfa
defw fetch_cfa
defw minus_dup_cfa
defw zero_branch_cfa,0x0008 ; to branch_destination_0x6B2A
defw in_cfa
defw fetch_cfa
defw swap_cfa
branch_destination_0x6B2A:
defw quit_cfa
id_dot_nfa:
defb 0x03+0x80,"ID","."+0x80
id_dot_lfa:
defw error_nfa
id_dot_cfa:
defw do_colon
id_dot_pfa:
defw pad_cfa
defw lit_cfa,0x0020
defw lit_cfa,0x005F
defw fill_cfa
defw dup_cfa
defw pfa_cfa
defw lfa_cfa
defw over_cfa
defw minus_sign_cfa
defw pad_cfa
defw swap_cfa
defw cmove_cfa
defw pad_cfa
defw count_cfa
defw lit_cfa,0x001F
defw and_cfa
defw two_dup_cfa
defw plus_cfa
defw one_cfa
defw minus_sign_cfa
defw dup_cfa
defw fetch_cfa
defw lit_cfa,0xFF7F
defw and_cfa
defw swap_cfa
defw store_cfa
defw type_cfa
defw space_cfa
defw semicolon_s_cfa
create_nfa:
defb 0x06+0x80,"CREAT","E"+0x80
create_lfa:
defw id_dot_nfa
create_cfa:
defw do_colon
create_pfa:
defw minus_find_cfa
defw zero_branch_cfa,0x0010 ; to branch_destination_0x6B95
defw drop_cfa
defw nfa_cfa
defw id_dot_cfa
defw lit_cfa,0x0004
defw message_cfa
defw space_cfa
branch_destination_0x6B95:
defw here_cfa
defw dup_cfa
defw c_fetch_cfa
defw width_cfa
defw fetch_cfa
defw min_cfa
defw one_plus_cfa
defw allot_cfa
defw dup_cfa
defw lit_cfa,0x00A0
defw toggle_cfa
defw here_cfa
defw one_cfa
defw minus_sign_cfa
defw lit_cfa,0x0080
defw toggle_cfa
defw latest_cfa
defw comma_cfa
defw current_cfa
defw fetch_cfa
defw store_cfa
defw here_cfa
defw two_plus_cfa
defw comma_cfa
defw semicolon_s_cfa
bracket_compile_nfa:
defb 0x09+0x80+precedence_bit_mask,"[COMPILE","]"+0x80
bracket_compile_lfa:
defw create_nfa
bracket_compile_cfa:
defw do_colon
bracket_compile_pfa:
defw minus_find_cfa
defw zero_equals_cfa
defw zero_cfa
defw question_error_cfa
defw drop_cfa
defw cfa_cfa
defw comma_cfa
defw semicolon_s_cfa
literal_nfa:
defb 0x07+0x80+precedence_bit_mask,"LITERA","L"+0x80
literal_lfa:
defw bracket_compile_nfa
literal_cfa:
defw do_colon
literal_pfa:
defw state_cfa
defw fetch_cfa
defw zero_branch_cfa,0x0008 ; to branch_destination_0x6C03
defw compile_cfa
defw lit_cfa
defw comma_cfa
branch_destination_0x6C03:
defw semicolon_s_cfa
dliteral_nfa:
defb 0x08+0x80+precedence_bit_mask,"DLITERA","L"+0x80
dliteral_lfa:
defw literal_nfa
dliteral_cfa:
defw do_colon
dliteral_pfa:
defw state_cfa
defw fetch_cfa
defw zero_branch_cfa,0x0008 ; to branch_destination_0x6C20
defw swap_cfa
defw literal_cfa
defw literal_cfa
branch_destination_0x6C20:
defw semicolon_s_cfa
question_stack_nfa:
defb 0x06+0x80,"?STAC","K"+0x80
question_stack_lfa:
defw dliteral_nfa
question_stack_cfa:
defw do_colon
question_stack_pfa:
defw sp_fetch_cfa
defw s0_cfa
defw fetch_cfa
defw swap_cfa
defw u_less_than_cfa
defw one_cfa
defw question_error_cfa
defw sp_fetch_cfa
defw here_cfa
defw lit_cfa,0x0080
defw plus_cfa
defw u_less_than_cfa
defw lit_cfa,0x0007
defw question_error_cfa
defw semicolon_s_cfa
interpret_nfa:
defb 0x09+0x80,"INTERPRE","T"+0x80
interpret_lfa:
defw question_stack_nfa
interpret_cfa:
defw do_colon
branch_destination_0x6C5D:
interpret_pfa:
defw minus_find_cfa
defw zero_branch_cfa,0x001E ; to branch_destination_0x6C7F
defw state_cfa
defw fetch_cfa
defw less_than_cfa
defw zero_branch_cfa,0x000A ; to branch_destination_0x6C75
defw cfa_cfa
defw comma_cfa
defw branch_cfa,0x0006 ; to branch_destination_0x6C79
branch_destination_0x6C75:
defw cfa_cfa
defw execute_cfa
branch_destination_0x6C79:
defw question_stack_cfa
defw branch_cfa,0x001C ; to branch_destination_0x6C99
branch_destination_0x6C7F:
defw here_cfa
defw number_cfa
defw dpl_cfa
defw fetch_cfa
defw one_plus_cfa
defw zero_branch_cfa,0x0008 ; to branch_destination_0x6C93
defw dliteral_cfa
defw branch_cfa,0x0006 ; to branch_destination_0x6C97
branch_destination_0x6C93:
defw drop_cfa
defw literal_cfa
branch_destination_0x6C97:
defw question_stack_cfa
branch_destination_0x6C99:
defw branch_cfa,0xFFC2 ; to branch_destination_0x6C5D
immediate_nfa:
defb 0x09+0x80,"IMMEDIAT","E"+0x80
immediate_lfa:
defw interpret_nfa
immediate_cfa:
defw do_colon
immediate_pfa:
defw latest_cfa
defw lit_cfa,0x0040
defw toggle_cfa
defw semicolon_s_cfa
vocabulary_nfa:
defb 0x0A+0x80,"VOCABULAR","Y"+0x80
vocabulary_lfa:
defw immediate_nfa
vocabulary_cfa:
defw do_colon
vocabulary_pfa:
defw builds_cfa
defw lit_cfa,0xA081 ; Dummy name field.
defw comma_cfa
defw current_cfa
defw fetch_cfa
defw cfa_cfa
defw comma_cfa
defw here_cfa
defw voc_link_cfa
defw fetch_cfa
defw comma_cfa
defw voc_link_cfa
defw store_cfa
defw does_cfa
do_vocabulary:
defw two_plus_cfa
defw context_cfa
defw store_cfa
defw semicolon_s_cfa
forth_nfa:
defb 0x05+0x80+precedence_bit_mask,"FORT","H"+0x80
forth_lfa:
defw vocabulary_nfa
forth_cfa:
defw do_does
forth_pfa:
defw do_vocabulary
forth_vocabulary_dummy_nfa:
defw 0xA081 ; Dummy name field.
forth_vocabulary_latest:
defw udg_nfa
forth_vocabulary_link:
defw 0x0000
definitions_nfa:
defb 0x0B+0x80,"DEFINITION","S"+0x80
definitions_lfa:
defw forth_nfa
definitions_cfa:
defw do_colon
definitions_pfa:
defw context_cfa
defw fetch_cfa
defw current_cfa
defw store_cfa
defw semicolon_s_cfa
paren_nfa:
defb 0x01+0x80+precedence_bit_mask,"("+0x80
paren_lfa:
defw definitions_nfa
paren_cfa:
defw do_colon
paren_pfa:
defw lit_cfa,0x0029
defw word_cfa
defw semicolon_s_cfa
quit_nfa:
defb 0x04+0x80,"QUI","T"+0x80
quit_lfa:
defw paren_nfa
quit_cfa:
defw do_colon
quit_pfa:
defw zero_cfa
defw blk_cfa
defw store_cfa
defw left_bracket_cfa
branch_destination_0x6D35:
defw rp_store_cfa
defw cr_cfa
defw query_cfa
defw interpret_cfa
defw state_cfa
defw fetch_cfa
defw zero_equals_cfa
defw zero_branch_cfa,0x0007 ; to branch_destination_0x6D4C
defw paren_dot_quote_cfa
defb 0x02,"ok"
branch_destination_0x6D4C:
defw branch_cfa,0xFFE7 ; to branch_destination_0x6D35
abort_nfa:
defb 0x05+0x80,"ABOR","T"+0x80
abort_lfa:
defw quit_nfa
abort_cfa:
defw do_colon
abort_pfa:
defw sp_store_cfa
defw decimal_cfa
defw question_stack_cfa
defw cls_cfa
defw cr_cfa
defw dot_cpu_cfa
defw paren_dot_quote_cfa
defb 0x0E,"fig-FORTH 1.1A"
defw cr_cfa
defw paren_dot_quote_cfa
defb 0x0F,0x7F," Abersoft:1983"
defw cr_cfa
defw forth_cfa
defw definitions_cfa
defw quit_cfa
warm_start:
ld bc,warm_start_phony_cfa
ld ix,(user_pointer_value)
; XXX FIXME -- `ld sp,(init_s0_value)` can be used instead:
ld hl,(init_s0_value)
ld sp,hl
jp next
warm_start_phony_cfa:
defw warm_cfa
warm_nfa:
defb 0x04+0x80,"WAR","M"+0x80
warm_lfa:
defw abort_nfa
warm_cfa:
defw do_colon
warm_pfa:
defw empty_buffers_cfa
defw abort_cfa
cold_start:
ld a,0x08
ld (sys_flags2),a
xor a
ld (printer_channel_or_zero),a
ld bc,cold_start_phony_cfa
ld ix,(user_pointer_value)
; XXX FIXME -- `ld sp,(init_s0_value)` can be used instead:
ld hl,(init_s0_value)
ld sp,hl
jp next
cold_start_phony_cfa:
defw cold_cfa
cold_nfa:
defb 0x04+0x80,"COL","D"+0x80
cold_lfa:
defw warm_nfa
cold_cfa:
defw do_colon
cold_pfa:
; XXX FIXME -- `FIRST` should be used instead of compiled literals with its value:
defw empty_buffers_cfa
defw lit_cfa,first_buffer
defw use_cfa
defw store_cfa
defw lit_cfa,first_buffer
defw prev_cfa
defw store_cfa
defw dr0_cfa
defw lit_cfa,init_s0_value
defw lit_cfa,user_pointer_value
defw fetch_cfa
defw lit_cfa,0x0006
defw plus_cfa
defw lit_cfa,0x0010
defw cmove_cfa
defw lit_cfa,top_most_word_in_forth_voc
defw fetch_cfa
defw lit_cfa,forth_vocabulary_latest
defw store_cfa
defw abort_cfa
s_to_d_nfa:
defb 0x04+0x80,"S->","D"+0x80
s_to_d_lfa:
defw cold_nfa
s_to_d_cfa:
defw s_to_d_pfa
s_to_d_pfa:
pop de
ld hl,0x0000
ld a,d
and 0x80
jr z,l6e1dh
dec hl
l6e1dh:
jp pushde
plus_minus_nfa:
defb 0x02+0x80,"+","-"+0x80
plus_minus_lfa:
defw s_to_d_nfa
plus_minus_cfa:
defw do_colon
plus_minus_pfa:
defw zero_less_than_cfa
defw zero_branch_cfa,0x0004 ; to branch_destination_0x6E2F
defw minus_cfa
branch_destination_0x6E2F:
defw semicolon_s_cfa
d_plus_minus_nfa:
defb 0x03+0x80,"D+","-"+0x80
d_plus_minus_lfa:
defw plus_minus_nfa
d_plus_minus_cfa:
defw do_colon
d_plus_minus_pfa:
defw zero_less_than_cfa
defw zero_branch_cfa,0x0004 ; to branch_destination_0x6E41
defw dminus_cfa
branch_destination_0x6E41:
defw semicolon_s_cfa
abs_nfa:
defb 0x03+0x80,"AB","S"+0x80
abs_lfa:
defw d_plus_minus_nfa
abs_cfa:
defw do_colon
abs_pfa:
defw dup_cfa
defw plus_minus_cfa
defw semicolon_s_cfa
dabs_nfa:
defb 0x04+0x80,"DAB","S"+0x80
dabs_lfa:
defw abs_nfa
dabs_cfa:
defw do_colon
dabs_pfa:
defw dup_cfa
defw d_plus_minus_cfa
defw semicolon_s_cfa
min_nfa:
defb 0x03+0x80,"MI","N"+0x80
min_lfa:
defw dabs_nfa
min_cfa:
defw do_colon
min_pfa:
defw two_dup_cfa
defw greater_than_cfa
defw zero_branch_cfa,0x0004 ; to branch_destination_0x6E72
defw swap_cfa
branch_destination_0x6E72:
defw drop_cfa
defw semicolon_s_cfa
max_nfa:
defb 0x03+0x80,"MA","X"+0x80
max_lfa:
defw min_nfa
max_cfa:
defw do_colon
max_pfa:
defw two_dup_cfa
defw less_than_cfa
defw zero_branch_cfa,0x0004 ; to branch_destination_0x6E88
defw swap_cfa
branch_destination_0x6E88:
defw drop_cfa
defw semicolon_s_cfa
m_star_nfa:
defb 0x02+0x80,"M","*"+0x80
m_star_lfa:
defw max_nfa
m_star_cfa:
defw do_colon
m_star_pfa:
defw two_dup_cfa
defw xor_cfa
defw to_r_cfa
defw abs_cfa
defw swap_cfa
defw abs_cfa
defw u_star_cfa
defw from_r_cfa
defw d_plus_minus_cfa
defw semicolon_s_cfa
m_slash_nfa:
defb 0x02+0x80,"M","/"+0x80
m_slash_lfa:
defw m_star_nfa
m_slash_cfa:
defw do_colon
m_slash_pfa:
defw over_cfa
defw to_r_cfa
defw to_r_cfa
defw dabs_cfa
defw r_cfa
defw abs_cfa
defw u_slash_mod_cfa
defw from_r_cfa
defw r_cfa
defw xor_cfa
defw plus_minus_cfa
defw swap_cfa
defw from_r_cfa
defw plus_minus_cfa
defw swap_cfa
defw semicolon_s_cfa
star_nfa:
defb 0x01+0x80,"*"+0x80
star_lfa:
defw m_slash_nfa
star_cfa:
defw do_colon
star_pfa:
defw m_star_cfa
defw drop_cfa
defw semicolon_s_cfa
slash_mod_nfa:
defb 0x04+0x80,"/MO","D"+0x80
slash_mod_lfa:
defw star_nfa
slash_mod_cfa:
defw do_colon
slash_mod_pfa:
defw to_r_cfa
defw s_to_d_cfa
defw from_r_cfa
defw m_slash_cfa
defw semicolon_s_cfa
slash_nfa:
defb 0x01+0x80,"/"+0x80
slash_lfa:
defw slash_mod_nfa
slash_cfa:
defw do_colon
slash_pfa:
defw slash_mod_cfa
defw swap_cfa
defw drop_cfa
defw semicolon_s_cfa
mod_nfa:
defb 0x03+0x80,"MO","D"+0x80
mod_lfa:
defw slash_nfa
mod_cfa:
defw do_colon
mod_pfa:
defw slash_mod_cfa
defw drop_cfa
defw semicolon_s_cfa
star_slash_mod_nfa:
defb 0x05+0x80,"*/MO","D"+0x80
star_slash_mod_lfa:
defw mod_nfa
star_slash_mod_cfa:
defw do_colon
star_slash_mod_pfa:
defw to_r_cfa
defw m_star_cfa
defw from_r_cfa
defw m_slash_cfa
defw semicolon_s_cfa
star_slash_nfa:
defb 0x02+0x80,"*","/"+0x80
star_slash_lfa:
defw star_slash_mod_nfa
star_slash_cfa:
defw do_colon
star_slash_pfa:
defw star_slash_mod_cfa
defw swap_cfa
defw drop_cfa
defw semicolon_s_cfa
m_slash_mod_nfa:
defb 0x05+0x80,"M/MO","D"+0x80
m_slash_mod_lfa:
defw star_slash_nfa
m_slash_mod_cfa:
defw do_colon
m_slash_mod_pfa:
defw to_r_cfa
defw zero_cfa
defw r_cfa
defw u_slash_mod_cfa
defw from_r_cfa
defw swap_cfa
defw to_r_cfa
defw u_slash_mod_cfa
defw from_r_cfa
defw semicolon_s_cfa
paren_line_nfa:
defb 0x06+0x80,"(LINE",")"+0x80
paren_line_lfa:
defw m_slash_mod_nfa
paren_line_cfa:
defw do_colon
paren_line_pfa:
; XXX FIXME -- `C/L` should be used instead of the compiled literals (0x0040):
defw to_r_cfa
defw lit_cfa,0x0040
defw b_slash_buf_cfa
defw star_slash_mod_cfa
defw from_r_cfa
defw b_slash_scr_cfa
defw star_cfa
defw plus_cfa
defw block_cfa
defw plus_cfa
defw lit_cfa,0x0040
defw semicolon_s_cfa
dot_line_nfa:
defb 0x05+0x80,".LIN","E"+0x80
dot_line_lfa:
defw paren_line_nfa
dot_line_cfa:
defw do_colon
dot_line_pfa:
defw paren_line_cfa
defw minus_trailing_cfa
defw type_cfa
defw semicolon_s_cfa
message_nfa:
defb 0x07+0x80,"MESSAG","E"+0x80
message_lfa:
defw dot_line_nfa
message_cfa:
defw do_colon
message_pfa:
defw warning_cfa
defw fetch_cfa
defw zero_branch_cfa,0x001E ; to branch_destination_0x6FB3
; XXX FIXME --
; Because of the conditional branch below, error message 0
; is not printed when `WARNING` is 1, in other words:
; when error messages are the text of a line relative to screen 4.
; This condition is in other fig-Forth implementations,
; but in Abersoft Forth it is a bug,
; because error 0 is used by the system: "Word not found".
defw minus_dup_cfa
defw zero_branch_cfa,0x0014 ; to branch_destination_0x6FAF
defw lit_cfa,0x0004
defw offset_cfa
defw fetch_cfa
defw b_slash_scr_cfa
defw slash_cfa
defw minus_sign_cfa
defw dot_line_cfa
defw space_cfa
branch_destination_0x6FAF:
defw branch_cfa,0x000D ; to branch_destination_0x6FBE
branch_destination_0x6FB3:
defw paren_dot_quote_cfa
defb 0x06,"MSG # "
defw dot_cfa
branch_destination_0x6FBE:
defw semicolon_s_cfa
question_terminal_routine:
; XXX FIXME -- Saving and restoring the DE and BC registers is unnecessary.
push bc
push de
call rom_break_key
ld hl,0x0000
jr c,l6fcdh
inc l
jr l6fd5h
l6fcdh:
ld a,(sys_last_k)
cp 0x07
jr nz,l6fd5h
inc hl
l6fd5h:
pop de
pop bc
jp pushhl
key_routine_cursor_char:
defb 0x43
key_routine:
push bc
ld a,0x02
call rom_chan_open
ld a,0x12
rst 0x10
ld a,0x01
rst 0x10
l6fe7h:
xor a
ld (sys_last_k),a
l6febh:
ld a,(key_routine_cursor_char)
rst 0x10
ld a,0x08
rst 0x10
ld a,(sys_last_k)
and a
jr z,l6febh
cp 0x06
jr nz,l7012h
ld hl,sys_flags2
ld a,0x08
xor (hl)
ld (hl),a
l7003h:
ld hl,key_routine_cursor_char
bit 3,a
jr nz,l700eh
ld (hl),0x4C
jr l6fe7h
l700eh:
ld (hl),0x43
jr l6fe7h
l7012h:
cp 0x0F
jr nz,l702ch
ld a,0x02
ld hl,sys_mode
xor (hl)
ld (hl),a
and a
jr nz,l7025h
ld a,(sys_flags2)
jr l7003h
l7025h:
ld a,0x47
ld (key_routine_cursor_char),a
jr l6fe7h
l702ch:
cp 0xC6
jr nz,l7032h
ld a,0x5B
l7032h:
cp 0xC5
jr nz,l7038h
ld a,0x5D
l7038h:
cp 0xE2
jr nz,l703eh
ld a,0x7E
l703eh:
cp 0xC3
jr nz,l7044h
ld a,0x7C
l7044h:
cp 0xCD
jr nz,l704ah
ld a,0x5C
l704ah:
cp 0xCC
jr nz,l7050h
ld a,0x7B
l7050h:
cp 0xCB
jr nz,l7056h
ld a,0x7D
l7056h:
cp 0xA5
jr nc,l6fe7h
ld l,a
ld h,0x00
ld a,0x12
rst 0x10
ld a,0x00
rst 0x10
ld a,0x20
rst 0x10
ld a,0x08
rst 0x10
pop bc
jp pushhl
printer_channel_or_zero:
defb 0x00
paren_emit_cfa:
defw paren_emit_pfa
paren_emit_pfa:
pop hl
push bc
push hl
ld a,0x02
call rom_chan_open
pop hl
push hl
ld a,l
rst 0x10
ld a,(printer_channel_or_zero)
and a
jr z,l7089h
call rom_chan_open
pop hl
push hl
ld a,l
rst 0x10
l7089h:
pop hl
ld a,0xFF
ld (sys_scr_ct),a
pop bc
jp next
cr_routine:
push bc
ld a,0x02
call rom_chan_open
ld a,0x0D
rst 0x10
ld a,(printer_channel_or_zero)
and a
jr z,l70a8h
call rom_chan_open
ld a,0x0D
rst 0x10
l70a8h:
pop bc
ld a,0xFF
ld (sys_scr_ct),a
jp next
use_nfa:
defb 0x03+0x80,"US","E"+0x80
use_lfa:
defw message_nfa
use_cfa:
defw do_variable
use_pfa:
defw first_buffer
prev_nfa:
defb 0x04+0x80,"PRE","V"+0x80
prev_lfa:
defw use_nfa
prev_cfa:
defw do_variable
prev_pfa:
defw first_buffer
hash_buff_nfa:
defb 0x05+0x80,"#BUF","F"+0x80
hash_buff_lfa:
defw prev_nfa
hash_buff_cfa:
defw do_constant
hash_buff_pfa:
defw 0x0008
plus_buf_nfa:
defb 0x04+0x80,"+BU","F"+0x80
plus_buf_lfa:
defw hash_buff_nfa
plus_buf_cfa:
defw do_colon
plus_buf_pfa:
defw lit_cfa,0x0084
defw plus_cfa
defw dup_cfa
defw limit_cfa
defw equals_cfa
defw zero_branch_cfa,0x0006 ; to branch_destination_0x70EF
defw drop_cfa
defw first_cfa
branch_destination_0x70EF:
defw dup_cfa
defw prev_cfa
defw fetch_cfa
defw minus_sign_cfa
defw semicolon_s_cfa
update_nfa:
defb 0x06+0x80,"UPDAT","E"+0x80
update_lfa:
defw plus_buf_nfa
update_cfa:
defw do_colon
update_pfa:
defw prev_cfa
defw fetch_cfa
defw fetch_cfa
defw lit_cfa,0x8000
defw or_cfa
defw prev_cfa
defw fetch_cfa
defw store_cfa
defw semicolon_s_cfa
empty_buffers_nfa:
defb 0x0D+0x80,"EMPTY-BUFFER","S"+0x80
empty_buffers_lfa:
defw update_nfa
empty_buffers_cfa:
defw do_colon
empty_buffers_pfa:
defw first_cfa
defw limit_cfa
defw over_cfa
defw minus_sign_cfa
defw erase_cfa
defw limit_cfa
defw first_cfa
defw paren_do_cfa
branch_destination_0x713A:
defw lit_cfa,0x7FFF
defw i_cfa
defw store_cfa
defw lit_cfa,0x0084
defw paren_plus_loop_cfa,0xFFF2 ; to branch_destination_0x713A
defw semicolon_s_cfa
dr0_nfa:
defb 0x03+0x80,"DR","0"+0x80
dr0_lfa:
defw empty_buffers_nfa
dr0_cfa:
defw do_colon
dr0_pfa:
defw zero_cfa
defw offset_cfa
defw store_cfa
defw semicolon_s_cfa
buffer_nfa:
defb 0x06+0x80,"BUFFE","R"+0x80
buffer_lfa:
defw dr0_nfa
buffer_cfa:
defw do_colon
buffer_pfa:
defw use_cfa
defw fetch_cfa
defw dup_cfa
defw to_r_cfa
branch_destination_0x716F:
defw plus_buf_cfa
defw zero_branch_cfa,0xFFFC ; to branch_destination_0x716F
defw use_cfa
defw store_cfa
defw r_cfa
defw fetch_cfa
defw zero_less_than_cfa
defw zero_branch_cfa,0x0014 ; to branch_destination_0x7195
defw r_cfa
defw two_plus_cfa
defw r_cfa
defw fetch_cfa
defw lit_cfa,0x7FFF
defw and_cfa
defw zero_cfa
defw read_write_cfa
branch_destination_0x7195:
defw r_cfa
defw store_cfa
defw r_cfa
defw prev_cfa
defw store_cfa
defw from_r_cfa
defw two_plus_cfa
defw semicolon_s_cfa
block_nfa:
defb 0x05+0x80,"BLOC","K"+0x80
block_lfa:
defw buffer_nfa
block_cfa:
defw do_colon
block_pfa:
defw offset_cfa
defw fetch_cfa
defw plus_cfa
defw to_r_cfa
defw prev_cfa
defw fetch_cfa
defw dup_cfa
defw fetch_cfa
defw r_cfa
defw minus_sign_cfa
defw dup_cfa
defw plus_cfa
defw zero_branch_cfa,0x0034 ; to branch_destination_0x71FD
branch_destination_0x71CB:
defw plus_buf_cfa
defw zero_equals_cfa
defw zero_branch_cfa,0x0014 ; to branch_destination_0x71E5
defw drop_cfa
defw r_cfa
defw buffer_cfa
defw dup_cfa
defw r_cfa
defw one_cfa
defw read_write_cfa
defw two_cfa
defw minus_sign_cfa
branch_destination_0x71E5:
defw dup_cfa
defw fetch_cfa
defw r_cfa
defw minus_sign_cfa
defw dup_cfa
defw plus_cfa
defw zero_equals_cfa
defw zero_branch_cfa,0xFFD6 ; to branch_destination_0x71CB
defw dup_cfa
defw prev_cfa
defw store_cfa
branch_destination_0x71FD:
defw from_r_cfa
defw drop_cfa
defw two_plus_cfa
defw semicolon_s_cfa
lo_nfa:
defb 0x02+0x80,"L","O"+0x80
lo_lfa:
defw block_nfa
lo_cfa:
defw do_constant
lo_pfa:
defw ram_disc_bottom
hi_nfa:
defb 0x02+0x80,"H","I"+0x80
hi_lfa:
defw lo_nfa
hi_cfa:
defw do_constant
hi_pfa:
defw ram_disc_top
read_write_nfa:
defb 0x03+0x80,"R/","W"+0x80
read_write_lfa:
defw hi_nfa
read_write_cfa:
defw do_colon
read_write_pfa:
defw to_r_cfa
defw b_slash_buf_cfa
defw star_cfa
defw lo_cfa
defw plus_cfa
defw dup_cfa
defw hi_cfa
defw greater_than_cfa
defw lit_cfa,0x0006
defw question_error_cfa
defw from_r_cfa
defw zero_branch_cfa,0x0004 ; to branch_destination_0x723D
defw swap_cfa
branch_destination_0x723D:
defw b_slash_buf_cfa
defw cmove_cfa
defw semicolon_s_cfa
flush_nfa:
defb 0x05+0x80,"FLUS","H"+0x80
flush_lfa:
defw read_write_nfa
flush_cfa:
defw do_colon
flush_pfa:
defw hash_buff_cfa
defw one_plus_cfa
defw zero_cfa
defw paren_do_cfa
branch_destination_0x7255:
defw zero_cfa
defw buffer_cfa
defw drop_cfa
defw paren_loop_cfa,0xFFF8 ; to branch_destination_0x7255
defw semicolon_s_cfa
load_nfa:
defb 0x04+0x80,"LOA","D"+0x80
load_lfa:
defw flush_nfa
load_cfa:
defw do_colon
load_pfa:
defw dup_cfa
defw zero_cfa
defw equals_cfa
defw lit_cfa,0x0009
defw question_error_cfa
defw blk_cfa
defw fetch_cfa
defw to_r_cfa
defw in_cfa
defw fetch_cfa
defw to_r_cfa
defw zero_cfa
defw in_cfa
defw store_cfa
defw b_slash_scr_cfa
defw star_cfa
defw blk_cfa
defw store_cfa
defw interpret_cfa
defw from_r_cfa
defw in_cfa
defw store_cfa
defw from_r_cfa
defw blk_cfa
defw store_cfa
defw semicolon_s_cfa
next_screen_nfa:
defb 0x03+0x80+precedence_bit_mask,"--",">"+0x80
next_screen_lfa:
defw load_nfa
next_screen_cfa:
defw do_colon
next_screen_pfa:
defw question_loading_cfa
defw zero_cfa
defw in_cfa
defw store_cfa
defw b_slash_scr_cfa
defw blk_cfa
defw fetch_cfa
defw over_cfa
defw mod_cfa
defw minus_sign_cfa
defw blk_cfa
defw plus_store_cfa
defw semicolon_s_cfa
tick_nfa:
defb 0x01+0x80+precedence_bit_mask,"'"+0x80
tick_lfa:
defw next_screen_nfa
tick_cfa:
defw do_colon
tick_pfa:
defw minus_find_cfa
defw zero_equals_cfa
defw zero_cfa
defw question_error_cfa
defw drop_cfa
defw literal_cfa
defw semicolon_s_cfa
back_nfa:
defb 0x04+0x80,"BAC","K"+0x80
back_lfa:
defw tick_nfa
back_cfa:
defw do_colon
back_pfa:
defw here_cfa
defw minus_sign_cfa
defw comma_cfa
defw semicolon_s_cfa
begin_nfa:
defb 0x05+0x80+precedence_bit_mask,"BEGI","N"+0x80
begin_lfa:
defw back_nfa
begin_cfa:
defw do_colon
begin_pfa:
defw question_comp_cfa
defw here_cfa
defw one_cfa
defw semicolon_s_cfa
endif_nfa:
defb 0x05+0x80+precedence_bit_mask,"ENDI","F"+0x80
endif_lfa:
defw begin_nfa
endif_cfa:
defw do_colon
endif_pfa:
defw question_comp_cfa
defw two_cfa
defw question_pairs_cfa
defw here_cfa
defw over_cfa
defw minus_sign_cfa
defw swap_cfa
defw store_cfa
defw semicolon_s_cfa
then_nfa:
defb 0x04+0x80+precedence_bit_mask,"THE","N"+0x80
then_lfa:
defw endif_nfa
then_cfa:
defw do_colon
then_pfa:
defw endif_cfa
defw semicolon_s_cfa
do_nfa:
defb 0x02+0x80+precedence_bit_mask,"D","O"+0x80
do_lfa:
defw then_nfa
do_cfa:
defw do_colon
do_pfa:
defw compile_cfa
defw paren_do_cfa
defw here_cfa
defw three_cfa
defw semicolon_s_cfa
loop_nfa:
defb 0x04+0x80+precedence_bit_mask,"LOO","P"+0x80
loop_lfa:
defw do_nfa
loop_cfa:
defw do_colon
loop_pfa:
defw three_cfa
defw question_pairs_cfa
defw compile_cfa
defw paren_loop_cfa
defw back_cfa
defw semicolon_s_cfa
plus_loop_nfa:
defb 0x05+0x80+precedence_bit_mask,"+LOO","P"+0x80
plus_loop_lfa:
defw loop_nfa
plus_loop_cfa:
defw do_colon
plus_loop_pfa:
defw three_cfa
defw question_pairs_cfa
defw compile_cfa
defw paren_plus_loop_cfa
defw back_cfa
defw semicolon_s_cfa
until_nfa:
defb 0x05+0x80+precedence_bit_mask,"UNTI","L"+0x80
until_lfa:
defw plus_loop_nfa
until_cfa:
defw do_colon
until_pfa:
defw one_cfa
defw question_pairs_cfa
defw compile_cfa
defw zero_branch_cfa
defw back_cfa
defw semicolon_s_cfa
end_nfa:
defb 0x03+0x80+precedence_bit_mask,"EN","D"+0x80
end_lfa:
defw until_nfa
end_cfa:
defw do_colon
end_pfa:
defw until_cfa
defw semicolon_s_cfa
again_nfa:
defb 0x05+0x80+precedence_bit_mask,"AGAI","N"+0x80
again_lfa:
defw end_nfa
again_cfa:
defw do_colon
again_pfa:
defw one_cfa
defw question_pairs_cfa
defw compile_cfa
defw branch_cfa
defw back_cfa
defw semicolon_s_cfa
repeat_nfa:
defb 0x06+0x80+precedence_bit_mask,"REPEA","T"+0x80
repeat_lfa:
defw again_nfa
repeat_cfa:
defw do_colon
repeat_pfa:
defw to_r_cfa
defw to_r_cfa
defw again_cfa
defw from_r_cfa
defw from_r_cfa
defw two_cfa
defw minus_sign_cfa
defw endif_cfa
defw semicolon_s_cfa
if_nfa:
defb 0x02+0x80+precedence_bit_mask,"I","F"+0x80
if_lfa:
defw repeat_nfa
if_cfa:
defw do_colon
if_pfa:
defw compile_cfa
defw zero_branch_cfa
defw here_cfa
defw zero_cfa
defw comma_cfa
defw two_cfa
defw semicolon_s_cfa
else_nfa:
defb 0x04+0x80+precedence_bit_mask,"ELS","E"+0x80
else_lfa:
defw if_nfa
else_cfa:
defw do_colon
else_pfa:
defw two_cfa
defw question_pairs_cfa
defw compile_cfa
defw branch_cfa
defw here_cfa
defw zero_cfa
defw comma_cfa
defw swap_cfa
defw two_cfa
defw endif_cfa
defw two_cfa
defw semicolon_s_cfa
while_nfa:
defb 0x05+0x80+precedence_bit_mask,"WHIL","E"+0x80
while_lfa:
defw else_nfa
while_cfa:
defw do_colon
while_pfa:
defw if_cfa
defw two_plus_cfa
defw semicolon_s_cfa
spaces_nfa:
defb 0x06+0x80,"SPACE","S"+0x80
spaces_lfa:
defw while_nfa
spaces_cfa:
defw do_colon
spaces_pfa:
defw zero_cfa
defw max_cfa
defw minus_dup_cfa
defw zero_branch_cfa,0x000C ; to branch_destination_0x7418
defw zero_cfa
defw paren_do_cfa
branch_destination_0x7412:
defw space_cfa
defw paren_loop_cfa,0xFFFC ; to branch_destination_0x7412
branch_destination_0x7418:
defw semicolon_s_cfa
less_hash_nfa:
defb 0x02+0x80,"<","#"+0x80
less_hash_lfa:
defw spaces_nfa
less_hash_cfa:
defw do_colon
less_hash_pfa:
defw pad_cfa
defw hld_cfa
defw store_cfa
defw semicolon_s_cfa
hash_greater_nfa:
defb 0x02+0x80,"#",">"+0x80
hash_greater_lfa:
defw less_hash_nfa
hash_greater_cfa:
defw do_colon
hash_greater_pfa:
defw drop_cfa
defw drop_cfa
defw hld_cfa
defw fetch_cfa
defw pad_cfa
defw over_cfa
defw minus_sign_cfa
defw semicolon_s_cfa
sign_nfa:
defb 0x04+0x80,"SIG","N"+0x80
sign_lfa:
defw hash_greater_nfa
sign_cfa:
defw do_colon
sign_pfa:
defw rot_cfa
defw zero_less_than_cfa
defw zero_branch_cfa,0x0008 ; to branch_destination_0x7457
defw lit_cfa,0x002D
defw hold_cfa
branch_destination_0x7457:
defw semicolon_s_cfa
hash_nfa:
defb 0x01+0x80,"#"+0x80
hash_lfa:
defw sign_nfa
hash_cfa:
defw do_colon
hash_pfa:
defw base_cfa
defw fetch_cfa
defw m_slash_mod_cfa
defw rot_cfa
defw lit_cfa,0x0009
defw over_cfa
defw less_than_cfa
defw zero_branch_cfa,0x0008 ; to branch_destination_0x7479
defw lit_cfa,0x0007
defw plus_cfa
branch_destination_0x7479:
defw lit_cfa,0x0030
defw plus_cfa
defw hold_cfa
defw semicolon_s_cfa
hash_s_nfa:
defb 0x02+0x80,"#","S"+0x80
hash_s_lfa:
defw hash_nfa
hash_s_cfa:
defw do_colon
branch_destination_0x748A:
hash_s_pfa:
defw hash_cfa
; XXX FIXME -- Optimize: `2DUP` instead of `OVER OVER`:
defw over_cfa
defw over_cfa
defw or_cfa
defw zero_equals_cfa
defw zero_branch_cfa,0xFFF4 ; to branch_destination_0x748A
defw semicolon_s_cfa
d_dot_r_nfa:
defb 0x03+0x80,"D.","R"+0x80
d_dot_r_lfa:
defw hash_s_nfa
d_dot_r_cfa:
defw do_colon
d_dot_r_pfa:
defw to_r_cfa
defw swap_cfa
defw over_cfa
defw dabs_cfa
defw less_hash_cfa
defw hash_s_cfa
defw sign_cfa
defw hash_greater_cfa
defw from_r_cfa
defw over_cfa
defw minus_sign_cfa
defw spaces_cfa
defw type_cfa
defw semicolon_s_cfa
dot_r_nfa:
defb 0x02+0x80,".","R"+0x80
dot_r_lfa:
defw d_dot_r_nfa
dot_r_cfa:
defw do_colon
dot_r_pfa:
defw to_r_cfa
defw s_to_d_cfa
defw from_r_cfa
defw d_dot_r_cfa
defw semicolon_s_cfa
d_dot_nfa:
defb 0x02+0x80,"D","."+0x80
d_dot_lfa:
defw dot_r_nfa
d_dot_cfa:
defw do_colon
d_dot_pfa:
defw zero_cfa
defw d_dot_r_cfa
defw space_cfa
defw semicolon_s_cfa
dot_nfa:
defb 0x01+0x80,"."+0x80
dot_lfa:
defw d_dot_nfa
dot_cfa:
defw do_colon
dot_pfa:
defw s_to_d_cfa
defw d_dot_cfa
defw semicolon_s_cfa
question_nfa:
defb 0x01+0x80,"?"+0x80
question_lfa:
defw dot_nfa
question_cfa:
defw do_colon
question_pfa:
defw fetch_cfa
defw dot_cfa
defw semicolon_s_cfa
u_dot_nfa:
defb 0x02+0x80,"U","."+0x80
u_dot_lfa:
defw question_nfa
u_dot_cfa:
defw do_colon
u_dot_pfa:
defw zero_cfa
defw d_dot_cfa
defw semicolon_s_cfa
vlist_nfa:
defb 0x05+0x80,"VLIS","T"+0x80
vlist_lfa:
defw u_dot_nfa
vlist_cfa:
defw do_colon
vlist_pfa:
defw lit_cfa,0x0080
defw out_cfa
defw store_cfa
defw context_cfa
defw fetch_cfa
defw fetch_cfa
branch_destination_0x751B:
defw out_cfa
defw fetch_cfa
defw lit_cfa,0x001F
defw lit_cfa,0x0008
defw minus_sign_cfa
defw greater_than_cfa
defw zero_branch_cfa,0x000A ; to branch_destination_0x7537
defw cr_cfa
defw zero_cfa
defw out_cfa
defw store_cfa
branch_destination_0x7537:
defw dup_cfa
defw id_dot_cfa
defw pfa_cfa
defw lfa_cfa
defw fetch_cfa
defw dup_cfa
defw zero_equals_cfa
defw question_terminal_cfa
defw or_cfa
defw zero_branch_cfa,0xFFD0 ; to branch_destination_0x751B
defw drop_cfa
defw semicolon_s_cfa
list_nfa:
defb 0x04+0x80,"LIS","T"+0x80
list_lfa:
defw vlist_nfa
list_cfa:
defw do_colon
list_pfa:
defw decimal_cfa
defw cr_cfa
defw dup_cfa
defw scr_cfa
defw store_cfa
defw paren_dot_quote_cfa
defb 0x06,"SCR # "
defw dot_cfa
defw lit_cfa,0x0010
defw zero_cfa
defw paren_do_cfa
branch_destination_0x7577:
defw cr_cfa
defw i_cfa
defw lit_cfa,0x0003
defw dot_r_cfa
defw space_cfa
defw i_cfa
defw scr_cfa
defw fetch_cfa
defw dot_line_cfa
defw question_terminal_cfa
defw zero_branch_cfa,0x0004 ; to branch_destination_0x7593
defw leave_cfa
branch_destination_0x7593:
defw paren_loop_cfa,0xFFE2 ; to branch_destination_0x7577
defw cr_cfa
defw semicolon_s_cfa
link_nfa:
defb 0x04+0x80,"LIN","K"+0x80
link_lfa:
defw list_nfa
link_cfa:
defw link_pfa
link_pfa:
pop hl
ld a,l
and a
jr z,l75abh
ld a,0x03
l75abh:
ld (printer_channel_or_zero),a
jp next
cls_nfa:
defb 0x03+0x80,"CL","S"+0x80
cls_lfa:
defw link_nfa
cls_cfa:
defw cls_pfa
cls_pfa:
push bc
ld a,0x02
call rom_chan_open
call rom_cls
ld a,0x02
call rom_chan_open
pop bc
jp next
dot_cpu_nfa:
defb 0x04+0x80,".CP","U"+0x80
dot_cpu_lfa:
defw cls_nfa
dot_cpu_cfa:
defw do_colon
dot_cpu_pfa:
defw paren_dot_quote_cfa
defb 0x0D,"48K SPECTRUM "
defw semicolon_s_cfa
tape_load_header:
defb 3 ; filetype: code file
defb "DISC " ; filename
tape_load_header_length:
defw 0x2BFF ; XXX FIXME -- It should be 0x2C00.
tape_load_header_address:
defw ram_disc_bottom
tape_load_header_not_used:
defb 0x20
defb 0x20
tape_save_header:
defb 3 ; filetype: code file
defb "DISC " ; filename
tape_save_header_length:
defw 0x2BFF ; XXX FIXME -- It should be 0x2C00.
tape_save_header_address:
defw ram_disc_bottom
tape_save_header_not_used:
defb 0x20
defb 0x20
paren_tape_nfa:
defb 0x06+0x80,"(TAPE",")"+0x80
paren_tape_lfa:
defw dot_cpu_nfa
paren_tape_cfa:
defw paren_tape_pfa
paren_tape_pfa:
pop hl
push bc
push ix
ld a,l
ld hl,ram_disc_bottom
ld ix,tape_load_header
ld (sys_t_addr),a
call rom_sa_all
pop ix
pop bc
jp next
mon_nfa:
defb 0x03+0x80,"MO","N"+0x80
mon_lfa:
defw paren_tape_nfa
mon_cfa:
defw mon_pfa
mon_pfa:
; XXX FIXME -- Checking NMIADD (undocumented feature)
; is not compatible with ZX Spectrum +3.
ld a,(sys_nmiadd)
; XXX FIXME -- This code wastes 3 bytes.
cp 0x00
jr z,l763dh
jp next
l763dh:
rst 0x08
defb 0x08
text_nfa:
defb 0x04+0x80,"TEX","T"+0x80
text_lfa:
defw mon_nfa
text_cfa:
defw do_colon
text_pfa:
defw here_cfa
defw c_slash_l_cfa
defw one_plus_cfa
defw blanks_cfa
defw word_cfa
defw here_cfa
defw pad_cfa
defw c_slash_l_cfa
defw one_plus_cfa
defw cmove_cfa
defw semicolon_s_cfa
line_nfa:
defb 0x04+0x80,"LIN","E"+0x80
line_lfa:
defw text_nfa
line_cfa:
defw do_colon
line_pfa:
defw dup_cfa
defw lit_cfa,0xFFF0
defw and_cfa
defw lit_cfa,0x0017
defw question_error_cfa
defw scr_cfa
defw fetch_cfa
defw paren_line_cfa
defw drop_cfa
defw semicolon_s_cfa
loadt_nfa:
defb 0x05+0x80,"LOAD","T"+0x80
loadt_lfa:
defw line_nfa
loadt_cfa:
defw do_colon
loadt_pfa:
defw one_cfa
defw paren_tape_cfa
defw semicolon_s_cfa
savet_nfa:
defb 0x05+0x80,"SAVE","T"+0x80
savet_lfa:
defw loadt_nfa
savet_cfa:
defw do_colon
savet_pfa:
defw flush_cfa
defw zero_cfa
defw paren_tape_cfa
defw semicolon_s_cfa
verify_nfa:
defb 0x06+0x80,"VERIF","Y"+0x80
verify_lfa:
defw savet_nfa
verify_cfa:
defw do_colon
verify_pfa:
defw two_cfa
defw paren_tape_cfa
defw semicolon_s_cfa
two_drop_nfa:
defb 0x05+0x80,"2DRO","P"+0x80
two_drop_lfa:
defw verify_nfa
two_drop_cfa:
defw do_colon
two_drop_pfa:
defw drop_cfa
defw drop_cfa
defw semicolon_s_cfa
two_swap_nfa:
defb 0x05+0x80,"2SWA","P"+0x80
two_swap_lfa:
defw two_drop_nfa
two_swap_cfa:
defw do_colon
two_swap_pfa:
defw rot_cfa
defw to_r_cfa
defw rot_cfa
defw from_r_cfa
defw semicolon_s_cfa
size_nfa:
defb 0x04+0x80,"SIZ","E"+0x80
size_lfa:
defw two_swap_nfa
size_cfa:
defw do_colon
size_pfa:
defw here_cfa
defw zero_cfa
defw plus_origin_cfa
defw minus_sign_cfa
defw semicolon_s_cfa
free_nfa:
defb 0x04+0x80,"FRE","E"+0x80
free_lfa:
defw size_nfa
free_cfa:
defw do_colon
free_pfa:
defw sp_fetch_cfa
defw here_cfa
defw minus_sign_cfa
defw semicolon_s_cfa
forget_nfa:
defb 0x06+0x80,"FORGE","T"+0x80
forget_lfa:
defw free_nfa
forget_cfa:
defw do_colon
forget_pfa:
defw current_cfa
defw fetch_cfa
defw context_cfa
defw fetch_cfa
defw minus_sign_cfa
defw lit_cfa,0x0018
defw question_error_cfa
defw tick_cfa
defw dup_cfa
defw fence_cfa
defw fetch_cfa
defw u_less_than_cfa
defw lit_cfa,0x0015
defw question_error_cfa
defw dup_cfa
defw nfa_cfa
defw dp_cfa
defw store_cfa
defw lfa_cfa
defw fetch_cfa
defw current_cfa
defw fetch_cfa
defw store_cfa
defw semicolon_s_cfa
index_nfa:
defb 0x05+0x80,"INDE","X"+0x80
index_lfa:
defw forget_nfa
index_cfa:
defw do_colon
index_pfa:
defw cls_cfa
defw one_plus_cfa
defw swap_cfa
defw paren_do_cfa
branch_destination_0x774B:
defw cr_cfa
defw i_cfa
defw three_cfa
defw dot_r_cfa
defw space_cfa
defw zero_cfa
defw i_cfa
defw dot_line_cfa
defw question_terminal_cfa
defw zero_branch_cfa,0x0004 ; to branch_destination_0x7763
defw leave_cfa
branch_destination_0x7763:
defw paren_loop_cfa,0xFFE6 ; to branch_destination_0x774B
defw semicolon_s_cfa
triad_nfa:
defb 0x05+0x80,"TRIA","D"+0x80
triad_lfa:
defw index_nfa
triad_cfa:
defw do_colon
triad_pfa:
defw cls_cfa
defw three_cfa
defw slash_cfa
defw three_cfa
defw star_cfa
defw three_cfa
defw over_cfa
defw plus_cfa
defw swap_cfa
defw paren_do_cfa
branch_destination_0x7787:
defw cr_cfa
defw i_cfa
defw list_cfa
defw question_terminal_cfa
defw zero_branch_cfa,0x0004 ; to branch_destination_0x7795
defw leave_cfa
branch_destination_0x7795:
defw paren_loop_cfa,0xFFF0 ; to branch_destination_0x7787
defw semicolon_s_cfa
editor_nfa:
defb 0x06+0x80+precedence_bit_mask,"EDITO","R"+0x80
editor_lfa:
defw triad_nfa
editor_cfa:
defw do_does
editor_pfa:
defw do_vocabulary
editor_vocabulary_dummy_nfa:
defw 0xA081 ; Dummy name field.
editor_vocabulary_latest:
defw c_nfa
editor_vocabulary_link:
defw forth_vocabulary_link
where_nfa:
defb 0x05+0x80,"WHER","E"+0x80
where_lfa:
defw editor_nfa
where_cfa:
defw do_colon
where_pfa:
defw dup_cfa
defw b_slash_scr_cfa
defw slash_cfa
defw dup_cfa
defw scr_cfa
defw store_cfa
defw paren_dot_quote_cfa
defb 0x06,"SCR # "
defw decimal_cfa
defw dot_cfa
defw swap_cfa
defw c_slash_l_cfa
defw slash_mod_cfa
defw c_slash_l_cfa
defw star_cfa
defw rot_cfa
defw block_cfa
defw plus_cfa
defw cr_cfa
defw c_slash_l_cfa
defw type_cfa
defw cr_cfa
defw here_cfa
defw c_fetch_cfa
defw minus_sign_cfa
defw spaces_cfa
defw lit_cfa,0x005E
defw emit_cfa
defw editor_cfa
defw quit_cfa ; XXX FIXME -- useless, because `ERROR` already executed it
defw semicolon_s_cfa
hash_locate_nfa:
defb 0x07+0x80,"#LOCAT","E"+0x80
hash_locate_lfa:
defw forth_vocabulary_dummy_nfa
hash_locate_cfa:
defw do_colon
hash_locate_pfa:
defw r_hash_cfa
defw fetch_cfa
defw c_slash_l_cfa
defw slash_mod_cfa
defw semicolon_s_cfa
hash_lead_nfa:
defb 0x05+0x80,"#LEA","D"+0x80
hash_lead_lfa:
defw hash_locate_nfa
hash_lead_cfa:
defw do_colon
hash_lead_pfa:
defw hash_locate_cfa
defw line_cfa
defw swap_cfa
defw semicolon_s_cfa
hash_lag_nfa:
defb 0x04+0x80,"#LA","G"+0x80
hash_lag_lfa:
defw hash_lead_nfa
hash_lag_cfa:
defw do_colon
hash_lag_pfa:
defw hash_lead_cfa
defw dup_cfa
defw to_r_cfa
defw plus_cfa
defw c_slash_l_cfa
defw from_r_cfa
defw minus_sign_cfa
defw semicolon_s_cfa
minus_move_nfa:
defb 0x05+0x80,"-MOV","E"+0x80
minus_move_lfa:
defw hash_lag_nfa
minus_move_cfa:
defw do_colon
minus_move_pfa:
defw line_cfa
defw c_slash_l_cfa
defw cmove_cfa
defw update_cfa
defw semicolon_s_cfa
h_nfa:
defb 0x01+0x80,"H"+0x80
h_lfa:
defw minus_move_nfa
h_cfa:
defw do_colon
h_pfa:
defw line_cfa
defw pad_cfa
defw one_plus_cfa
defw c_slash_l_cfa
defw dup_cfa
defw pad_cfa
defw c_store_cfa
defw cmove_cfa
defw semicolon_s_cfa
e_nfa:
defb 0x01+0x80,"E"+0x80
e_lfa:
defw h_nfa
e_cfa:
defw do_colon
e_pfa:
defw line_cfa
defw c_slash_l_cfa
defw blanks_cfa
defw update_cfa
defw semicolon_s_cfa
s_nfa:
defb 0x01+0x80,"S"+0x80
s_lfa:
defw e_nfa
s_cfa:
defw do_colon
s_pfa:
defw dup_cfa
defw one_cfa
defw minus_sign_cfa
defw lit_cfa,0x000E
defw paren_do_cfa
branch_destination_0x788C:
defw i_cfa
defw line_cfa
defw i_cfa
defw one_plus_cfa
defw minus_move_cfa
defw lit_cfa,0xFFFF
defw paren_plus_loop_cfa,0xFFF0 ; to branch_destination_0x788C
defw e_cfa
defw semicolon_s_cfa
d_nfa:
defb 0x01+0x80,"D"+0x80
d_lfa:
defw s_nfa
d_cfa:
defw do_colon
d_pfa:
defw dup_cfa
defw h_cfa
defw lit_cfa,0x000F
defw dup_cfa
defw rot_cfa
defw paren_do_cfa
branch_destination_0x78B6:
defw i_cfa
defw one_plus_cfa
defw line_cfa
defw i_cfa
defw minus_move_cfa
defw paren_loop_cfa,0xFFF4 ; to branch_destination_0x78B6
defw e_cfa
defw semicolon_s_cfa
m_nfa:
defb 0x01+0x80,"M"+0x80
m_lfa:
defw d_nfa
m_cfa:
defw do_colon
m_pfa:
defw r_hash_cfa
defw plus_store_cfa
defw cr_cfa
defw space_cfa
defw hash_lead_cfa
defw type_cfa
defw lit_cfa,0x005F
defw emit_cfa
defw hash_lag_cfa
defw type_cfa
defw hash_locate_cfa
defw dot_cfa
defw drop_cfa
defw semicolon_s_cfa
t_nfa:
defb 0x01+0x80,"T"+0x80
t_lfa:
defw m_nfa
t_cfa:
defw do_colon
t_pfa:
defw dup_cfa
defw c_slash_l_cfa
defw star_cfa
defw r_hash_cfa
defw store_cfa
defw dup_cfa
defw h_cfa
defw zero_cfa
defw m_cfa
defw semicolon_s_cfa
l_nfa:
defb 0x01+0x80,"L"+0x80
l_lfa:
defw t_nfa
l_cfa:
defw do_colon
l_pfa:
defw scr_cfa
defw fetch_cfa
defw list_cfa
defw zero_cfa
defw m_cfa
defw semicolon_s_cfa
editor_r_nfa:
defb 0x01+0x80,"R"+0x80
editor_r_lfa:
defw l_nfa
editor_r_cfa:
defw do_colon
editor_r_pfa:
defw pad_cfa
defw one_plus_cfa
defw swap_cfa
defw minus_move_cfa
defw semicolon_s_cfa
p_nfa:
defb 0x01+0x80,"P"+0x80
p_lfa:
defw editor_r_nfa
p_cfa:
defw do_colon
p_pfa:
defw one_cfa
defw text_cfa
defw editor_r_cfa
defw semicolon_s_cfa
editor_i_nfa:
defb 0x01+0x80,"I"+0x80
editor_i_lfa:
defw p_nfa
editor_i_cfa:
defw do_colon
editor_i_pfa:
defw dup_cfa
defw s_cfa
defw editor_r_cfa
defw semicolon_s_cfa
top_nfa:
defb 0x03+0x80,"TO","P"+0x80
top_lfa:
defw editor_i_nfa
top_cfa:
defw do_colon
top_pfa:
defw zero_cfa
defw r_hash_cfa
defw store_cfa
defw semicolon_s_cfa
clear_nfa:
defb 0x05+0x80,"CLEA","R"+0x80
clear_lfa:
defw top_nfa
clear_cfa:
defw do_colon
clear_pfa:
defw scr_cfa
defw store_cfa
defw lit_cfa,0x0010
defw zero_cfa
defw paren_do_cfa
branch_destination_0x796A:
defw i_cfa
defw e_cfa
defw paren_loop_cfa,0xFFFA ; to branch_destination_0x796A
defw semicolon_s_cfa
copy_nfa:
defb 0x04+0x80,"COP","Y"+0x80
copy_lfa:
defw clear_nfa
copy_cfa:
defw do_colon
copy_pfa:
defw b_slash_scr_cfa
defw star_cfa
defw offset_cfa
defw fetch_cfa
defw plus_cfa
defw swap_cfa
defw b_slash_scr_cfa
defw star_cfa
defw b_slash_scr_cfa
defw over_cfa
defw plus_cfa
defw swap_cfa
defw paren_do_cfa
branch_destination_0x7997:
defw dup_cfa
defw i_cfa
defw block_cfa
defw two_cfa
defw minus_sign_cfa
defw store_cfa
defw one_plus_cfa
defw update_cfa
defw paren_loop_cfa,0xFFEE ; to branch_destination_0x7997
defw drop_cfa
defw flush_cfa
defw semicolon_s_cfa
minus_text_nfa:
defb 0x05+0x80,"-TEX","T"+0x80
minus_text_lfa:
defw copy_nfa
minus_text_cfa:
defw do_colon
minus_text_pfa:
defw swap_cfa
defw minus_dup_cfa
defw zero_branch_cfa,0x002A ; to branch_destination_0x79EB
defw over_cfa
defw plus_cfa
defw swap_cfa
defw paren_do_cfa
branch_destination_0x79CB:
defw dup_cfa
defw c_fetch_cfa
defw i_cfa
defw c_fetch_cfa
defw minus_sign_cfa
defw zero_branch_cfa,0x000A ; to branch_destination_0x79E1
defw zero_equals_cfa
defw leave_cfa
defw branch_cfa,0x0004 ; to branch_destination_0x79E3
branch_destination_0x79E1:
defw one_plus_cfa
branch_destination_0x79E3:
defw paren_loop_cfa,0xFFE6 ; to branch_destination_0x79CB
defw branch_cfa,0x0006 ; to branch_destination_0x79EF
branch_destination_0x79EB:
defw drop_cfa
defw zero_equals_cfa
branch_destination_0x79EF:
defw semicolon_s_cfa
match_nfa:
defb 0x05+0x80,"MATC","H"+0x80
match_lfa:
defw minus_text_nfa
match_cfa:
defw do_colon
match_pfa:
defw to_r_cfa
defw to_r_cfa
defw two_dup_cfa
defw from_r_cfa
defw from_r_cfa
defw two_swap_cfa
defw over_cfa
defw plus_cfa
defw swap_cfa
defw paren_do_cfa
branch_destination_0x7A0F:
defw two_dup_cfa
defw i_cfa
defw minus_text_cfa
defw zero_branch_cfa,0x001A ; to branch_destination_0x7A31
defw to_r_cfa
defw two_drop_cfa
defw from_r_cfa
defw minus_sign_cfa
defw i_cfa
defw swap_cfa
defw minus_sign_cfa
defw zero_cfa
defw swap_cfa
defw zero_cfa
defw zero_cfa
defw leave_cfa
branch_destination_0x7A31:
defw paren_loop_cfa,0xFFDC ; to branch_destination_0x7A0F
defw two_drop_cfa
defw swap_cfa
defw zero_equals_cfa
defw swap_cfa
defw semicolon_s_cfa
oneline_nfa:
defb 0x05+0x80,"1LIN","E"+0x80
oneline_lfa:
defw match_nfa
oneline_cfa:
defw do_colon
oneline_pfa:
defw hash_lag_cfa
defw pad_cfa
defw count_cfa
defw match_cfa
defw r_hash_cfa
defw plus_store_cfa
defw semicolon_s_cfa
find_nfa:
defb 0x04+0x80,"FIN","D"+0x80
find_lfa:
defw oneline_nfa
find_cfa:
defw do_colon
branch_destination_0x7A60:
find_pfa:
defw lit_cfa,0x03FF
defw r_hash_cfa
defw fetch_cfa
defw less_than_cfa
defw zero_branch_cfa,0x0012 ; to branch_destination_0x7A7E
defw top_cfa
defw pad_cfa
defw here_cfa
defw c_slash_l_cfa
defw one_plus_cfa
defw cmove_cfa
defw zero_cfa
defw error_cfa
branch_destination_0x7A7E:
defw oneline_cfa
defw zero_branch_cfa,0xFFDE ; to branch_destination_0x7A60
defw semicolon_s_cfa
delete_nfa:
defb 0x06+0x80,"DELET","E"+0x80
delete_lfa:
defw find_nfa
delete_cfa:
defw do_colon
delete_pfa:
defw to_r_cfa
defw hash_lag_cfa
defw plus_cfa
defw r_cfa
defw minus_sign_cfa
defw hash_lag_cfa
defw r_cfa
defw minus_cfa
defw r_hash_cfa
defw plus_store_cfa
defw hash_lead_cfa
defw plus_cfa
defw swap_cfa
defw cmove_cfa
defw from_r_cfa
defw blanks_cfa
defw update_cfa
defw semicolon_s_cfa
n_nfa:
defb 0x01+0x80,"N"+0x80
n_lfa:
defw delete_nfa
n_cfa:
defw do_colon
n_pfa:
defw find_cfa
defw zero_cfa
defw m_cfa
defw semicolon_s_cfa
f_nfa:
defb 0x01+0x80,"F"+0x80
f_lfa:
defw n_nfa
f_cfa:
defw do_colon
f_pfa:
defw one_cfa
defw text_cfa
defw n_cfa
defw semicolon_s_cfa
b_nfa:
defb 0x01+0x80,"B"+0x80
b_lfa:
defw f_nfa
b_cfa:
defw do_colon
b_pfa:
defw pad_cfa
defw c_fetch_cfa
defw minus_cfa
defw m_cfa
defw semicolon_s_cfa
x_nfa:
defb 0x01+0x80,"X"+0x80
x_lfa:
defw b_nfa
x_cfa:
defw do_colon
x_pfa:
defw one_cfa
defw text_cfa
defw find_cfa
defw pad_cfa
defw c_fetch_cfa
defw delete_cfa
defw zero_cfa
defw m_cfa
defw semicolon_s_cfa
till_nfa:
defb 0x04+0x80,"TIL","L"+0x80
till_lfa:
defw x_nfa
till_cfa:
defw do_colon
till_pfa:
defw hash_lead_cfa
defw plus_cfa
defw one_cfa
defw text_cfa
defw oneline_cfa
defw zero_equals_cfa
defw zero_cfa
defw question_error_cfa
defw hash_lead_cfa
defw plus_cfa
defw swap_cfa
defw minus_sign_cfa
defw delete_cfa
defw zero_cfa
defw m_cfa
defw semicolon_s_cfa
c_nfa:
defb 0x01+0x80,"C"+0x80
c_lfa:
defw till_nfa
c_cfa:
defw do_colon
c_pfa:
defw one_cfa
defw text_cfa
defw pad_cfa
defw count_cfa
defw hash_lag_cfa
defw rot_cfa
defw over_cfa
defw min_cfa
defw to_r_cfa
defw r_cfa
defw r_hash_cfa
defw plus_store_cfa
defw r_cfa
defw minus_sign_cfa
defw to_r_cfa
defw dup_cfa
defw here_cfa
defw r_cfa
defw cmove_cfa
defw here_cfa
defw hash_lead_cfa
defw plus_cfa
defw from_r_cfa
defw cmove_cfa
defw from_r_cfa
defw cmove_cfa
defw update_cfa
defw zero_cfa
defw m_cfa
defw semicolon_s_cfa
next_nfa:
defb 0x04+0x80,"NEX","T"+0x80
next_lfa:
defw where_nfa
next_cfa:
defw do_constant
next_pfa:
defw next
pushhl_nfa:
defb 0x06+0x80,"PUSHH","L"+0x80
pushhl_lfa:
defw next_nfa
pushhl_cfa:
defw do_constant
pushhl_pfa:
defw pushhl
pushde_nfa:
defb 0x06+0x80,"PUSHD","E"+0x80
pushde_lfa:
defw pushhl_nfa
pushde_cfa:
defw do_constant
pushde_pfa:
defw pushde
inp_nfa:
defb 0x03+0x80,"IN","P"+0x80
inp_lfa:
defw pushde_nfa
inp_cfa:
defw inp_pfa
inp_pfa:
pop hl
push bc
ld c,l
ld b,h
in a,(c)
pop bc
ld h,0x00
ld l,a
; XXX FIXME -- Optimize: `jp pushhl`:
push hl
jp next
outp_nfa:
defb 0x04+0x80,"OUT","P"+0x80
outp_lfa:
defw inp_nfa
outp_cfa:
defw outp_pfa
outp_pfa:
pop hl
pop de
push bc
ld c,l
ld b,h
ld a,e
out (c),a
pop bc
jp next
screen_nfa:
defb 0x06+0x80,"SCREE","N"+0x80
screen_lfa:
defw outp_nfa
screen_cfa:
defw screen_pfa
screen_pfa:
pop hl
pop de
push bc
push ix
ld c,e
ld b,l
call rom_s_scrn_s_2538
call rom_stack_fetch
ld a,(de)
ld h,0x00
ld l,a
pop ix
pop bc
; XXX FIXME -- Optimize: `jp pushhl`:
push hl
jp next
at_nfa:
defb 0x02+0x80,"A","T"+0x80
at_lfa:
defw screen_nfa
at_cfa:
defw do_colon
at_pfa:
defw abs_cfa
defw dup_cfa
defw lit_cfa,0x001F
defw greater_than_cfa
defw zero_branch_cfa,0x0008 ; to branch_destination_0x7BF2
defw two_drop_cfa
defw branch_cfa,0x0022 ; to branch_destination_0x7C12
branch_destination_0x7BF2:
defw swap_cfa
defw abs_cfa
defw dup_cfa
defw lit_cfa,0x0015
defw greater_than_cfa
defw zero_branch_cfa,0x0008 ; to branch_destination_0x7C08
defw two_drop_cfa
defw branch_cfa,0x000C ; to branch_destination_0x7C12
branch_destination_0x7C08:
defw lit_cfa,0x0016
defw emit_cfa
defw emit_cfa
defw emit_cfa
branch_destination_0x7C12:
defw semicolon_s_cfa
border_nfa:
defb 0x06+0x80,"BORDE","R"+0x80
border_lfa:
defw at_nfa
border_cfa:
defw border_pfa
border_pfa:
pop hl
push bc
ld a,l
call rom_border_2297
pop bc
jp next
bleep_nfa:
defb 0x05+0x80,"BLEE","P"+0x80
bleep_lfa:
defw border_nfa
bleep_cfa:
defw bleep_pfa
bleep_pfa:
pop hl
pop de
push bc
push ix
call rom_beeper
pop ix
pop bc
jp next
paper_nfa:
defb 0x05+0x80,"PAPE","R"+0x80
paper_lfa:
defw bleep_nfa
paper_cfa:
defw do_colon
paper_pfa:
defw abs_cfa
defw dup_cfa
defw lit_cfa,0x0009
defw greater_than_cfa
defw zero_branch_cfa,0x0008 ; to branch_destination_0x7C5F
defw drop_cfa
defw branch_cfa,0x0088 ; to branch_destination_0x7CE5
branch_destination_0x7C5F:
defw dup_cfa
defw lit_cfa,0x0009
defw equals_cfa
defw zero_branch_cfa,0x001A ; to branch_destination_0x7C83
defw lit_cfa,sys_p_flag
defw c_fetch_cfa
defw lit_cfa,0x0080
defw or_cfa
defw lit_cfa,sys_p_flag
defw c_store_cfa
defw drop_cfa
defw branch_cfa,0x0064 ; to branch_destination_0x7CE5
branch_destination_0x7C83:
defw dup_cfa
defw lit_cfa,0x0008
defw equals_cfa
defw zero_branch_cfa,0x001A ; to branch_destination_0x7CA7
defw lit_cfa,sys_mask_p
defw c_fetch_cfa
defw lit_cfa,0x0038
defw or_cfa
defw lit_cfa,sys_mask_p
defw c_store_cfa
defw drop_cfa
defw branch_cfa,0x0040 ; to branch_destination_0x7CE5
branch_destination_0x7CA7:
defw lit_cfa,0x0008
defw star_cfa
defw lit_cfa,sys_attr_p
defw c_fetch_cfa
defw lit_cfa,0x00C7
defw and_cfa
defw or_cfa
defw lit_cfa,sys_attr_p
defw c_store_cfa
defw lit_cfa,sys_p_flag
defw c_fetch_cfa
defw lit_cfa,0x007F
defw and_cfa
defw lit_cfa,sys_p_flag
defw store_cfa
defw lit_cfa,sys_mask_p
defw c_fetch_cfa
defw lit_cfa,0x00C7
defw and_cfa
defw lit_cfa,sys_mask_p
defw store_cfa
branch_destination_0x7CE5:
defw semicolon_s_cfa
attr_nfa:
defb 0x04+0x80,"ATT","R"+0x80
attr_lfa:
defw paper_nfa
attr_cfa:
defw attr_pfa
attr_pfa:
pop hl
pop de
push bc
push ix
ld c,e
ld b,l
call rom_s_attr_s_2583
call rom_find_int1
ld h,0x00
ld l,a
pop ix
pop bc
; XXX FIXME -- Optimize: `jp pushhl`:
push hl
jp next
point_nfa:
defb 0x05+0x80,"POIN","T"+0x80
point_lfa:
defw attr_nfa
point_cfa:
defw point_pfa
point_pfa:
pop hl
pop de
push bc
push ix
ld c,e
ld b,l
ld a,l
cp 0xB0
jr c,l7d20h
ld a,0xAF
ld b,a
l7d20h:
call rom_point_sub_22ce
call rom_find_int1
ld h,0x00
ld l,a
pop ix
pop bc
; XXX FIXME -- Optimize: `jp pushhl`:
push hl
jp next
ink_nfa:
defb 0x03+0x80,"IN","K"+0x80
ink_lfa:
defw point_nfa
ink_cfa:
defw do_colon
ink_pfa:
defw abs_cfa
defw dup_cfa
defw lit_cfa,0x0009
defw greater_than_cfa
defw zero_branch_cfa,0x0008 ; to branch_destination_0x7D4C
defw drop_cfa
defw branch_cfa,0x0082 ; to branch_destination_0x7DCC
branch_destination_0x7D4C:
defw dup_cfa
defw lit_cfa,0x0009
defw equals_cfa
defw zero_branch_cfa,0x001A ; to branch_destination_0x7D70
defw lit_cfa,sys_p_flag
defw c_fetch_cfa
defw lit_cfa,0x0020
defw or_cfa
defw lit_cfa,sys_p_flag
defw c_store_cfa
defw drop_cfa
defw branch_cfa,0x005E ; to branch_destination_0x7DCC
branch_destination_0x7D70:
defw dup_cfa
defw lit_cfa,0x0008
defw equals_cfa
defw zero_branch_cfa,0x001A ; to branch_destination_0x7D94
defw lit_cfa,sys_mask_p
defw c_fetch_cfa
defw lit_cfa,0x0007
defw or_cfa
defw lit_cfa,sys_mask_p
defw c_store_cfa
defw drop_cfa
defw branch_cfa,0x003A ; to branch_destination_0x7DCC
branch_destination_0x7D94:
defw lit_cfa,sys_attr_p
defw c_fetch_cfa
defw lit_cfa,0x00F8
defw and_cfa
defw or_cfa
defw lit_cfa,sys_attr_p
defw c_store_cfa
defw lit_cfa,sys_p_flag
defw c_fetch_cfa
defw lit_cfa,0x00DF
defw and_cfa
defw lit_cfa,sys_p_flag
defw store_cfa
defw lit_cfa,sys_mask_p
defw c_fetch_cfa
defw lit_cfa,0x00F8
defw and_cfa
defw lit_cfa,sys_mask_p
defw store_cfa
branch_destination_0x7DCC:
defw semicolon_s_cfa
flash_nfa:
defb 0x05+0x80,"FLAS","H"+0x80
flash_lfa:
defw ink_nfa
flash_cfa:
defw do_colon
flash_pfa:
; XXX FIXME -- Only one store operation is needed, at the end,
; what saves 6 bytes without speed penalty.
defw zero_branch_cfa,0x0018 ; to branch_destination_0x7DF2
defw lit_cfa,sys_attr_p
defw c_fetch_cfa
defw lit_cfa,0x0080
defw or_cfa
defw lit_cfa,sys_attr_p
defw store_cfa
defw branch_cfa,0x0014 ; to branch_destination_0x7E04
branch_destination_0x7DF2:
defw lit_cfa,sys_attr_p
defw c_fetch_cfa
defw lit_cfa,0x007F
defw and_cfa
defw lit_cfa,sys_attr_p
defw store_cfa
branch_destination_0x7E04:
defw semicolon_s_cfa
bright_nfa:
defb 0x06+0x80,"BRIGH","T"+0x80
bright_lfa:
defw flash_nfa
bright_cfa:
defw do_colon
bright_pfa:
; XXX FIXME -- Only one store operation is needed, at the end,
; what saves 6 bytes without speed penalty.
defw zero_branch_cfa,0x0018 ; to branch_destination_0x7E2B
defw lit_cfa,sys_attr_p
defw c_fetch_cfa
defw lit_cfa,0x0040
defw or_cfa
defw lit_cfa,sys_attr_p
defw store_cfa
defw branch_cfa,0x0014 ; to branch_destination_0x7E3D
branch_destination_0x7E2B:
defw lit_cfa,sys_attr_p
defw c_fetch_cfa
defw lit_cfa,0x00BF
defw and_cfa
defw lit_cfa,sys_attr_p
defw store_cfa
branch_destination_0x7E3D:
defw semicolon_s_cfa
gover_nfa:
defb 0x05+0x80,"GOVE","R"+0x80
gover_lfa:
defw bright_nfa
gover_cfa:
defw do_colon
gover_pfa:
; XXX FIXME -- The final store operations should be `C!`, not `!`,
; else the next system variable, MEMBOT, is affected.
; XXX FIXME -- Only one store operation is needed, at the end,
; what saves 6 bytes without speed penalty.
defw zero_branch_cfa,0x0016 ; to branch_destination_0x7E61
defw lit_cfa,sys_p_flag
defw c_fetch_cfa
defw two_cfa
defw or_cfa
defw lit_cfa,sys_p_flag
defw store_cfa
defw branch_cfa,0x0014 ; to branch_destination_0x7E73
branch_destination_0x7E61:
defw lit_cfa,sys_p_flag
defw c_fetch_cfa
defw lit_cfa,0x00FD
defw and_cfa
defw lit_cfa,sys_p_flag
defw store_cfa
branch_destination_0x7E73:
defw semicolon_s_cfa
inverse_nfa:
defb 0x07+0x80,"INVERS","E"+0x80
inverse_lfa:
defw gover_nfa
inverse_cfa:
defw do_colon
inverse_pfa:
; XXX FIXME -- The final store operations should be `C!`, not `!`,
; else the next system variable, MEMBOT, is affected.
; XXX FIXME -- Only one store operation is needed, at the end,
; what saves 6 bytes without speed penalty.
defw zero_branch_cfa,0x0018 ; to branch_destination_0x7E9B
defw lit_cfa,sys_p_flag
defw c_fetch_cfa
defw lit_cfa,0x0008
defw or_cfa
defw lit_cfa,sys_p_flag
defw store_cfa
defw branch_cfa,0x0014 ; to branch_destination_0x7EAD
branch_destination_0x7E9B:
defw lit_cfa,sys_p_flag
defw c_fetch_cfa
defw lit_cfa,0x00F7
defw and_cfa
defw lit_cfa,sys_p_flag
defw store_cfa
branch_destination_0x7EAD:
defw semicolon_s_cfa
not_nfa:
defb 0x03+0x80,"NO","T"+0x80
not_lfa:
defw inverse_nfa
not_cfa:
defw do_colon
not_pfa:
defw zero_equals_cfa
defw semicolon_s_cfa
i_tick_nfa:
defb 0x02+0x80,"I","'"+0x80
i_tick_lfa:
defw not_nfa
i_tick_cfa:
defw i_tick_pfa
i_tick_pfa:
ld hl,(return_pointer_value)
inc hl
inc hl
ld e,(hl)
inc hl
ld d,(hl)
push de
jp next
j_nfa:
defb 0x01+0x80,"J"+0x80
j_lfa:
defw i_tick_nfa
j_cfa:
defw j_pfa
j_pfa:
ld hl,(return_pointer_value)
; XXX FIXME -- Optimize:
; `ld de,4 / add hl,de` is faster than four `inc hl`,
; and the same size.
inc hl
inc hl
inc hl
inc hl
ld e,(hl)
inc hl
ld d,(hl)
push de
jp next
two_constant_nfa:
defb 0x09+0x80,"2CONSTAN","T"+0x80
two_constant_lfa:
defw j_nfa
two_constant_cfa:
defw do_colon
two_constant_pfa:
defw create_cfa
defw smudge_cfa
defw here_cfa
defw two_store_cfa
defw lit_cfa,0x0004
defw allot_cfa
defw paren_semicolon_code_cfa
do_two_constant:
inc de
ex de,hl
inc hl
inc hl
ld e,(hl)
inc hl
ld d,(hl)
push de
dec hl
dec hl
ld d,(hl)
dec hl
ld e,(hl)
push de
jp next
two_variable_nfa:
defb 0x09+0x80,"2VARIABL","E"+0x80
two_variable_lfa:
defw two_constant_nfa
two_variable_cfa:
defw do_colon
two_variable_pfa:
defw two_constant_cfa
defw paren_semicolon_code_cfa
do_two_variable:
inc de
push de
jp next
u_dot_r_nfa:
defb 0x03+0x80,"U.","R"+0x80
u_dot_r_lfa:
defw two_variable_nfa
u_dot_r_cfa:
defw do_colon
u_dot_r_pfa:
defw to_r_cfa
defw zero_cfa
defw from_r_cfa
defw d_dot_r_cfa
defw semicolon_s_cfa
two_over_nfa:
defb 0x05+0x80,"2OVE","R"+0x80
two_over_lfa:
defw u_dot_r_nfa
two_over_cfa:
defw do_colon
two_over_pfa:
defw two_swap_cfa
defw two_dup_cfa
defw to_r_cfa
defw to_r_cfa
defw two_swap_cfa
defw from_r_cfa
defw from_r_cfa
defw semicolon_s_cfa
exit_nfa:
defb 0x04+0x80,"EXI","T"+0x80
exit_lfa:
defw two_over_nfa
exit_cfa:
defw do_colon
exit_pfa:
defw to_r_cfa ; XXX FIXME -- Serious bug: It should be `R>` (from_r_cfa),
; not `>R` (to_r_cfa).
defw drop_cfa
defw semicolon_s_cfa
defw semicolon_s_cfa ; XXX FIXME -- Unnecessary duplicated code.
plot_nfa:
defb 0x04+0x80,"PLO","T"+0x80
plot_lfa:
defw exit_nfa
plot_cfa:
defw plot_pfa
plot_pfa:
pop hl
pop de
push bc
push ix
ld c,e
ld b,l
ld a,h
or d
jr nz,l7f81h
ld a,l
cp 0xB0
jr nc,l7f81h
call rom_plot_22df
l7f81h:
pop ix
pop bc
jp next
x1_nfa:
defb 0x02+0x80,"X","1"+0x80
x1_lfa:
defw plot_nfa
x1_cfa:
defw do_two_variable
x1_pfa:
defw 0x0000
defw 0x0000
y1_nfa:
defb 0x02+0x80,"Y","1"+0x80
y1_lfa:
defw x1_nfa
y1_cfa:
defw do_two_variable
y1_pfa:
defw 0x0000
defw 0x0000
incx_nfa:
defb 0x04+0x80,"INC","X"+0x80
incx_lfa:
defw y1_nfa
incx_cfa:
defw do_two_variable
incx_pfa:
defw 0x0000
defw 0x0000
incy_nfa:
defb 0x04+0x80,"INC","Y"+0x80
incy_lfa:
defw incx_nfa
incy_cfa:
defw do_two_variable
incy_pfa:
defw 0x0000
defw 0x0000
draw_nfa:
defb 0x04+0x80,"DRA","W"+0x80
draw_lfa:
defw incy_nfa
draw_cfa:
defw do_colon
draw_pfa:
defw lit_cfa,sys_coordy
defw c_fetch_cfa
defw dup_cfa
defw zero_cfa
defw swap_cfa
defw y1_cfa
defw two_store_cfa
defw minus_sign_cfa
defw dup_cfa
defw abs_cfa
defw rot_cfa
defw lit_cfa,sys_coordx
defw c_fetch_cfa
defw dup_cfa
defw zero_cfa
defw swap_cfa
defw x1_cfa
defw two_store_cfa
defw minus_sign_cfa
defw dup_cfa
defw abs_cfa
defw rot_cfa
defw max_cfa
defw to_r_cfa
defw dup_cfa
defw zero_less_than_cfa
defw zero_branch_cfa,0x0012 ; to branch_destination_0x800C
defw abs_cfa
defw zero_cfa
defw swap_cfa
defw r_cfa
defw m_slash_mod_cfa
defw dminus_cfa
defw branch_cfa,0x000A ; to branch_destination_0x8014
branch_destination_0x800C:
defw zero_cfa
defw swap_cfa
defw r_cfa
defw m_slash_mod_cfa
branch_destination_0x8014:
defw incx_cfa
defw two_store_cfa
defw drop_cfa
defw dup_cfa
defw zero_less_than_cfa
defw zero_branch_cfa,0x0012 ; to branch_destination_0x8032
defw abs_cfa
defw zero_cfa
defw swap_cfa
defw r_cfa
defw m_slash_mod_cfa
defw dminus_cfa
defw branch_cfa,0x000A ; to branch_destination_0x803A
branch_destination_0x8032:
defw zero_cfa
defw swap_cfa
defw r_cfa
defw m_slash_mod_cfa
branch_destination_0x803A:
defw incy_cfa
defw two_store_cfa
defw drop_cfa
defw from_r_cfa
defw one_plus_cfa
defw zero_cfa
defw paren_do_cfa
branch_destination_0x8048:
defw x1_cfa
defw fetch_cfa
defw y1_cfa
defw fetch_cfa
defw plot_cfa
defw x1_cfa
defw two_fetch_cfa
defw incx_cfa
defw two_fetch_cfa
defw d_plus_cfa
defw x1_cfa
defw two_store_cfa
defw y1_cfa
defw two_fetch_cfa
defw incy_cfa
defw two_fetch_cfa
defw d_plus_cfa
defw y1_cfa
defw two_store_cfa
defw paren_loop_cfa,0xFFD8 ; to branch_destination_0x8048
defw semicolon_s_cfa
case_nfa:
defb 0x04+0x80+precedence_bit_mask,"CAS","E"+0x80
case_lfa:
defw draw_nfa
case_cfa:
defw do_colon
case_pfa:
defw question_comp_cfa
defw csp_cfa
defw fetch_cfa
defw store_csp_cfa
defw lit_cfa,0x0004
defw semicolon_s_cfa
of_nfa:
defb 0x02+0x80+precedence_bit_mask,"O","F"+0x80
of_lfa:
defw case_nfa
of_cfa:
defw do_colon
of_pfa:
defw lit_cfa,0x0004
defw question_pairs_cfa
defw compile_cfa
defw over_cfa
defw compile_cfa
defw equals_cfa
defw compile_cfa
defw zero_branch_cfa
defw here_cfa
defw zero_cfa
defw comma_cfa
defw compile_cfa
defw drop_cfa
defw lit_cfa,0x0005
defw semicolon_s_cfa
endof_nfa:
defb 0x05+0x80+precedence_bit_mask,"ENDO","F"+0x80
endof_lfa:
defw of_nfa
endof_cfa:
defw do_colon
endof_pfa:
defw lit_cfa,0x0005
defw question_pairs_cfa
defw compile_cfa
defw branch_cfa
defw here_cfa
defw zero_cfa
defw comma_cfa
defw swap_cfa
defw two_cfa
defw endif_cfa
defw lit_cfa,0x0004
defw semicolon_s_cfa
endcase_nfa:
defb 0x07+0x80+precedence_bit_mask,"ENDCAS","E"+0x80
endcase_lfa:
defw endof_nfa
endcase_cfa:
defw do_colon
endcase_pfa:
defw lit_cfa,0x0004
defw question_pairs_cfa
defw compile_cfa
defw drop_cfa
branch_destination_0x80F0:
defw sp_fetch_cfa
defw csp_cfa
defw fetch_cfa
defw equals_cfa
defw zero_equals_cfa
defw zero_branch_cfa,0x000A ; to branch_destination_0x8106
defw two_cfa
defw endif_cfa
defw branch_cfa,0xFFEC ; to branch_destination_0x80F0
branch_destination_0x8106:
defw csp_cfa
defw store_cfa
defw semicolon_s_cfa
inkey_nfa:
defb 0x05+0x80,"INKE","Y"+0x80
inkey_lfa:
defw endcase_nfa
inkey_cfa:
defw inkey_pfa
inkey_pfa:
push bc
call rom_key_scan
ld c,0x00 ; XXX FIXME -- useless instruction
jr nz,l8128h
call rom_key_test
jr nc,l8128h
dec d
ld e,a
call rom_key_decode
l8128h:
ld l,a
ld h,0x00
pop bc
jp pushhl
init_disc_nfa:
defb 0x09+0x80,"INIT-DIS","C"+0x80
init_disc_lfa:
defw inkey_nfa
init_disc_cfa:
defw do_colon
init_disc_pfa:
defw lit_cfa,ram_disc_bottom
defw lit_cfa,0x2BFF ; XXX FIXME -- It should be 0x2C00.
defw blanks_cfa
defw semicolon_s_cfa
udg_nfa:
defb 0x03+0x80,"UD","G"+0x80
udg_lfa:
defw init_disc_nfa
udg_cfa:
defw do_colon
udg_pfa:
defw lit_cfa,sys_udg
defw fetch_cfa
defw semicolon_s_cfa
dictionary_pointer_after_cold:
end cold_entry