TIP: Click on subject to list as thread! ANSI
echo: 80xxx
to: ALL
from: TOM TORFS
date: 1997-08-04 01:21:00
subject: tracer.asm (1/6)

>>>>>>>>>> CSplit: Version 2.2 >>>>>>>>>>
>>>>>>>>>> CSplit: Begin part 1/6 >>>>>>>>>>
>>>>>>>>>> CSplit: Begin file TRACER.ASM >>>>>>>>>>
; Tracer - utility to trace int 21h calls
; Written by Tom Torfs (2:292/516@fidonet.org, tomtorfs@mail.dma.be)
; Donated to the public domain, 1997-08-03
program segment para public 'code'
assume cs:program,ds:program,es:program,ss:program
org 100h
@@start:
@@codestart:
; make the stack not bigger than necessary
mov sp,offset @@stackstart+512
; free all memory we don't need
mov ah,4Ah
mov bx,sp
add bx,15
mov cl,4
shr bx,cl
int 21h
; show title
mov ah,9
mov dx,offset titlemessage
int 21h
; skip leading spaces
mov si,81h
@@skipspaceloop:
   cmp byte ptr [si],' '
   jne @@skipspacedone
   inc si
jmp @@skipspaceloop
@@skipspacedone:
; check for no parameters
cmp byte ptr [si],0Dh
jne @@cmdlineok
   ; show usage info
   mov ah,9
   mov dx,offset usage
   int 21h
   ; terminate
   mov ax,4C01h
   int 21h
@@cmdlineok:
; nul-terminate executable name
mov bx,si
@@nultermloop:
   cmp byte ptr [bx],' '
   je @@nultermdone
   cmp byte ptr [bx],0Dh
   je @@nultermdone
   inc bx
jmp @@nultermloop
@@nultermdone:
mov dl,0
xchg [bx],dl
; expand executable name using DOS canonicalize function
mov ah,60h
mov di,offset execpath
int 21h
; restore byte under nulbyte
xchg [bx],dl
; calculate number of characters to cut off
mov ax,bx
sub ax,81h
; adjust commandline length
mov cl,ds:[80h]
mov ch,0
sub cx,ax
mov ds:[80h],cl
; move commandline over program name
cld
mov si,bx
mov di,81h
inc cx   ; include closing 0Dh
rep movsb
>>>>>>>>>> CSplit: End part 1/6 crc: 75e3 >>>>>>>>>>
---
---------------
* Origin: CPost v1.0 (2:292/516)

SOURCE: echomail via exec-pc

Email questions or comments to sysop@ipingthereforeiam.com
All parts of this website painstakingly hand-crafted in the U.S.A.!
IPTIA BBS/MUD/Terminal/Game Server List, © 2025 IPTIA Consulting™.