home *** CD-ROM | disk | FTP | other *** search
/ Liren Large Software Subsidy 7 / 07.iso / c / c010 / 1.ddi / FLILIB3.ZIP / FLISRC3.ZIP / NORMPTR.ASM < prev    next >
Encoding:
Assembly Source File  |  1990-08-29  |  896 b   |  57 lines

  1.  
  2.     TITLE    normptr
  3.  
  4.     dosseg
  5.     .model    large
  6.     .code
  7.  
  8.  
  9.     PUBLIC    _i86_norm_ptr
  10.     ;i86_norm_ptr(offset, seg)
  11.     ;Add as much as possible of the offset of a pointer to the segment
  12. _i86_norm_ptr    PROC far
  13.     push bp
  14.     mov bp,sp
  15.     push cx
  16.  
  17.     mov    ax,[bp+4+2]    ;offset
  18.     mov dx,[bp+6+2]   ;segment
  19.     mov cl,4
  20.     shr ax,cl
  21.     add dx,ax
  22.     mov    ax,[bp+4+2]    ;offset
  23.     and ax,15
  24.  
  25.     pop cx
  26.     pop    bp
  27.     ret    
  28. _i86_norm_ptr    ENDP
  29.  
  30.     PUBLIC    _i86_enorm_ptr
  31.     ;i86_norm_ptr(offset, seg)
  32.     ;Add as much as possible of the offset of a pointer to the segment
  33.     ;and make it evenly alligned...
  34. _i86_enorm_ptr    PROC far
  35.     push bp
  36.     mov bp,sp
  37.     push cx
  38.  
  39.     mov    ax,[bp+4+2]    ;offset
  40.     mov dx,[bp+6+2]   ;segment
  41.     inc ax
  42.     and ax,0FFFEh    ;force even allignment
  43.     mov [bp+4+2],ax ;and save...
  44.     mov cl,4
  45.     shr ax,cl
  46.     add dx,ax
  47.     mov    ax,[bp+4+2]    ;offset
  48.     and ax,15
  49.  
  50.     pop cx
  51.     pop    bp
  52.     ret    
  53. _i86_enorm_ptr    ENDP
  54.  
  55.  
  56. END
  57.