summaryrefslogtreecommitdiff
path: root/v4.0-ozzie/bin/DISK2/BIOS/DEFDBUG.INC
diff options
context:
space:
mode:
Diffstat (limited to 'v4.0-ozzie/bin/DISK2/BIOS/DEFDBUG.INC')
-rw-r--r--v4.0-ozzie/bin/DISK2/BIOS/DEFDBUG.INC122
1 files changed, 122 insertions, 0 deletions
diff --git a/v4.0-ozzie/bin/DISK2/BIOS/DEFDBUG.INC b/v4.0-ozzie/bin/DISK2/BIOS/DEFDBUG.INC
new file mode 100644
index 0000000..590e376
--- /dev/null
+++ b/v4.0-ozzie/bin/DISK2/BIOS/DEFDBUG.INC
@@ -0,0 +1,122 @@
1;** DEFDBUG.ASM - Debugging Macro Definitions
2;
3;
4; DEBUG n,m,<format string>, <arg list>
5;
6;
7
8.sall
9
10DEBUG MACRO N,M,string,args
11 local b,c
12 IFDEF DEBUGFLG
13 pushf
14 DEBUGTST N,M
15 jz b
16 push ax
17 push bp
18 call c ;; push address of string
19 DB '&string',0
20c: mov bp,sp
21; IFNB <args>
22 IRP Y,<args>
23 IFIDN <Y>,<ax>
24 push 4[bp]
25 ELSE
26 IFIDN <Y>,<AX>
27 push 4[bp]
28 ELSE
29 IFIDN <Y>,<bp>
30 push 2[bp]
31 ELSE
32 IFIDN <Y>,<BP>
33 push 2[bp]
34 ELSE
35 mov ax,Y
36 push ax
37 ENDIF
38 ENDIF
39 ENDIF
40 ENDIF
41 ENDM
42; ENDIF
43 call DPRINTF
44 mov sp,bp
45 pop ax ;; discard format string offset
46 pop bp
47 pop ax
48b: popf
49 ENDIF
50ENDM
51
52
53
54
55;** ERRNZ - generate assembly error if arg != 0
56;
57
58ERRNZ MACRO EXPR
59 IF1
60 IFE expr
61 ELSE
62 RADIX 0 ; CONDITION NOT MET - ERROR
63 ENDIF
64 ENDIF
65 ENDM
66
67
68;** DBBEG - Start debugging range
69;
70
71DBBEG MACRO N,M
72 LOCAL lab
73 IFDEF DEBUGFLG
74 pushf
75 DEBUGTST N,M
76 jnz lab ;; am to do it
77 DBJMP %DBCNT
78lab:
79 ENDM
80
81
82
83DBJMP MACRO N
84 jmp DBLAB&N
85 ENDM
86
87
88;** DEBUGTST - Test Debug Flags
89;
90; DEBUGTST n,m
91;
92; Where N and M are bit masks.
93;
94; If one or more of the bits in N is set in the high byte
95; of BUGBITS, and one or more of the bits in M is set in
96; the low byte of BUGBITS then clear the Z flag.
97;
98; In other words:
99;
100; If both masks show a "hit" clear 'Z' else set 'Z'
101;
102; USES FLAGS
103
104DEBUGTST MACRO N,M
105 LOCAL A
106 test BYTE PTR BUGBITS,n
107 jz A
108 test BYTE PTR BUGBITS+1,m
109A:
110 ENDM
111
112DBEND MACRO
113 DBLAB %DBCNT
114DBCNT = DBCNT+1
115 popf
116 ENDM
117
118DBLAB MACRO N
119DBLAB&N:
120 ENDM
121
122 DBCNT = 1