@@ -115,8 +115,8 @@ OUT: al = 00h
115115
116116s.data.resident
117117
118- global iregs
119- iregs :
118+ global _iregs
119+ _iregs :
120120 . bp : resw 1
121121 . di : resw 1
122122 . si : resw 1
@@ -130,12 +130,12 @@ iregs:
130130 . cs : resw 1
131131 . flags : resw 1 ; (not used by us)
132132
133- global need_to_chain
134- need_to_chain :
133+ global _need_to_chain
134+ _need_to_chain :
135135 resw 1
136136
137- global top_of_stack
138- top_of_stack :
137+ global _top_of_stack
138+ _top_of_stack :
139139 resw 1
140140
141141old_ss:
@@ -165,34 +165,34 @@ amisintr: ; AMIS list of hooked interrupts, 2Dh marks end of list
165165
166166 ; These variables are used as globals
167167 ; by the C code. Each is an uint16_t.
168- global file_table_size
169- global file_table_size_bytes
170- global file_table_free
171- global file_table ;_offset
172- global lock_table_size
173- global lock_table_size_bytes
174- global lock_table_free
175- global lock_table ;_offset
168+ global _file_table_size
169+ global _file_table_size_bytes
170+ global _file_table_free
171+ global _file_table ;_offset
172+ global _lock_table_size
173+ global _lock_table_size_bytes
174+ global _lock_table_free
175+ global _lock_table ;_offset
176176
177177extern _end_resident
178178
179179
180180 align 2 , db 0
181181ctrl2:
182- file_table_size : dw 0
183- file_table_free : dw 0
184- lock_table_size : dw 20
185- lock_table_free : dw 20
182+ _file_table_size : dw 0
183+ _file_table_free : dw 0
184+ _lock_table_size : dw 20
185+ _lock_table_free : dw 20
186186ctrl2.end:
187187
188188 align 2 , db 0
189189ctrl3:
190- file_table :
191- file_table_offset : dw OFFSET _end_resident ; WARNING: this will overwrite startup/transient code
192- file_table_size_bytes : dw 0
193- lock_table :
194- lock_table_offset : dw 0
195- lock_table_size_bytes : dw 0
190+ _file_table :
191+ _file_table_offset : dw OFFSET _end_resident ; WARNING: this will overwrite startup/transient code
192+ _file_table_size_bytes : dw 0
193+ _lock_table :
194+ _lock_table_offset : dw 0
195+ _lock_table_size_bytes : dw 0
196196ctrl3.end:
197197
198198ctrl1:
@@ -246,8 +246,8 @@ s.text.resident
246246
247247; invoke DOS critical error handler for given drive & error code
248248; void critical_error(uint16_t error_code, uint16_t drive) __gcc16;
249- global critical_error
250- critical_error :
249+ global _critical_error
250+ _critical_error :
251251
252252 lframe near
253253 lpar word , error_code
@@ -265,7 +265,7 @@ critical_error:
265265
266266i2D.uninstall:
267267%if _SUPPORTGENERALUNINSTALLER
268- mov al , 04h ; safe to remove, no resident uninstaller,
268+ mov al , 04h ; safe to remove, no resident uninstaller,
269269 ; TSR now disabled
270270 push es
271271 push ds
@@ -315,23 +315,23 @@ i2D.hwreset equ $-1 ; (second byte of mov bx, cs is same as the retf opcode)
315315 sub bx , 10h ; memory block to dealloc is PSP, so subtract sizeof(PSP) from CS
316316 iret
317317
318- global i2D_handler
319- global i2D_next
320- i2D_handler equ i2D
321- i2D_next equ i2D.next
318+ global _i2D_handler
319+ global _i2D_next
320+ _i2D_handler equ i2D
321+ _i2D_next equ i2D.next
322322
323323iispentry i2D , 0 , i2D
324324 cmp ah , 0
325- global amisnum
326- amisnum equ $- 1 ; AMIS multiplex number (data for cmp opcode)
327- je .handle ; our multiplex number -->
328- jmp far [ cs :.next ] ; else go to next handler -->
325+ global _amisnum
326+ _amisnum equ $- 1 ; AMIS multiplex number (data for cmp opcode)
327+ je .handle ; our multiplex number -->
328+ jmp far [ cs :.next ] ; else go to next handler -->
329329
330330.handle:
331331 test al , al
332332 jz .installationcheck ; installation check -->
333333 cmp al , 02h
334- je .uninstall ; uninstallation -->
334+ je .uninstall ; uninstallation -->
335335 cmp al , 04h
336336 je .determineinterrupts ; determine hooked interrupts -->
337337 cmp al , 21h
@@ -342,20 +342,20 @@ amisnum equ $-1 ; AMIS multiplex number (data for cmp opcode)
342342 je .ctrl3
343343 ; all other functions are reserved or not supported by TSR
344344. nop :
345- mov al , 0 ; show not implemented
345+ mov al , 0 ; show not implemented
346346 iret
347347
348348.installationcheck:
349- dec al ; (= FFh) show we're here
350- mov cx , 10Ah ; = version
351- mov di , amissig ; dx:di -> AMIS signature strings of this program
349+ dec al ; (= FFh) show we're here
350+ mov cx , 10Ah ; = version
351+ mov di , amissig ; dx:di -> AMIS signature strings of this program
352352.iret_dx_cs:
353353 mov dx , cs
354354. iret :
355355 iret
356356
357357.determineinterrupts: ; al = 04h, always returns list
358- mov bx , amisintr ; dx:bx -> hooked interrupts list
358+ mov bx , amisintr ; dx:bx -> hooked interrupts list
359359 jmp short .iret_dx_cs
360360
361361.ctrl1:
@@ -385,12 +385,12 @@ End of C. Masloch TSR example code
385385
386386s.text.resident
387387
388- extern inner_handler
388+ extern _( inner_handler)
389389
390- global handler2f
391- global old_handler2f
392- handler2f equ i2F
393- old_handler2f equ i2F.next
390+ global _handler2f
391+ global _old_handler2f
392+ _handler2f equ i2F
393+ _old_handler2f equ i2F.next
394394
395395 ; IBM Interrupt Sharing Protocol header
396396iispentry i2F , 0 ; *** can use i2D for 3rd argument but exceeds jmp short
@@ -422,17 +422,17 @@ iispentry i2F, 0 ; *** can use i2D for 3rd argument but exceeds jmp short
422422.enter_c_handler:
423423
424424 ; save the input DS
425- pop word [ iregs .ds ]
425+ pop word [ _iregs .ds ]
426426
427427 ; save regs
428- mov [ iregs .bp ], BP
429- mov [ iregs .di ], DI
430- mov [ iregs .si ], SI
431- mov [ iregs .es ], ES
432- mov [ iregs .dx ], DX
433- mov [ iregs .cx ], CX
434- mov [ iregs .bx ], BX
435- mov [ iregs .ax ], AX
428+ mov [ _iregs .bp ], BP
429+ mov [ _iregs .di ], DI
430+ mov [ _iregs .si ], SI
431+ mov [ _iregs .es ], ES
432+ mov [ _iregs .dx ], DX
433+ mov [ _iregs .cx ], CX
434+ mov [ _iregs .bx ], BX
435+ mov [ _iregs .ax ], AX
436436 ; don't need IP or CS or flags
437437 ; (flags weren't ever read or written,
438438 ; and setting flags before iret is pointless.
@@ -444,27 +444,27 @@ iispentry i2F, 0 ; *** can use i2D for 3rd argument but exceeds jmp short
444444 mov [ old_sp ], SP
445445 push CS
446446 pop SS
447- mov SP , [ top_of_stack ]
447+ mov SP , [ _top_of_stack ]
448448
449449 ; insure UP (Direction Flag = 0) for our C code
450450 cld
451451
452452 ; call our handler
453- call inner_handler
453+ call _( inner_handler)
454454
455455 ; restore stack
456456 mov SS , [ old_ss ]
457457 mov SP , [ old_sp ]
458458
459459 ; restore register input values
460- mov BP , [ iregs .bp ]
461- mov DI , [ iregs .di ]
462- mov SI , [ iregs .si ]
463- mov ES , [ iregs .es ]
464- mov DX , [ iregs .dx ]
465- mov CX , [ iregs .cx ]
466- mov BX , [ iregs .bx ]
467- mov AX , [ iregs .ax ]
460+ mov BP , [ _iregs .bp ]
461+ mov DI , [ _iregs .di ]
462+ mov SI , [ _iregs .si ]
463+ mov ES , [ _iregs .es ]
464+ mov DX , [ _iregs .dx ]
465+ mov CX , [ _iregs .cx ]
466+ mov BX , [ _iregs .bx ]
467+ mov AX , [ _iregs .ax ]
468468
469469 ; Although this is a 16-bit variable it is
470470 ; valid to check only the low 8 bits as
@@ -473,18 +473,18 @@ iispentry i2F, 0 ; *** can use i2D for 3rd argument but exceeds jmp short
473473 ; the jnz. This is a small optimisation to
474474 ; avoid a cs override prefix. The Zero Flag
475475 ; is unaffected by the mov.
476- cmp byte [ need_to_chain ], 0
476+ cmp byte [ _need_to_chain ], 0
477477
478478 ; restore caller's DS
479- mov DS , [ iregs .ds ]
479+ mov DS , [ _iregs .ds ]
480480
481481 ; return from interrupt if we handled it
482482 jnz .run_old
483483 iret
484484
485485.run_old:
486486 ; jump to old handler that will iret
487- jmp far [ CS :old_handler2f ]
487+ jmp far [ CS :_old_handler2f ]
488488
489489
490490 numdef CMPSTR , 1
0 commit comments