home *** CD-ROM | disk | FTP | other *** search
/ Power-Programmierung / CD1.mdf / magazine / pcmagazi / 1991 / 14 / deb2scr.scr < prev    next >
Text File  |  1991-02-04  |  3KB  |  78 lines

  1. N DEB2SCR.COM
  2. A
  3. MOV      DX,0187              ; address of buffer
  4. MOV      CX,F000              ; size of buffer
  5. XOR      BX,BX
  6. MOV      AH,3F                ; read text into buffer
  7. INT      21
  8. OR       AX,AX                ; number of bytes read = 0 ?
  9. JNZ      0112                 ; no --> PROCEED
  10. ;<0110> FINISH:
  11. INT      20                   ; end
  12. ;<0112> PROCEED:
  13. MOV      CX,AX
  14. ADD      CX,DX                ; CX = end of data in buffer
  15. MOV      SI,DX                ; SI = address of byte read from buffer
  16. ;<0118> NEWLINE:
  17. CMP      SI,CX                ; end of data reached ?
  18. JNB      0110                 ; yes --> FINISH
  19. MOV      AL,[SI]              ; read character from buffer
  20. CMP      AL,2D                ; is it a '-' ?
  21. JNZ      0125                 ; no --> CONTINUE1
  22. INC      SI                   ; skip the '-'
  23. JMP      016E                 ; --> OUTPUTLINE
  24. ;<0125> CONTINUE1:
  25. CMP      AL,3A                ; is it a ':' ?
  26. JNZ      012C                 ; no --> CONTINUE2
  27. INC      SI                   ; skip the ':'
  28. JMP      016E                 ; --> OUTPUTLINE
  29. ;<012C> CONTINUE2:
  30. CMP      AL,43                ; is it a 'C' ?
  31. JNZ      0135                 ; no --> CONTINUE3
  32. ADD      SI,09                ; skip 'CX XXXX',CR,LF
  33. JMP      0118                 ; --> NEWLINE
  34. ;<0135> CONTINUE3:
  35. CMP      AL,57                ; is it a 'W' ?
  36. JNZ      013E                 ; no --> CONTINUE4
  37. ADD      SI,14                ; skip 'Writing XXXX bytes',CR,LF
  38. JMP      0118                 ; --> NEWLINE
  39. ;<013E> CONTINUE4:
  40. CMP      BYTE PTR [SI+04],3A  ; line begins with address ?     (XXXX:YYYY)
  41. JNZ      016B                 ; no --> CONTINUE5
  42. CMP      BYTE PTR [SI+0A],3B  ; does a comment follow ?        (XXXX:YYYY ;)
  43. JNZ      016B                 ; no --> CONTINUE5
  44. CMP      BYTE PTR [SI+0B],3C  ; does comment contain address ? (XXXX:YYYY ;<)
  45. JZ       015F                 ; yes --> CHANGEADDRESS
  46. MOV      WORD PTR [SI+03],3C3B; write ';<' before 'YYYY'
  47. MOV      WORD PTR [SI+09],203E; write '> ' after  'YYYY'
  48. ADD      SI,03                ; skip 'XXX'
  49. JMP      016E                 ; --> OUTPUTLINE
  50. ;<015F> CHANGEADDRESS:
  51. MOV      AX,[SI+05]           ; replace address in comment
  52. MOV      [SI+0C],AX
  53. MOV      AX,[SI+07]
  54. MOV      [SI+0E],AX
  55. ;<016B> CONTINUE5:
  56. ADD      SI,0A                ; skip 'XXXX:YYYY '
  57. ;<016E> OUTPUTLINE:
  58. CLD
  59. LODSB                         ; read character and increment SI
  60. MOV      DL,AL
  61. CMP      DL,0D                ; is it a CR ?
  62. JNZ      017C                 ; no --> CONTINUE6
  63. CMP      [SI],DL              ; a second CR follows ?
  64. JNZ      017C                 ; no --> CONTINUE6
  65. INC      SI                   ; skip it
  66. ;<017C> CONTINUE6:
  67. MOV      AH,02                ; output character
  68. INT      21
  69. CMP      DL,0A                ; was it a LF ?
  70. JNZ      016E                 ; no  --> OUTPUTLINE
  71. JMP      0118                 ; yes --> NEWLINE
  72. ;<0187> BUFFER:
  73.  
  74. RCX
  75. 87
  76. W
  77. Q
  78.