-
Notifications
You must be signed in to change notification settings - Fork 0
/
CMACROS.MAC
executable file
·65 lines (56 loc) · 933 Bytes
/
CMACROS.MAC
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
subttl CMACROS.MAC
; This file contains the macros used when entering and leaving the
; bios in the routines which need so much stackspace that it is
; neccessary to use a local stack. 910924
; This is NOT used by the DISKIO.MAC routines.
;
EnterBios MACRO
DI ;
PUSH HL ; (* Enter biosrutine *)
LD HL,0 ;
ADD HL,SP ;
LD SP,BIOSSTACK ;
push hl
EI ;
ENDM
LeaveBios MACRO NoReturn
DI ; (* Leave Bios routine and restore
pop hl ;
LD SP,HL ; old stack *)
POP HL ;
EI ;
IFB <NoReturn>
RET
ENDIF
ENDM
hexnibbledb MACRO nibble
if nibble lt 10
db '0'+nibble
else
db 'A'-10+nibble
endif
endm
hexdb MACRO byt
if usephase
if2
hexnibbledb %(byt shr 4)
hexnibbledb %(byt and 15)
else
db 0,0
endif
else
db 'yy'
endif
ENDM
hexwdb MACRO wrd
if usephase
if2
hexdb %(wrd shr 8)
hexdb %(wrd and 255)
else
db 0,0,0,0
endif
else
db 'xxxx'
endif
ENDM