home *** CD-ROM | disk | FTP | other *** search
/ CP/M / CPM_CDROM.iso / cpm / utils / asmutl / asmlib.lbr / PDE.AZM / PDE.ASM
Encoding:
Assembly Source File  |  1991-06-25  |  1.6 KB  |  68 lines

  1. ;----------------------------------------------------------------
  2. ;        This is a module in the ASMLIB library
  3. ;
  4. ; This module prints DE as either 4 hex digits or as 5 deciaml 
  5. ; digits.  Leading Zero blanking is done externally.
  6. ;
  7. ;            Written         R.C.H.     16/8/83
  8. ;            Last Update    R.C.H.       31/12/83
  9. ;----------------------------------------------------------------
  10. ;
  11.     name    'pde'
  12.     public    phde,pdde
  13.     extrn    phacc,?phacc2,?clrblank,?result,hexbcd
  14.     extrn    ?lzprint,nibasc,?pdacc2
  15. ;
  16. phde:
  17.     call    ?clrblank        ; Clear lzb blanking byte
  18.     mov    a,d            ; do upper 2 digits
  19.     push    psw
  20.     rar
  21.     rar
  22.     rar
  23.     rar                ; Put right nibble into low nibble
  24.     call    nibasc            ; Convert to ascii
  25.     call    ?lzprint        ; Standard leading zero print it
  26.     pop    psw
  27.     ani    0fh            ; Mask off top nibble
  28.     call    nibasc
  29.     call    ?lzprint        ; Leading zero print this digit too
  30. ;
  31. ; Now we can use standard printing to do the lower digits
  32.     mov    a,e            ; lower 2 bytes
  33.     jmp    ?phacc2            ; do it too, all done
  34. ;
  35. ;----------------------------------------------------------------
  36. ;             Print DE as 5 decimal digits
  37. ;----------------------------------------------------------------
  38. ;
  39. pdde:
  40.     call    ?clrblank
  41.     push    h
  42.     push    d
  43.     lxi    h,?result
  44.     call    hexbcd            ; convert to ascii in internal buffer
  45. ; Now print the 5 digit number
  46.     lda    ?result+2        ; get the MSDigit
  47.     call    nibasc            ; convert lower nibble
  48.     call    ?lzprint        ; print it
  49. ; Now do the other 4 digits
  50.     lda    ?result+1
  51.     push    psw
  52.     rrc
  53.     rrc
  54.     rrc
  55.     rrc
  56.     call    nibasc
  57.     call    ?lzprint
  58.     pop    psw
  59.     call    nibasc
  60.     call    ?lzprint
  61. ; Low two
  62.     jmp    ?pdacc2
  63.     end
  64.  
  65.  
  66.  
  67.  
  68.