home *** CD-ROM | disk | FTP | other *** search
/ Liren Large Software Subsidy 7 / 07.iso / c / c082_122 / 5.ddi / CLIBSRC2.ZIP / H_PINA.ASM < prev    next >
Encoding:
Assembly Source File  |  1992-06-10  |  2.5 KB  |  91 lines

  1. ;[]-----------------------------------------------------------------[]
  2. ;|      H_PINA.ASM -- long pointer routines                          |
  3. ;[]-----------------------------------------------------------------[]
  4.  
  5. ;
  6. ;       C/C++ Run Time Library - Version 5.0
  7. ;       Copyright (c) 1987, 1992 by Borland International
  8. ;       All Rights Reserved.
  9.  
  10.                 INCLUDE RULES.ASI
  11.  
  12. ; calls to these routines are generated by the compiler to perform
  13. ; arithmetic operations on long pointers.
  14.  
  15. _TEXT           SEGMENT BYTE PUBLIC 'CODE'
  16.                 ASSUME  CS:_TEXT
  17.  
  18.                 public  PINA@
  19.                 public  F_PINA@
  20.                 public  N_PINA@
  21.  
  22. N_PINA@:
  23.                 pop     cx                      ;fix up far return
  24.                 push    cs
  25.                 push    cx
  26. PINA@:
  27. F_PINA@:
  28. ;
  29. ;               Pointer to memory cell to increment is in es:bx
  30. ;               Increment amount is ax
  31. ;               This routine trashes cl
  32.  
  33.                 mov     cl,4
  34.                 add     ax,es:[bx]
  35.                 mov     dx,ax
  36.                 jc      inacarry
  37.                 shr     dx,cl
  38.                 add     dx,es:2[bx]
  39.                 and     ax,0fh
  40.                 xchg    es:[bx],ax
  41.                 xchg    es:2[bx],dx
  42.                 retf
  43. inacarry:
  44.                 shr     dx,cl
  45.                 add     dx,es:2[bx]
  46.                 add     dx,1000H
  47.                 and     ax,0fh
  48.                 xchg    es:[bx],ax
  49.                 xchg    es:2[bx],dx
  50.                 retf
  51.  
  52.                 public  PDEA@
  53.                 public  F_PDEA@
  54.                 public  N_PDEA@
  55.  
  56. N_PDEA@:
  57.                 pop     cx                      ;fix up far return
  58.                 push    cs
  59.                 push    cx
  60. PDEA@:
  61. F_PDEA@:
  62. ;
  63. ;               Pointer to memory cell to increment is in es:bx
  64. ;               Decrement amount is ax
  65. ;               This routine trashes cl
  66.  
  67.                 mov     cl,4
  68.                 mov     dx,es:[bx]
  69.                 sub     dx,ax
  70.                 mov     ax,dx
  71.                 jc      deacarry
  72.                 shr     dx,cl
  73.                 add     dx,es:2[bx]
  74.                 and     ax,0fh
  75.                 xchg    es:[bx],ax
  76.                 xchg    es:2[bx],dx
  77.                 retf
  78. deacarry:
  79.                 shr     dx,cl
  80.                 add     dx,es:2[bx]
  81.                 sub     dx,1000H
  82.                 and     ax,0fh
  83.                 xchg    es:[bx],ax
  84.                 xchg    es:2[bx],dx
  85.                 retf
  86. _TEXT           ENDS
  87.                 END
  88.  
  89.