home *** CD-ROM | disk | FTP | other *** search
/ io Programmo 23 / IOPROG_23.ISO / SOFT / ASM / BCDASM.ZIP / BCDASM / SRC / BCDLD.ASM < prev    next >
Encoding:
Assembly Source File  |  1997-06-03  |  1.6 KB  |  81 lines

  1.     title    BCDASM -- Copyright 1997, Morten Elling
  2.     subttl    Load packed signed BCD constants
  3.  
  4.     include    model.inc
  5.     include    modelt.inc
  6.     include    bcd.ash
  7.  
  8.     @CODESEG
  9.  
  10. ;//////////////////////////////////////////////////////////////////////
  11. ;//    Name    bcdLdz
  12. ;//    Desc    Load zero as a packed BCD value.
  13. ;//
  14. ;//
  15. ;//    Entry    Passed args
  16. ;//    Exit    Destination = zero. Acc undefined.
  17.  
  18. bcdLdz    proc
  19. arg    dstBCD    :dataptr, \    ; Addr of destination BCD
  20.     dstsz    :@uint        ; Byte size of dest.
  21. @uses    es,rdi,rcx,rax
  22. ;.
  23.     @cld
  24.     @LES  rdi, [dstBCD]
  25.     mov   rcx, [dstsz]
  26.     sub   al, al
  27.     rep   stosb
  28.     RET
  29. bcdLdz    endp
  30.  
  31.  
  32. ;//////////////////////////////////////////////////////////////////////
  33. ;//    Name    bcdLd1
  34. ;//    Desc    Load +1 as a packed signed BCD value.
  35. ;//
  36. ;//
  37. ;//    Entry    Passed args
  38. ;//    Exit    Destination = +1. Acc undefined.
  39.  
  40. bcdLd1    proc
  41. arg    dstBCD    :dataptr, \    ; Addr of destination BCD
  42.     dstsz    :@uint        ; Byte size of dest.
  43. @uses    es,rdi,rcx,rax
  44. ;.
  45.     @cld
  46.     @LES  rdi, [dstBCD]
  47.     mov   rcx, [dstsz]
  48.     mov   al, 01h
  49.     stosb
  50.     dec   rcx
  51.     sub   al, al
  52.     rep   stosb
  53.     RET
  54. bcdLd1    endp
  55.  
  56.  
  57. ;//////////////////////////////////////////////////////////////////////
  58. ;//    Name    bcdLd100
  59. ;//    Desc    Load +100 (decimal) as a packed signed BCD value.
  60. ;//
  61. ;//
  62. ;//    Entry    Passed args
  63. ;//    Exit    Destination = +100. Acc undefined.
  64.  
  65. bcdLd100 proc
  66. arg    dstBCD    :dataptr, \    ; Addr of destination BCD
  67.     dstsz    :@uint        ; Byte size of dest.
  68. @uses    es,rdi,rcx,rax
  69. ;.
  70.     @cld
  71.     @LES  rdi, [dstBCD]
  72.     mov   rcx, [dstsz]
  73.     mov   rax, 0100h
  74.         stosW
  75.     dec   rcx
  76.         dec   rcx
  77.     rep   stosb
  78.     RET
  79. bcdLd100 endp
  80.  
  81.     END