home *** CD-ROM | disk | FTP | other *** search
/ The C Users' Group Library 1994 August / wc-cdrom-cusersgrouplibrary-1994-08.iso / listings / v_02_06 / 2n06010a < prev    next >
Text File  |  1991-03-16  |  2KB  |  125 lines

  1. ; (c) Copyright 1991, Martin Stitt
  2. ; dumpmacs.inc - dump macros which call xmit_par.com
  3.  
  4. intvect    equ    0fdh
  5.  
  6. dchar_code equ     0
  7. dstr_code  equ    1
  8. dbyte_code equ    2
  9. dword_code equ    3
  10.  
  11. ; dump single char.  parameter can register, memory or
  12. ; an immediate character (must be in quotes: 'x')
  13.  
  14. dump_char   macro data
  15.     pushf
  16.     push    ax
  17.     mov    al,data
  18.     mov    ah,dchar_code
  19.     int    intvect    
  20.     pop    ax
  21.     popf
  22.     endm
  23.  
  24. ; simple way to dump a marker character:  dump_chari a
  25. ; to dump a blank space, don't give any parameter
  26.  
  27. dump_chari  macro data
  28.     pushf
  29.     push    ax
  30. ifnb <char>
  31.     mov    al,'&data&'
  32. else
  33.     mov    al,' '
  34. endif
  35.     mov    ah,dchar_code
  36.     int    intvect    
  37.     pop    ax
  38.     popf
  39.     endm
  40.  
  41. ; dumps an asciiz string at ds:si
  42.  
  43. dump_str    macro
  44.     pushf
  45.     push    ax
  46.     mov    ah,dstr_code
  47.     int    intvect    
  48.     pop    ax
  49.     popf
  50.     endm
  51.  
  52. ; dumps an immediate string parameter.  
  53. ; enclose string within <> signs: dump_stri <count = >
  54.  
  55. dump_stri   macro str
  56.     local    msg, st1
  57.     jmp    short st1
  58. msg    db    '&str&',0
  59. st1:
  60.     pushf
  61.     push    ax
  62.     push    si
  63.     push    ds
  64.     mov    ax,cs
  65.     mov    ds,ax
  66.     mov    si,offset cs:msg
  67.     mov    ah,dstr_code
  68.     int    intvect    
  69.     pop    ds
  70.     pop    si
  71.     pop    ax
  72.     popf
  73.     endm
  74.  
  75. ; cause a carriage return and linefeed to be dumped
  76.  
  77. dump_nl        macro
  78.     local    msg, st1
  79.     jmp    short st1
  80. msg    db    13,10,0
  81. st1:
  82.     pushf
  83.     push    ax
  84.     push    si
  85.     push    ds
  86.     mov    ax,cs
  87.     mov    ds,ax
  88.     mov    si,offset cs:msg
  89.     mov    ah,dstr_code
  90.     int    intvect    
  91.     pop    ds
  92.     pop    si
  93.     pop    ax
  94.     popf
  95.     endm
  96.  
  97. ; dump parameter byte in hex mode.  parameter can be a
  98. ; register or memory location.
  99.  
  100. dump_byte   macro data
  101.     pushf
  102.     push    ax
  103.     mov    al,data
  104.     mov    ah,dbyte_code
  105.     int    intvect
  106.     pop    ax
  107.     popf
  108.     endm
  109.  
  110. ; dump parameter word in hex mode.  parameter can be a
  111. ; register or memory location.
  112.  
  113. dump_word   macro data
  114.     pushf
  115.     push    ax
  116.     push    si
  117.     mov    si,data
  118.     mov    ah,dword_code
  119.     int    intvect
  120.     pop    si
  121.     pop    ax
  122.     popf
  123.     endm
  124.  
  125.