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 (4/6)

>>>>>>>>>> CSplit: Version 2.2 >>>>>>>>>>
>>>>>>>>>> CSplit: Begin part 4/6 >>>>>>>>>>
   mov byte ptr [bx],'$'
   mov ah,9
   int 21h
   mov byte ptr [bx],0
   mov ah,9
   mov dx,offset crlf
   int 21h
   ret
; write cx bytes from ds:dx to the logfile
; changes ax,bx,cx
@@writelog:
   mov ah,40h
   mov bx,[loghandle]
   int 21h
   ret
; write a nul-terminated string from ds:dx to the logfile
; changes ax,bx,cx
@@writestr:
   mov bx,dx
   dec bx   ; compensate for first inc
   @@findstrzeroloop:
      inc bx
      cmp byte ptr [bx],0
   jnz @@findstrzeroloop
   mov cx,bx
   sub cx,dx
   call @@writelog
   ret
; write the 4-digit hexadecimal value in ax to the logfile
; changes ax,bx,cx
@@writehex:
   mov bl,ah
   mov cl,4
   shr bl,cl
   mov bh,0
   mov cl,[hexdigit+bx]
   mov [hexbuf],cl
   mov bl,ah
   and bl,0Fh
   mov bh,0
   mov cl,[hexdigit+bx]
   mov [hexbuf+1],cl
   mov bl,al
   mov cl,4
   shr bl,cl
   mov bh,0
   mov cl,[hexdigit+bx]
   mov [hexbuf+2],cl
   mov bl,al
   and bl,0Fh
   mov bh,0
   mov cl,[hexdigit+bx]
   mov [hexbuf+3],cl
   mov dx,offset hexbuf
   mov cx,4
   call @@writelog
   ret
parablock label
envseg dw ?
commandlineofs dw ?
commandlineseg dw ?
fcb1ofs dw -1
fcb1seg dw -1
fcb2ofs dw -1
fcb2seg dw -1
saveSP dw ?
indos db 0
hexdigit db '0123456789ABCDEF'
hexbuf db 4 dup (?)
titlemessage db 'Tracer, public domain by Tom Torfs',13,10,10,'$'
usage db 'Usage: TRACER  []',13,10,10
      db 'The trace data will be written to TRACER.LOG.',13,10
      db '$'
tracing db 'Tracing ','$'
execerror db 'Error executing program',13,10,'$'
>>>>>>>>>> CSplit: End part 4/6 crc: 193a >>>>>>>>>>
---
---------------
* 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™.