forked from redcode/SpecEmu
-
Notifications
You must be signed in to change notification settings - Fork 0
/
z80assembler.asm
1366 lines (1105 loc) · 53.4 KB
/
z80assembler.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
z80_assemble PROTO :DWORD
z80_getobjectlength PROTO
z80_storeasmbytes PROTO :DWORD,:DWORD
z80_storeasmbyte PROTO :BYTE
z80_storeasmwords PROTO :DWORD,:DWORD
z80_storeasmword PROTO :WORD
z80_fillasmbytes PROTO :DWORD,:BYTE
include z80opcodes.asm
include z80cbopcodes.asm
include z80edopcodes.asm
include z80assembler.inc
.data?
z80_lpDest DWORD ?
z80_lpOriginalDest DWORD ?
.data
.code
; decode arg types
RESETENUM
ENUM z80type_unknown
ENUM z80type_8bitregister, z80type_16bitregister
ENUM z80type_immediate, z80type_bracketimmediate
ENUM z80type_bcdehl_mem, z80type_index_mem, z80type_IR
ENUM z80type_quoted
z80m_decodearg macro arg:req
argtype = z80type_unknown
argstr textequ <>
argitem = 0
argval = 0
argixiy = 0
argconstreg textequ <>
if @ITEMINLIST (arg, <ax,bx,cx,dx,si,di>) ne 0
argtype = z80type_immediate
argstr textequ <arg>
argconstreg textequ <arg>
exitm
endif
if @ITEMINLIST (arg, <al,bl,cl,dl,ah,bh,ch,dh>) ne 0
argtype = z80type_immediate
argstr textequ <arg>
argconstreg textequ <arg>
exitm
endif
if @ITEMINLIST (arg, <b,c,d,e,h,l,a,ixl,ixh,iyl,iyh>) ne 0
; simple 8 bit register
argtype = z80type_8bitregister
argstr textequ <arg>
exitm
endif
if @ITEMINLIST (arg, <bc,de,hl,af,ix,iy,sp>) ne 0
; simple 16 bit register
argtype = z80type_16bitregister
argstr textequ <arg>
exitm
endif
; test for 8 bit load/store to 16 bit register address
argitem = @ITEMINLIST (arg, <(bc),(de),(hl)>)
if argitem ne 0
argtype = z80type_bcdehl_mem
argstr textequ <arg>
argitem = argitem - 1 ; argitem = 0 for (bc), 1 for (de), 2 for (hl)
exitm
endif
; test for "(ix" or "(iy" indexing
if @SizeStr (arg) ge 6 ; (ix+n)
tmparg substr <arg>, 1, 3
tmparg catstr tmparg, <)>
indxmem = @ITEMINLIST (tmparg, <(ix),(iy>))
if indxmem ne 0
if indxmem eq 1
argixiy = 0ddh
else
argixiy = 0fdh
endif
tmpchr substr <arg>, 4, 1 ; = "+" or "-"
tsize sizestr <arg>
tmparg substr <arg>, 5, tsize -5 ; remainder of string from pos 5, beyond "(ix+"
argtype = z80type_index_mem
argval = z80m_get8bit(%tmparg)
ifidn tmpchr, <->
argval = -argval
endif
exitm
endif
endif
; test for I, R argument
argitem = @ITEMINLIST (arg, <I,R>)
if argitem ne 0
argtype = z80type_IR
argstr textequ <arg>
argitem = argitem - 1 ; argitem = 0 for I, 1 for R
exitm
endif
; test for "(immediate)" as in 16 bit register load/store from memory
tsize sizestr <arg>
tmpchr substr <arg>, 1, 1
ifidn tmpchr, <(>
tmpchr substr <arg>, tsize, 1
ifidn tmpchr, <)>
argtype = z80type_bracketimmediate
argstr substr <arg>, 2, tsize-2 ; unbracket immediate value
; test to see if immediate value is an x86 reg const
if @ITEMINLIST (argstr, <ax,bx,cx,dx,si,di,al,bl,cl,dl,ah,bh,ch,dh>) ne 0
argconstreg textequ <argstr>
else
argval = z80m_get16bit(%argstr)
endif
exitm
endif
endif
; test for quoted string
tsize sizestr <arg>
tmpchr substr <arg>, 1, 1
ifidn tmpchr, <">
tmpchr substr <arg>, tsize, 1
ifidn tmpchr, <">
argtype = z80type_quoted
argstr textequ <arg> ; we don't strip quotes from quoted text
exitm
endif
endif
; fall back to immediate argument
argtype = z80type_immediate
argstr textequ <arg>
argval = z80m_get16bit(arg)
endm
z80m_decode_dest_src macro arg1:req, arg2:req
z80m_decodearg arg1
arg1type = argtype
arg1str textequ <argstr>
arg1item = argitem
arg1val = argval
arg1ixiy = argixiy
arg1constreg textequ <argconstreg>
z80m_decodearg arg2
arg2type = argtype
arg2str textequ <argstr>
arg2item = argitem
arg2val = argval
arg2ixiy = argixiy
arg2constreg textequ <argconstreg>
endm
; ********************* support macros *********************
z80_ds macro count:req, val:=<0>
local cnt, cnttxt
cnt = z80m_get16bit (count)
; cnttxt textequ %cnt
; if emitz80
; %echo DS Count: cnttxt
; endif
if cnt lt 0
.err <*** DS Count < 0 ***>
exitm
endif
if cnt gt 0
z80_PC = z80_PC + cnt
if emitz80
invoke z80_fillasmbytes, cnt, val
endif
endif
endm
z80_db macro arg8:VARARG
local @db8
.data
@db8 db arg8
.code
t_tmp = sizeof @db8
if t_tmp gt 0
if emitz80
invoke z80_storeasmbytes, addr @db8, t_tmp
endif
z80_PC = z80_PC + t_tmp
endif
endm
z80_dw macro arg16:VARARG
local @db16
.data
@db16 dw arg16
.code
t_tmp = sizeof @db16/2
if t_tmp gt 0
if emitz80
invoke z80_storeasmwords, addr @db16, t_tmp
endif
z80_PC = z80_PC + (t_tmp * 2)
endif
endm
z80_defb macro args:vararg
for @param, <args>
z80_label @param
z80m_storebyte 0
z80_PC = z80_PC + 1
endm
endm
z80_defw macro args:vararg
for @param, <args>
z80_label @param
z80m_storeword 0
z80_PC = z80_PC + 2
endm
endm
z80_setloop macro loopreps:REQ
z80HighLoopLab textequ %(z80HighLoopLab + 1)
z80LoopLab textequ <z80HighLoopLab>
z80 push hl
z80 ld hl,loopreps
%z80 z80loop&z80LoopLab&:
z80 ex (sp),hl
endm
z80_endloop macro
z80 ex (sp),hl
z80 dec l
z80 jp nz,z80loop&z80LoopLab&
z80 dec h
z80 jp p,z80loop&z80LoopLab&
%z80 z80extloop&z80LoopLab&:
z80 inc sp
z80 inc sp
z80LoopLab textequ %(z80LoopLab - 1)
endm
z80_breakloop macro
z80 jp z80extloop&z80LoopLab&
endm
z80_label macro newlab:req
local intname, labaddr, labelname
intname textequ <newlab>
%ifidn <intname>, <@@>
ifndef localsym_curr
localsym_curr = 0
endif
localsym_curr = localsym_curr + 1
intname textequ %localsym_curr
intname catstr <localsym>, %intname
endif
%labelname catstr <z80lab_>, <intname>
%labelname = z80_PC
labaddr textequ %z80_PC
; list label names on final pass
if emitz80
; %echo Label: labelname labaddr
endif
endm
z80m_get16bit macro z80arg16:req
local locallab, temp
if pass ge 2
ifidni <z80arg16>, <@F>
temp textequ %(localsym_curr + 1)
%locallab catstr <z80lab_>, <localsym>, <temp>
exitm %locallab
elseifidni <z80arg16>, <@B>
temp textequ %localsym_curr
%locallab catstr <z80lab_>, <localsym>, <temp>
exitm %locallab
endif
ifdef z80lab_&z80arg16&
exitm %z80lab_&z80arg16&
else
temp catstr <0+>, <z80arg16>
exitm %temp and 65535
endif
else
exitm %0
endif
endm
z80m_get8bit macro z80arg8:req
local temp
temp = z80m_get16bit (z80arg8)
exitm %temp and 255
endm
z80m_getrelativedisp macro z80arg8:req
local target, disp, txt1, txt2
if emitz80
target = z80m_get16bit (z80arg8)
if target lt z80_PC
disp = (target - z80_PC) and 255
if disp lt 80h
.err <*** Backwards relative displacement out of range ***>
exitm %0
endif
else
disp = target - z80_PC
if disp gt 7Fh
.err <*** Forwards relative displacement out of range ***>
exitm %0
endif
endif
exitm %disp
else
exitm %0
endif
endm
z80_org macro z80org:req
z80_PC = z80org
endm
z80_crt macro z80crt:VARARG
local string
t_count = argcount (z80crt)
if t_count eq 0
exitm
endif
for @param, <z80crt>
%z80m_decodearg @param
if argtype eq z80type_immediate
z80 ld a,%argval
z80 rst 16
elseif argtype eq z80type_8bitregister
z80_crt8 %argstr
elseif argtype eq z80type_16bitregister
z80_crt16 %argstr
elseif argtype eq z80type_quoted
string textequ <argstr>
string substr string, 2, tsize-2 ; unquote the quoted string
%tsize sizestr <string>
if tsize le 4
%forc $char, <string>
if emitz80
mov al,"&$char&"
endif
z80 ld a,al
z80 rst 16
endm
else
z80_crtquoted %argstr
endif
endif
endm
endm
z80_crtquoted macro z80quoted:req
if _z80includecrt_ eq 0
_z80includecrt_ = 1
z80 jr _z80crtskip_
z80 _z80crtprt_: ld a,(de)
z80 cp 255
z80 ret z
z80 rst 16
z80 inc de
z80 jr _z80crtprt_
z80 _z80crtskip_:
endif
_z80crtptrcount_ = _z80crtptrcount_ + 1
_localcrt1_ catstr <_z80crtlabel_>, %_z80crtptrcount_
_localcrt2_ catstr <_z80crtexit_>, %_z80crtptrcount_
z80 jp _localcrt2_
z80 _localcrt1_: db z80quoted ;z80crt
z80 db 255
z80 _localcrt2_:
z80 push de
z80 ld de,_localcrt1_
z80 call _z80crtprt_
z80 pop de
endm
z80_crtnum macro
if _z80includecrtnum_ eq 0
_z80includecrtnum_ = 1
z80 jr _z80crtnumskip_
z80 _z80crtnumdigit_: ld a,"0"-1
z80 _z80crtnumdig_loop_: inc a
z80 add hl,bc
z80 jr c,_z80crtnumdig_loop_
z80 sbc hl,bc
z80 cp d ;"0"?
z80 jr nz,_z80crtnumnonzero_
z80 bit 0,e
z80 ret z
z80 _z80crtnumnonzero_: rst 16
z80 set 0,e
z80 ret
z80 _z80crtnum16_: push af
z80 push bc
z80 push de
z80 ld de,("0" shl 8) or 0
z80 ld bc,65536-10000
z80 call _z80crtnumdigit_
z80 ld bc,65536-1000
z80 call _z80crtnumdigit_
z80 jr _z80crtnum8_1_
z80 _z80crtnum8_: push af
z80 push bc
z80 push de
z80 ld de,("0" shl 8) or 0
z80 _z80crtnum8_1_: ld bc,65536-100
z80 call _z80crtnumdigit_
z80 ld bc,65536-10
z80 call _z80crtnumdigit_
z80 ld a,d ;"0"
z80 add a,l
z80 rst 16
z80 pop de
z80 pop bc
z80 pop af
z80 ret
z80 _z80crtnumskip_:
endif
endm
z80_crthex macro
if _z80includecrthex_ eq 0
_z80includecrthex_ = 1
z80 jr _z80crthexskip_
z80 _z80crthex16_: ld a,h
z80 call _z80crthex8_1
z80 _z80crthex8_: ld a,l
z80 _z80crthex8_1: push af
z80 rra
z80 rra
z80 rra
z80 rra
z80 call _z80crthexdigit_
z80 pop af
z80 _z80crthexdigit_: and 15
z80 cp 10
z80 sbc a,69h
z80 daa
z80 rst 16
z80 ret
z80 _z80crthexskip_:
endif
endm
z80_crt16 macro arg16:req, ashex:=<0>
z80_crtnum
z80 push hl
if @ITEMINLIST (arg16, <af,bc,de,ix,iy>) ne 0
z80 push arg16
z80 pop hl
elseifidni <arg16>, <sp>
z80 ld hl,2 ; +2 to account for the PUSH HL
z80 add hl,sp
elseifidni <arg16>, <hl>
; do nothing for hl arg
else
z80 ld hl,arg16
endif
if ashex eq 1
z80 call _z80crthex16_
else
z80 call _z80crtnum16_
endif
z80 pop hl
endm
z80_crt8 macro arg8:req, ashex:=<0>
z80_crtnum
z80 push hl
t_tmp = @ITEMINLIST (arg8, <a,b,c,d,e,h,l,ixl,ixh,iyl,iyh>)
if t_tmp ne 0
t_tmp = t_tmp - 1
if t_tmp le 6
; a - l
; we only move 'arg8' to L if it isn't L, cos LD L,L would be dumb
ifdifi <arg8>, <l>
z80 ld l,arg8
endif
z80 ld h,0
else
; ixl,ixh,iyl,iyh
z80 push af
z80 ld a,arg8
z80 ld l,a
z80 ld h,0
z80 pop af
endif
else
; immediate arg
z80 ld hl,arg8
endif
if ashex eq 1
z80 call _z80crthex8_
else
z80 call _z80crtnum8_
endif
z80 pop hl
endm
z80_crthex8 macro arg8:req
z80_crthex
z80_crt8 arg8, 1
endm
z80_crthex16 macro arg8:req
z80_crthex
z80_crt16 arg8, 1
endm
z80_for macro LCV:req, args:VARARG
t_count = argcount (args)
if t_count lt 2
.err <*** Not enough FOR arguments ***>
exitm
endif
Start textequ <getarg (1, args)>
Stop textequ <getarg (2, args)>
ifndef $$z80For&LCV&
$$z80For&LCV& = 0
else
$$z80For&LCV& = $$z80For&LCV& + 1
endif
ForLoop catstr <_$For&LCV&_>, %$$z80For&LCV&
NextLbl catstr <_$Next&LCV&_>, %$$z80For&LCV&
z80 push hl
z80 ld hl,Start
%z80 &ForLoop&:
z80 ld (LCV),hl
z80 push de
z80 ld de,Stop + 1
z80 or a
z80 sbc hl,de
z80 pop de
z80 pop hl
z80 jp nc,NextLbl
endm
z80_next macro LCV:req
ForLoop catstr <_$For&LCV&_>, %$$z80For&LCV&
NextLbl catstr <_$Next&LCV&_>, %$$z80For&LCV&
z80 push hl
z80 ld hl,(LCV)
z80 inc hl
z80 jp ForLoop
%z80 &NextLbl&:
endm
z80_align macro alignsize:req
$$align = ((z80_PC + (alignsize - 1)) and not (alignsize - 1)) - z80_PC
if $$align gt 0
z80 ds $$align, 0
endif
endm
z80_breakpoint macro
invoke AddBreakpoint, z80_PC
endm
z80_fillmem macro pMem:req, args:vararg
t_count = argcount (args)
if t_count lt 1
.err <*** Not enough MEMFILL arguments ***>
exitm
endif
bcount textequ <getarg (1, args)>
if t_count ge 2
fbyte textequ <getarg (2, args)>
ifdifi <fbyte>, <a>
z80 ld a,fbyte
endif
else
z80 xor a ; if no filler byte specified, use 0 for filler
endif
if bcount eq 0
exitm
endif
if _z80includefillmem_ eq 0
_z80includefillmem_ = 1
z80 jr _z80fillmemskip_
z80 _z80fillmem_: inc b
z80 _z80fillmemloop_: ld (hl),a
z80 inc hl
z80 dec c
z80 jp nz,_z80fillmemloop_
z80 djnz _z80fillmemloop_
z80 ret
z80 _z80fillmemskip_:
endif
z80 push hl
z80 push bc
z80 ld hl,pMem
z80 ld bc,bcount
z80 call _z80fillmem_
z80 pop bc
z80 pop hl
endm
z80 macro mnarg, args:VARARG
oparg textequ <>
arg textequ <>
t_label textequ <>
mnemonic textequ <mnarg>
ifb <mnarg>
exitm
endif
newlab = 0
t_tmp = 1
% forc $char, <mnemonic>
ifidn <$char>, < >
exitm
endif
ifidn <$char>, <:>
z80_label %t_label ; create the new label
newlab = 1
exitm
else
t_label catstr t_label, <$char>
t_tmp = t_tmp + 1
endif
endm
if newlab eq 1
if @SizeStr (%mnemonic) lt (t_tmp+1)
exitm ; nothing after colon, so only a label on this line
endif
mnemonic substr mnemonic, t_tmp+1 ; strip label name from mnemonic argument
endif
t_tmp = 0
t_leadspc = 0
t_quoted = 0
% forc $char, <mnemonic>
t_addchar = 0
ifidn <$char>, <!">
; we add the opening or closing quote, then toggle quoted flag
t_addchar = 1
t_quoted = not t_quoted
endif
ifidn <$char>, < >
if t_leadspc eq 1
t_tmp = 1
endif
else
t_leadspc = 1
t_addchar = 1
endif
if (t_addchar eq 1) or t_quoted
if t_tmp eq 0
oparg catstr oparg, <$char>
else
arg catstr arg, <$char>
endif
endif
endm
ifidni oparg, <ld>
%z80_ld <arg>, <args>
exitm
endif
ifidni oparg, <call>
%z80_call <arg>, <args>
exitm
endif
ifidni oparg, <ret>
%z80_ret <arg>
exitm
endif
ifidni oparg, <djnz>
%z80_djnz <arg>
exitm
endif
ifidni oparg, <jr>
%z80_jr <arg>, <args>
exitm
endif
ifidni oparg, <jp>
%z80_jp <arg>, <args>
exitm
endif
ifidni oparg, <push>
%z80_push <arg>
exitm
endif
ifidni oparg, <pop>
%z80_pop <arg>
exitm
endif
ifidni oparg, <inc>
%z80_inc <arg>
exitm
endif
ifidni oparg, <dec>
%z80_dec <arg>
exitm
endif
ifidni oparg, <add>
%z80_add <arg>, <args>
exitm
endif
ifidni oparg, <adc>
%z80_adc <arg>, <args>
exitm
endif
ifidni oparg, <sub>
%z80_sub <arg>
exitm
endif
ifidni oparg, <sbc>
%z80_sbc <arg>, <args>
exitm
endif
ifidni oparg, <and>
%z80_and <arg>
exitm
endif
ifidni oparg, <xor>
%z80_xor <arg>
exitm
endif
ifidni oparg, <or>
%z80_or <arg>
exitm
endif
ifidni oparg, <cp>
%z80_cp <arg>
exitm
endif
ifidni oparg, <ex>
%z80_ex <arg>, <args>
exitm
endif
ifidni oparg, <rla>
z80_rla
exitm
endif
ifidni oparg, <rra>
z80_rra
exitm
endif
ifidni oparg, <rlca>
z80_rlca
exitm
endif
ifidni oparg, <rrca>
z80_rrca
exitm
endif
ifidni oparg, <daa>
z80_daa
exitm
endif
ifidni oparg, <cpl>
z80_cpl
exitm
endif
ifidni oparg, <scf>
z80_scf
exitm
endif
ifidni oparg, <ccf>
z80_ccf
exitm
endif
ifidni oparg, <rlc>
%z80_rlc <arg>
exitm
endif
ifidni oparg, <rrc>
%z80_rrc <arg>
exitm
endif
ifidni oparg, <rl>
%z80_rl <arg>
exitm
endif
ifidni oparg, <rr>
%z80_rr <arg>
exitm
endif
ifidni oparg, <sla>
%z80_sla <arg>
exitm
endif
ifidni oparg, <sra>
%z80_sra <arg>
exitm
endif
ifidni oparg, <sll>
%z80_sll <arg>
exitm
endif
ifidni oparg, <sls> ; pseudonym for SLL
%z80_sls <arg>
exitm
endif
ifidni oparg, <srl>
%z80_srl <arg>
exitm
endif
ifidni oparg, <bit>
%z80_bit <arg>, <args>
exitm
endif
ifidni oparg, <res>
%z80_res <arg>, <args>
exitm
endif
ifidni oparg, <set>
%z80_set <arg>, <args>
exitm
endif
ifidni oparg, <ldi>
z80_ldi
exitm
endif
ifidni oparg, <cpi>
z80_cpi
exitm
endif
ifidni oparg, <ini>
z80_ini
exitm
endif
ifidni oparg, <outi>
z80_outi
exitm
endif
ifidni oparg, <ldd>
z80_ldd
exitm
endif
ifidni oparg, <cpd>
z80_cpd
exitm
endif
ifidni oparg, <ind>
z80_ind
exitm
endif
ifidni oparg, <outd>
z80_outd
exitm
endif
ifidni oparg, <ldir>
z80_ldir
exitm
endif
ifidni oparg, <cpir>
z80_cpir