>>>>>>>>>> CSplit: Version 2.2 >>>>>>>>>>
>>>>>>>>>> CSplit: Begin part 3/6 >>>>>>>>>>
; int 21h handler
@@int21handler:
push bp
mov bp,sp
push ax
push bx
push cx
push dx
push ds
pushf
mov ax,cs
mov ds,ax
cmp [indos],0
jnz @@nointercept
mov [indos],1
; get PSP address
mov ah,62h
int 21h
cmp bx,[ourpsp]
je @@notinprogram
; calculate segment address relative to PSP
mov ax,[bp+4]
sub ax,bx
jc @@notinprogram
; write segment address
call @@writehex
; write colon
mov dx,offset colon
mov cx,1
call @@writelog
; write offset address
mov ax,[bp+2]
sub ax,2 ; compensate for int call
call @@writehex
; write space
mov dx,offset space
mov cx,1
call @@writelog
; write AX=
mov dx,offset axvalue
mov cx,4
call @@writelog
; write ax value
mov ax,[bp-2]
call @@writehex
cmp byte ptr [bp-1],73h ; ah
ja @@nodesc
; write space
mov dx,offset space
mov cx,1
call @@writelog
; write description
mov bl,[bp-1] ; ah
mov bh,0
shl bx,1
mov dx,[funcdesc+bx]
call @@writestr
@@nodesc:
; write crlf
mov dx,offset crlf
mov cx,2
call @@writelog
@@notinprogram:
mov [indos],0
@@nointercept:
popf
pop ds
pop dx
pop cx
pop bx
pop ax
pop bp
db 0EAh ; jmp seg:ofs
oldint21ofs dw ?
oldint21seg dw ?
; prints a nul-terminated string, followed by a crlf
; ds:dx = string
; changes: ax,bx,dx
@@puts:
mov bx,dx
dec bx ; to compensate for first inc
@@putszeroloop:
inc bx
cmp byte ptr [bx],0
jne @@putszeroloop
>>>>>>>>>> CSplit: End part 3/6 crc: 2aa5 >>>>>>>>>>
---
---------------
* Origin: CPost v1.0 (2:292/516)
|