-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathabersoft_forth.disassembled.z80s
5901 lines (5562 loc) · 99.4 KB
/
abersoft_forth.disassembled.z80s
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
800
801
802
803
804
805
806
807
808
809
810
811
812
813
814
815
816
817
818
819
820
821
822
823
824
825
826
827
828
829
830
831
832
833
834
835
836
837
838
839
840
841
842
843
844
845
846
847
848
849
850
851
852
853
854
855
856
857
858
859
860
861
862
863
864
865
866
867
868
869
870
871
872
873
874
875
876
877
878
879
880
881
882
883
884
885
886
887
888
889
890
891
892
893
894
895
896
897
898
899
900
901
902
903
904
905
906
907
908
909
910
911
912
913
914
915
916
917
918
919
920
921
922
923
924
925
926
927
928
929
930
931
932
933
934
935
936
937
938
939
940
941
942
943
944
945
946
947
948
949
950
951
952
953
954
955
956
957
958
959
960
961
962
963
964
965
966
967
968
969
970
971
972
973
974
975
976
977
978
979
980
981
982
983
984
985
986
987
988
989
990
991
992
993
994
995
996
997
998
999
1000
; 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 hl,-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: