home *** CD-ROM | disk | FTP | other *** search
/ ftp.barnyard.co.uk / 2015.02.ftp.barnyard.co.uk.tar / ftp.barnyard.co.uk / cpm / walnut-creek-CDROM / CPM / CPM3 / CCP105P.ARK / BDOSRSX.ASM < prev    next >
Assembly Source File  |  1986-10-17  |  2KB  |  71 lines

  1. ;
  2. ;
  3. ; This RSX displays a history trace of <svc nr> of bdos calls.
  4. ;
  5. ; (C) 1986 by Michael D. Kersenbrock  Aloha, Oregon
  6. ;
  7.  
  8. serial:    db    0,0,0,0,0,0
  9.  
  10. start:    jmp    trace
  11.  
  12. next:    jmp    $-$
  13.  
  14. prev:    dw    0
  15.  
  16. remove:    db    0ffh        ; remove with next load
  17.  
  18. nonbank: db    0        ; both banked and non-banked are OK
  19.  
  20. thename:
  21.     db    'BDOSTRSX'    ; BDOS tracing RSX name
  22.  
  23. loader:    db    0        ; load for banked AND non-banked systems
  24.  
  25.     db    0,0        ; system use junque
  26.  
  27.  
  28. trace:    push    psw        ; save all at entry
  29.     push    d
  30.     push    h
  31.     push    b
  32.  
  33.     mvi    a,'<'        ; get leading output indicator
  34.     call    putchar        ; put to console screen
  35.     pop    b        ; get bdos function number
  36.     push    b    
  37.     mov    a,c        
  38.     rrc!rrc!rrc!rrc        ; put msn into lsn
  39.     call    trascii        ; translate msn to ascii
  40.     call    putchar        ; send it to console screen
  41.     pop    b        ; get function number again
  42.     push    b
  43.     mov    a,c
  44.     call    trascii        ; translate lsn to ascii
  45.     call    putchar        ; send it to console screen
  46.     mvi    a,'>'        ; get output string terminator
  47.     call    putchar        ; put it to screen
  48.     pop    b        ; return all registers back
  49.     pop    h
  50.     pop    d
  51.     pop    psw
  52.     jmp    next        ; and let it continue with its business
  53.  
  54.  
  55. trascii:
  56.     ani    0fh        ; make lsn "clean"
  57.     adi    '0'        ; assume it is numeric at first
  58.     cpi    '9'+1        ; numeric?
  59.     rc            ; yup
  60.     adi    'A'-'0'-0ah    ; nope, must be A-F
  61.     ret
  62.  
  63. putchar:
  64.     mvi    c,06h        ; direct console i/o bdos call
  65.     mov    e,a        ; put character into place
  66.     jmp    next        ; put character to the screen, then return to
  67.                 ; trace routine above (that called putchar).
  68. w        ; save all at entry
  69.     push    d
  70.     push    h
  71.     push