|
|
1.1 root 1: ;
2: ; _DBG386.EQU 5.20A June 8, 1995
3: ;
4: ; The Greenleaf Comm Library
5: ;
6: ; Copyright (C) 1991-94 Greenleaf Software Inc. All Rights Reserved.
7: ;
8: ; NOTES
9: ;
10: ; This file contains the macros used to provide debug output services
11: ; for the protected mode ISR. Debug output services are fully
12: ; defined in DEBUG386.ASM.
13: ;
14: ; MODIFICATIONS
15: ;
16: ; December 1, 1994 5.10A : Initial release.
17: ;
18:
19: ;
20: ; Any routine that wants to use debug services can include this header
21: ; file. Unfortunately, if it gets included by DEBUG386.ASM, we are
22: ; going to see a conflict between these EXTRN definitions and the
23: ; PUBLIC definitions in the source module. We avoid this conflict by
24: ; simply defining _DEBUG32 in DEBUG386.ASM so that these guys won't get
25: ; pulled in by that module.
26: ;
27: ; Note also that these externs don't get defined if ISR_DEBUG is not turned
28: ; on. This prevents this code from being linked in in a production release.
29: ;
30:
31: IFNDEF _DEBUG32
32: IFDEF ISR_DEBUG
33:
34: PISRCODE SEGMENT BYTE PUBLIC USE32 'CODE'
35: EXTRN C _VidGoto32:NEAR
36: EXTRN C _VidPutc32:NEAR
37: EXTRN C _VidDat32:NEAR
38: PISRCODE ENDS
39:
40: ENDIF
41:
42: ENDIF
43:
44: ;
45: ; Macro: VIDGOTO row,col
46: ;
47: ;
48: ; ARGUMENTS
49: ;
50: ; row : The row to go to on the screen. This can be any sort
51: ; of identifier that will push 32 bits on the stack
52: ; with a "push row" instruction.
53: ;
54: ; col : The column to go to on the screen. This can be any sort
55: ; of identifier that will push 32 bits on the stack
56: ; with a "push col" instruction.
57: ;
58: ; DESCRIPTION
59: ;
60: ; This macro is used in the protected ISR to move the cursor, or current
61: ; output location, to a specific location on the screen.
62: ;
63: ; SIDE EFFECTS
64: ;
65: ; None.
66: ;
67: ; RETURNS
68: ;
69: ; Nothing.
70: ;
71: ; AUTHOR
72: ;
73: ; SM October 17, 1994
74: ;
75: ; MODIFICATIONS
76: ;
77: ;
78:
79: VIDGOTO macro row, col ; Tag: Debug private
80: push col
81: push row
82: call near ptr _VidGoto32
83: add sp,8
84: endm
85:
86: ;
87: ; Macro: VIDPUTS str
88: ;
89: ;
90: ; ARGUMENTS
91: ;
92: ; str : A string that needs to be displayed on the screen. Note
93: ; that this doesn't have to be a null terminated string.
94: ;
95: ; DESCRIPTION
96: ;
97: ; This macro is used in the protected ISR to display an entire string
98: ; on the screen. It operates a little differently from the same
99: ; function in real mode. This guy just wastefully uses an IRPC loop
100: ; to expand out to a single call to _VidPutc32 for every single character
101: ; in the string.
102: ;
103: ; SIDE EFFECTS
104: ;
105: ; None.
106: ;
107: ; RETURNS
108: ;
109: ; Nothing.
110: ;
111: ; AUTHOR
112: ;
113: ; SM October 17, 1994
114: ;
115: ; MODIFICATIONS
116: ;
117: ;
118:
119: VIDPUTS macro str ; Tag: Debug private
120: irpc char, <str>
121: push '&char'
122: call _VidPutc32
123: add sp,4
124: endm
125: endm
126:
127: ;
128: ; Macro: VIDPUTC char
129: ;
130: ;
131: ; ARGUMENTS
132: ;
133: ; char : A single character that needs to be displayed on the screen.
134: ;
135: ; DESCRIPTION
136: ;
137: ; This macro is used in the protected ISR to display a single character
138: ; at the current cursor position on the screen. It does this with
139: ; a single call to _VidPutc32. Note that the argument can be anything
140: ; that pushes a 32 byte value with assembly of "push char".
141: ;
142: ; SIDE EFFECTS
143: ;
144: ; None.
145: ;
146: ; RETURNS
147: ;
148: ; Nothing.
149: ;
150: ; AUTHOR
151: ;
152: ; SM October 17, 1994
153: ;
154: ; MODIFICATIONS
155: ;
156: ;
157:
158: VIDPUTC macro char ; Tag: Debug private
159: push char
160: call _VidPutc32
161: add sp,4
162: endm
163:
164: ;
165: ; Macro: VIDPUTBYTE data
166: ;
167: ;
168: ; ARGUMENTS
169: ;
170: ; data : Any eight bit value that can be moved into al with
171: ; a mov al, data instruction.
172: ;
173: ; DESCRIPTION
174: ;
175: ; This macro is used in the protected ISR to display a single binary
176: ; byte in hex. The real work is done by VidDat32, the macro just
177: ; takes care of setting things up to facilitate the call.
178: ;
179: ; SIDE EFFECTS
180: ;
181: ; None.
182: ;
183: ; RETURNS
184: ;
185: ; Nothing.
186: ;
187: ; AUTHOR
188: ;
189: ; SM October 17, 1994
190: ;
191: ; MODIFICATIONS
192: ;
193: ;
194:
195: VIDPUTBYTE macro dat ; Tag: Debug private
196: push eax
197: mov al,dat
198: ror eax,8
199: push 2
200: push eax
201: call _VidDat32
202: add sp,8
203: pop eax
204: endm
205:
206: ;
207: ; Macro: VIDPUTWORD data
208: ;
209: ;
210: ; ARGUMENTS
211: ;
212: ; data : Any 16 bit value that can be moved into ax with
213: ; a mov ax, data instruction.
214: ;
215: ; DESCRIPTION
216: ;
217: ; This macro is used in the protected ISR to display a single binary
218: ; word in hex. The real work is done by VidDat32, the macro just
219: ; takes care of setting things up to facilitate the call.
220: ;
221: ; SIDE EFFECTS
222: ;
223: ; None.
224: ;
225: ; RETURNS
226: ;
227: ; Nothing.
228: ;
229: ; AUTHOR
230: ;
231: ; SM October 17, 1994
232: ;
233: ; MODIFICATIONS
234: ;
235: ;
236:
237: VIDPUTWORD macro dat ; Tag: Debug private
238: push eax
239: mov ax,dat
240: ror eax,16
241: push 4
242: push eax
243: call _VidDat32
244: add sp,8
245: pop eax
246: endm
247:
248: ;
249: ; Macro: VIDPUTDWORD data
250: ;
251: ;
252: ; ARGUMENTS
253: ;
254: ; data : Any 32 bit value that can be moved into eax with
255: ; a mov eax, data instruction.
256: ;
257: ; DESCRIPTION
258: ;
259: ; This macro is used in the protected ISR to display a single binary
260: ; dword in hex. The real work is done by VidDat32, the macro just
261: ; takes care of setting things up to facilitate the call.
262: ;
263: ; SIDE EFFECTS
264: ;
265: ; None.
266: ;
267: ; RETURNS
268: ;
269: ; Nothing.
270: ;
271: ; AUTHOR
272: ;
273: ; SM October 17, 1994
274: ;
275: ; MODIFICATIONS
276: ;
277: ;
278:
279: VIDPUTDWORD macro dat ; Tag: Debug private
280: push eax
281: mov eax,dat
282: push 8
283: push eax
284: call _VidDat32
285: add sp,8
286: pop eax
287: endm
288:
This archive runs on limited infrastructure. Preserving old code on modern bandwidth. Automated agents are requested to crawl responsibly.