home *** CD-ROM | disk | FTP | other *** search
/ Oakland CPM Archive / oakcpm.iso / cpm / asmutl / prtval.zz0 / PRTVAL.Z80
Encoding:
Text File  |  1988-01-18  |  1.6 KB  |  53 lines

  1. ; PRTVAL.Z80     version 2.0        Jim Lill     17 Jan 88
  2. ;
  3. ; PRTVAL uses a method referred to in M80 manuals for printing values
  4. ; during assembly.  My earlier version required ' .RADIX n' to control
  5. ; format of the printed value.  Adding a second macro solved that and
  6. ; I've eliminated the use of the '%' in each call.  This means math
  7. ; must be done with EQU prior to the PRTVAL call.  I find this acceptable
  8. ; as it helps maintain readability.
  9. ;
  10. ; SYNTAX:
  11. ;
  12. ;    PRTVAL    RADIX,<MESSAGE1>,VALUE,<MESSAGE2>
  13. ;          |       |        |       |
  14. ;           |       |        |       |___ 'trailing' message
  15. ;           |       |        |___ value to be printed (no math here!)
  16. ;          |       |___ 'leading' message
  17. ;          |___ radix of printed value 2, 10, 16
  18. ;........................................................................
  19. ;
  20. ; Put the following code in your program (a .LIB won't work)
  21. ;........................................................................
  22. ;
  23. ; PRTVAL macro(s) prints text and value during assembly
  24. ;
  25. prtval2    macro m1,v1,m2            ; \
  26.     .printx    m1 v1 m2        ;  +- this is the print value macro
  27.     endm                ; /
  28.  
  29. prtval    macro r,msg1,val,msg2        ; \
  30.     .radix r            ;   passing the radix value
  31.     prtval2 <msg1>,%val,<msg2>    ;   requires the uses of 2 macros
  32.     endm                ; /
  33. ;.........................................................................
  34. ; DEMO of it's use.
  35. ; ====
  36.  
  37. start:    org    0100h
  38.     nop
  39.     nop
  40.     nop
  41. middle:
  42.  
  43.     prtval 16,<ending address = >,$,<>
  44.     prtval 10,<this is >,$,< bytes>
  45.  
  46. length    equ    middle - start
  47.     prtval 10,<code length is >,length,< bytes>
  48.  
  49. ;................................
  50.  
  51.     end
  52.