/
MAIN.asm
1330 lines (1215 loc) · 29.6 KB
/
MAIN.asm
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
; *************************************************************************
;
; Mindy Minimal Interpreter for the z80
;
; John Hardy with additional code by Ken Boak and Craig Jones.
;
; GNU GENERAL PUBLIC LICENSE Version 3, 29 June 2007
;
; see the LICENSE file in this repo for more information
;
; *****************************************************************************
FALSE EQU 0
TRUE EQU -1
UNLIMITED EQU -2 ; for endless loops
CTRL_C equ 3 ; end of text
CTRL_E equ 5 ; edit
CTRL_H equ 8 ; backspace
CTRL_J equ 10 ; re-edit
CTRL_P equ 16 ; print stack
BSLASH equ $5c
.macro LITDAT,len
db len
.endm
.macro REPDAT,len,data ; compress the command tables
db (len | $80)
db data
.endm
.macro ENDDAT
db 0
.endm
; **************************************************************************
; Page 0 Initialisation
; **************************************************************************
.ORG ROMSTART + $180 ; 0+180 put Mindy code from here
; **************************************************************************
; Macros must be written in Mindy and end with ;
; this code must not span pages
; **************************************************************************
macros:
reedit_:
db "/z/UE;" ; remembers last line edited
edit_:
.cstr "`?`/K/UP/UE;"
printStack_:
.cstr "`=> `/s2-/UD1-(#0@,2-)\\/N/UP;"
iOpcodes:
LITDAT 15
db lsb(bang_) ; !
db lsb(dquote_) ; "
db lsb(hash_) ; #
db lsb(dollar_) ; $
db lsb(percent_) ; %
db lsb(amper_) ; &
db lsb(quote_) ; '
db lsb(lparen_) ; (
db lsb(rparen_) ; )
db lsb(star_) ; *
db lsb(plus_) ; +
db lsb(comma_) ; ,
db lsb(minus_) ; -
db lsb(dot_) ; .
db lsb(slash_) ; / ;/MOD
REPDAT 10, lsb(num_) ; 10 x repeat lsb of add to the num routine
LITDAT 7
db lsb(colon_) ; :
db lsb(semi_) ; ;
db lsb(lt_) ; <
db lsb(eq_) ; =
db lsb(gt_) ; >
db lsb(question_) ; ? ( -- val ) read a char from input
db lsb(at_) ; @
REPDAT 26, lsb(call_) ; call a command A, B ....z
LITDAT 6
db lsb(lbrack_) ; [
db lsb(bslash_) ; \
db lsb(rbrack_) ; ]
db lsb(caret_) ; ^
db lsb(underscore_) ; _
db lsb(grave_) ; ` ; for printing `hello`
REPDAT 26, lsb(var_) ; a b c .....z
LITDAT 4
db lsb(lbrace_) ; {
db lsb(pipe_) ; |
db lsb(rbrace_) ; }
db lsb(tilde_) ; ~ ( a b c -- b c a ) rotate
iAltcodes:
LITDAT 24
db lsb(aNop_) ;A
db lsb(bmode_) ;B toggle byte mode
db lsb(aNop_) ;C
db lsb(aNop_) ;D
db lsb(emit_) ;E emit a char
db lsb(aNop_) ;F false
db lsb(go_) ;G execute Mindy code
db lsb(aNop_) ;H toggle hex mode
db lsb(inPort_) ;I input from port
db lsb(aNop_) ;J loop variable
db lsb(key_) ;K input char
db lsb(shl_) ;L
db lsb(aNop_) ;M
db lsb(newln_) ;N prints a newline to output
db lsb(outPort_) ;O output to port
db lsb(aNop_) ;P print Mindy prompt
db lsb(aNop_) ;Q
db lsb(shr_) ;R
db lsb(arrSize_) ;S array size
db lsb(aNop_) ;T true
db lsb(utility_) ;U
db lsb(aNop_) ;V
db lsb(while_) ;W word mode
db lsb(exec_) ;X execute machine code
REPDAT 3, lsb(aNop_)
;Y
;Z
ENDDAT
backSpace:
ld a,c
or b
jr z, interpret2
dec bc
call printStr
.cstr "\b \b"
jr interpret2
start:
ld SP,DSTACK ; start of Mindy
call init ; setups
call printStr ; prog count to stack, put code line 235 on stack then call print
.cstr "Mindy 0.1\r\n"
interpret:
call prompt
ld bc,0 ; load bc with offset into TIb, decide char into tib or execute or control
ld (vTIBPtr),bc
interpret2: ; calc nesting (a macro might have changed it)
ld e,0 ; initilize nesting value
push bc ; save offset into TIb,
; bc is also the count of chars in TIB
ld hl,TIB ; hl is start of TIB
jr interpret4
interpret3:
ld a,(hl) ; A = char in TIB
inc hl ; inc pointer into TIB
dec bc ; dec count of chars in TIB
call nesting ; update nesting value
interpret4:
ld a,c ; is count zero?
or B
jr nz, interpret3 ; if not loop
pop bc ; restore offset into TIB
waitchar:
call getchar ; loop around waiting for character from serial port
cp $20 ; compare to space
jr nc,waitchar1 ; if >= space, if below 20 set cary flag
cp $0 ; is it end of string? null end of string
jr z,waitchar4
cp '\r' ; carriage return? ascii 13
jr z,waitchar3 ; if anything else its macro/control
cp CTRL_H
jr z,backSpace
ld d,msb(macros)
cp CTRL_E
ld e,lsb(edit_)
jr z,macro
cp CTRL_J
ld e,lsb(reedit_)
jr z,macro
cp CTRL_P
ld e,lsb(printStack_)
jr z,macro
jr interpret2
macro:
ld (vTIBPtr),bc
push de
call ENTER ;Mindy go operation and jump to it
.cstr "/G"
ld bc,(vTIBPtr)
jr interpret2
waitchar1:
ld hl,TIB
add hl,bc
ld (hl),A ; store the character in textbuf
inc bc
call putchar ; echo character to screen
call nesting
jr waitchar ; wait for next character
waitchar3:
ld hl,TIB
add hl,bc
ld (hl),"\r" ; store the crlf in textbuf
inc hl
ld (hl),"\n"
inc hl ; ????
inc bc
inc bc
call crlf ; echo character to screen
ld a,E ; if zero nesting append and ETX after \r
or A
jr nz,waitchar
ld (hl),$03 ; store end of text ETX in text buffer
inc bc
waitchar4:
ld (vTIBPtr),bc
ld bc,TIB ; Instructions stored on heap at address HERe, we pressed enter
dec bc
next: ;
inc bc ; Increment the IP
ld a, (bc) ; Get the next character and dispatch
or a ; is it NUL?
jr z,exit
cp cTRL_c
jr z,etx
sub "!"
jr c,NexT
ld L,A ; Index into table
ld H,msb(opcodes) ; Start address of jump table
ld L,(hl) ; get low jump address
ld H,msb(page4) ; Load H with the 1st page address
jp (hl) ; Jump to routine
exit:
inc bc ; store offests into a table of bytes, smaller
ld de,bc
call rpop ; Restore Instruction pointer
ld bc,hl
ex de,hl
jp (hl)
etx:
ld hl,-DSTACK ; check if stack pointer is underwater
add hl,SP
jr nc,etx1
ld SP,DSTACK
etx1:
jp interpret
init:
ld ix,RSTACK
ld iy,NexT ; iy provides a faster jump to NexT
ld hl,altVars ; init altVars to 0
ld b,26 * 2
init1:
ld (hl),0
inc hl
djnz init1
ld hl,TRUE ; hl = TRUE
ld (vTrue),hl
dec hl ; hl = Unlimited
ld (vUnlimited),hl
ld hl,DSTACK
ld (vS0),hl
ld hl,65
ld (vLastDef),hl
ld hl,hEAP
ld (vHeapPtr),hl
ld hl,VARS ; init namespaces to 0 using LDIR
ld de,hl
inc de
ld (hl),0
ld bc,VARS_SIZE
LDIR
initOps:
ld hl, iOpcodes
ld de, opcodes
ld bc, 256
initOps1:
ld a,(hl)
inc hl
SLA A
ret z
jr c, initOps2
SRL A
ld c,A
ld b,0
LDIR
jr initOps1
initOps2:
SRL A
ld b,A
ld a,(hl)
inc hl
initOps2a:
ld (de),A
inc de
DJnz initOps2a
jr initOps1
lookup:
sub "A"
jr lookup2
lookup1:
sub "a" - 26
lookup2:
add A,A
ld hl,VARS
add A,l
ld l,a
ld a,0
adc a,h
ld h,a
xor a
or E ; sets z flag if A-z
ret
printhex:
; Display hl as a 16-bit number in hex.
push bc ; preserve the IP
ld a,h
call printhex2
ld a,l
call printhex2
pop bc
ret
printhex2:
ld c,A
RRA
RRA
RRA
RRA
call printhex3
ld a,c
printhex3:
and 0x0F
add A,0x90
DAA
ADc A,0x40
DAA
jp putchar
editDef: ; lookup up def based on number
pop hl ; pop ret address
; ex (SP),hl ; swap with TOS
ld a,l
ex AF,AF'
ld a,l
call lookup
ld e,(hl)
inc hl
ld d,(hl)
ld a,D
or E
ld hl,TIB
jr z,editDef3
ld a,":"
call writechar
ex AF,AF'
call writechar
jr editDef2
editDef1:
inc de
editDef2:
ld a,(de)
call writechar
cp ";"
jr nz,editDef1
editDef3:
ld de,TIB
or A
sbc hl,de
ld (vTIBPtr),hl
jp (iy)
; **************************************************************************
; calculate nesting value
; A is char to be tested,
; E is the nesting value (initially 0)
; E is increased by ( and [
; E is decreased by ) and ]
; E has its bit 7 toggled by `
; limited to 127 levels
; **************************************************************************
nesting:
cp '`'
jr nz,nesting1
ld a,$80
xor e
ld e,a
ret
nesting1:
cp ':'
jr z,nesting2
cp '['
jr z,nesting2
cp '{'
jr z,nesting2
cp '('
jr nz,nesting3
nesting2:
inc E
ret
nesting3:
cp ';'
jr z,nesting4
cp ']'
jr z,nesting4
cp '}'
jr z,nesting4
cp ')'
ret nz
nesting4:
dec E
ret
prompt:
call printStr
.cstr "\r\n> "
ret
crlf:
call printStr
.cstr "\r\n"
ret
printStr:
ex (SP),hl ; swap
call putStr
inc hl ; inc past null
ex (SP),hl ; put it back
ret
putStr0:
call putchar
inc hl
putStr:
ld a,(hl)
or A
jr nz,putStr0
ret
rpush:
dec ix
ld (ix+0),h
dec ix
ld (ix+0),l
ret
rpop:
ld L,(ix+0)
inc ix
ld H,(ix+0)
inc ix
rpop2:
ret
writechar:
ld (hl),A
inc hl
jp putchar
enter:
ld hl,bc
call rpush ; save Instruction Pointer
pop bc
dec bc
jp (iy)
; **********************************************************************
; Page 4 primitive routines
; **********************************************************************
.align $100
page4:
dquote_:
question_:
lbrace_:
rbrace_:
underscore_:
jp (iy)
amper_:
and_:
pop de ; bitwise and the top 2 elements of the stack
pop hl ;
ld A,E ;
and L ;
ld L,A ;
ld A,D ;
and H ;
and1:
ld H,A ;
push hl ;
jp (iy) ;
pipe_:
or_:
pop de ; bitwise or the top 2 elements of the stack
pop hl
ld A,E
or L
ld L,A
ld A,D
or H
jr and1
caret_:
xor_:
pop de ; bitwise xor the top 2 elements of the stack
pop hl
ld A,E
xor L
ld L,A
ld A,D
xor H
jr and1
plus_: ; add the top 2 members of the stack
add_:
pop de
pop hl
add hl,de
push hl
jp carry
call_:
ld a,(bc)
call lookup
ld e,(hl)
inc hl
ld d,(hl)
jp go1
dot_:
pop hl
call printDec
dot2:
ld a,' '
call putchar
jp (iy)
comma_: ; print hexadecimal
hdot_:
pop hl
call printhex
jr dot2
bslash_:
drop_:
pop hl
jp (iy)
hash_:
dup_:
pop hl ; Duplicate the top member of the stack
push hl
push hl
jp (iy)
; $ swap ; a b -- b a Swap the top 2 elements of the stack
dollar_:
swap_:
pop hl
ex (SP),hl
push hl
jp (iy)
percent_:
over_:
pop hl ; Duplicate 2nd element of the stack
pop de
push de
push hl
push de ; and push it to top of stack
jp (iy)
semi_:
ret_:
call rpop ; Restore Instruction pointer
ld bc,hl
jp (iy)
tilde_:
not:
pop hl
ld a,l
cpl
ld l,a
ld a,h
cpl
ld h,a
push hl
jp (iy)
bang_: ; Store the value at the address placed on the top of the stack
store_:
assign:
pop de ; discard last accessed value
pop de ; de = new value
assign0:
ld hl,(vPointer) ; hl = pointer
assign1:
ld (hl),e ; ignore byte mode to allow assigning to vByteMode
inc hl
ld (hl),d
jp (iy)
minus_: ; Subtract the value 2nd on stack from top of stack
sub_:
inc bc ; check if sign of a number
ld a,(bc)
dec bc
cp "0"
jr c,sub1
cp "9"+1
jp c,num
sub1:
pop de ;
pop hl ; Entry point for INVert
sub2:
and A ; Entry point for NEGate
sbc hl,de ;
push hl ;
jp carry
; 5
eq_:
pop hl
pop de
or a ; reset the carry flag
sbc hl,de ; only equality sets hl=0 here
jr z,true_
false_:
ld hl,FALSE
push hl
jp (iy)
true_:
ld hl,TRUE
push hl
jp (iy)
gt_:
pop hl
pop de
jr lt1_
lt_:
pop de
pop hl
lt1_:
or a ; reset the carry flag
sbc hl,de ; only equality sets hl=0 here
jr c,true_
jr false_
var_:
ld a,(bc)
call lookup1
var1:
ld (vPointer),hl
ld d,0
ld e,(hl)
ld a,(vByteMode)
inc a ; is it byte?
jr z,var2
inc hl
ld d,(hl)
var2:
push de
jp (iy)
grave_:
str:
inc bc
str1:
ld a, (bc)
inc bc
cp "`" ; ` is the string terminator
jr z,str2
call putchar
jr str1
str2:
dec bc
jp (iy)
lbrack_:
arrDef:
ld hl,0
add hl,sp ; save
call rpush
jp (iy)
at_:
arrAccess:
pop hl ; hl = index
pop de ; de = array
ld a,(vByteMode) ; a = data width
inc a
jr z,arrAccess1
arrAccess0:
add hl,hl ; if data width = 2 then double
arrAccess1:
add hl,de ; add addr
jp var1
lparen_:
jp begin
rparen_:
jp again
num_:
jp num
colon_:
jp def
rbrack_:
jp arrEnd
quote_: ; Discard the top member of the stack
jr hex
star_:
jr mul
slash_:
; jr div
;*******************************************************************
; Page 5 primitive routines
;*******************************************************************
;falls through
slash:
inc bc
ld a,(bc)
cp "/"
jp z,comment
cp "a"
jr c,alt1
cp "z"+1
jr nc,alt2
cp "i"
ld l,0
jp z,loopVar
cp "j"
ld l,8
jp z,loopVar
sub "a"
add A,A
ld hl,altVars
add a,l
ld l,a
jp var1
alt1:
cp "A"
jr c,alt2
cp "Z"+1
jr nc,alt2
ld hl,altcodes
sub "A"
add a,l
ld l,a
ld a,(hl) ; get low jump address
ld h,msb(page6)
ld L,A
jp (hl) ; Jump to routine
alt2:
dec bc
jr div
hex:
ld hl,0 ; clear hl to accept the number
hex1:
inc bc
ld a,(bc) ; Get the character which is a numeral
bit 6,A ; is it uppercase alpha?
jr z, hex2 ; no a decimal
SUB 7 ; sub 7 to make $A - $F
hex2:
SUB $30 ; Form decimal digit
jp c,num2
cp $0F+1
jp nc,num2
add hl,hl ; 2X ; Multiply digit(s) in hl by 16
add hl,hl ; 4X
add hl,hl ; 8X
add hl,hl ; 16X
add A,l ; add into bottom of hl
ld L,A
jr hex1
mul:
pop de ; de = 2nd factor
pop hl
push bc ; Preserve the IP
ld b,h ; bc = 2nd value
ld c,l
ld hl,0
ld A,16
mul2:
add hl,hl
rl e
rl d
jr nc,$+6
add hl,bc
jr nc,$+3
inc de
dec A
jr nz,mul2
pop bc ; Restore the IP
push hl ; Put the product on the stack - stack bug fixed 2/12/21
ld (vRemain),de
jp (iy)
div:
ld hl,bc ; hl = IP
pop bc ; bc = denominator
ex (sp),hl ; save IP, hl = numerator
ld a,h
xor b
push af
xor b
jp p,absbc
;abshl
xor a
sub l
ld l,a
sbc a,a
sub h
ld h,a
absbc:
xor b
jp p,$+9
xor a
sub c
ld c,a
sbc a,a
sub b
ld b,a
add hl,hl
ld a,15
ld de,0
ex de,hl
jr jumpin
Loop1:
add hl,bc ;--
Loop2:
dec a ;4
jr z,EndSDiv ;12|7
jumpin:
sla e ;8
rl d ;8
adc hl,hl ;15
sbc hl,bc ;15
jr c,loop1 ;23-2b
inc e ;--
jr Loop2 ;--
EndSDiv:
pop af
jp p,div10
xor a
sub e
ld e,a
sbc a,a
sub d
ld d,a
div10:
pop bc
push de ; quotient
ld (vRemain),hl ; remainder
jp (iy)
arrEnd:
ld (vTemp1),bc ; save IP
call rpop
ld (vTemp2),hl ; save old SP
ld de,hl ; de = hl = old SP
or a
sbc hl,sp ; hl = array count (items on stack)
srl h ; num items = num bytes / 2
rr l
ld bc,hl ; bc = count
ld hl,(vHeapPtr) ; hl = array[-4]
ld (hl),c ; write num items in length word
inc hl
ld (hl),b
inc hl ; hl = array[0], bc = count
; de = old SP, hl = array[0], bc = count
jr arrayEnd2
arrayEnd1:
dec bc ; dec items count
dec de
dec de
ld a,(de) ; a = lsb of stack item
ld (hl),a ; write lsb of array item
inc hl ; move to msb of array item
ld a,(vByteMode) ; vByteMode=1?
inc a
jr z,arrayEnd2
inc de
ld a,(de) ; a = msb of stack item
dec de
ld (hl),a ; write msb of array item
inc hl ; move to next word in array
arrayEnd2:
ld a,c ; if not zero loop
or b
jr nz,arrayEnd1
ex de,hl ; de = end of array
ld hl,(vTemp2)
ld sp,hl ; SP = old SP
ld hl,(vHeapPtr) ; de = array[-2]
inc hl
inc hl
push hl ; return array[0]
ld (vHeapPtr),de ; move heap* to end of array
ld bc,(vTemp1) ; restore IP
jp (iy)
; **************************************************************************
; Page 6 Alt primitives
; **************************************************************************
.align $100
page6:
arrSize_:
arrSize:
pop hl
dec hl ; msb size
ld d,(hl)
dec hl ; lsb size
ld e,(hl)
push de
anop_:
jp (iy)
bmode_:
ld a,(vByteMode)
cpl
ld (vByteMode),a
ld (vByteMode+1),a
jp (iy)
emit_:
pop hl
ld a,l
call putchar
jp (iy)
exec_:
call exec1
jp (iy)
exec1:
pop hl
ex (SP),hl
jp (hl)
key_:
call getchar
ld H,0
ld L,A
push hl
jp (iy)
go_: ;\^
pop de
go1:
ld a,D ; skip if destination address is null
or E
jr z,go3
ld hl,bc
inc bc ; read next char from source
ld a,(bc) ; if ; to tail call optimise
cp ";" ; by jumping to rather than calling destination
jr z,go2
call rpush ; save Instruction Pointer