;
; Macros to execute extra 64180 instructions via SLRMAC
; NOTE - requires lowercase register arguments!!
;
rgnum	macro	rg
	ifidn	<rg>,<b>
rgval	 set	0
	else
	ifidn	<rg>,<c>
rgval	 set	1
	else
	ifidn	<rg>,<d>
rgval	 set	2
	else
	ifidn	<rg>,<e>
rgval	 set	3
	else
	ifidn	<rg>,<h>
rgval	 set	4
	else
	ifidn	<rg>,<l>
rgval	 set	5
	else
	ifidn	<rg>,<m>
rgval	 set	6
	else
	ifidn	<rg>,<a>
rgval	 set	7
	else
	 +++ error - illegal register +++
	endif
	endif
	endif
	endif
	endif
	endif
	endif
	endif
	endm
;
tst	macro	rg
	rgnum	rg
	db	0edh
	db	(rgval shl 3) + 4
	endm
;
tsti	macro	val
	db	0edh,064h,val
	endm
;
tstio	macro	val
	db	0edh,074h,val
	endm
;
in0	macro	rg,pt
	rgnum	rg
	if	rgval eq 6
	 +++ error +++ bad reg
	else
	 if	rgval lt 8
	  db	0edh
	  db	rgval shl 3
	  db	pt
	 endif
	endif
	endm
;
out0	macro	pt,rg
	rgnum	rg
	if	rgval eq 6
	 +++ error +++ bad reg
	else
	 if	rgval lt 8
	  db	0edh
	  db	rgval shl 3 + 1
	  db	pt
	 endif
	endif
	endm
;
otimr	macro
	db	0edh,093h
	endm
;
otim	macro
	db	0edh,083h
	endm
;
otdmr	macro
	db	0edh,09bh
	endm
;
otdm	macro
	db	0edh,08bh
	endm
;
slp	macro
	db	0edh,076h
	endm
;
mlt	macro	rg
	ifidn	<rg>,<bc>
	 db	0edh,04ch
	else
	ifidn	<rg>,<de>
	 db	0edh,05ch
	else
	ifidn	<rg>,<hl>
	 db	0edh,06ch
	else
	ifidn	<rg>,<sp>
	 db	0edh,07ch
	else
	 +++ error - bad register +++
	endif
	endif
	endif
	endif
	endm
;
