home *** CD-ROM | disk | FTP | other *** search
/ Groovy Bytes: Behind the Moon / groovybytes.iso / GROOVY / SND_TOOL / FUNK108A.ZIP / DOS32V30.ZIP / PAL / VARIOUS / MK_FAR.ASM < prev    next >
Encoding:
Assembly Source File  |  1995-05-20  |  993 b   |  34 lines

  1. ;*****************************************************************************
  2. ; Filename: MK_FAR.ASM
  3. ;   Author: Peter Andersson
  4. ;  Version: 0.0
  5. ;  Created: 1994.09.19
  6. ;  Updated: 1995.03.11
  7. ;*****************************************************************************
  8. ; Copyright Peter Andersson, 1994-1995.
  9. ; All rights reserved.
  10. ;*****************************************************************************
  11. ; Function: PVOID @MK_FAR(PVOID address)
  12. ;  Comment: Converts a segment:offset to a 32bit pointer. The pointer which
  13. ;           are returned _does not_ wrap around at 1MB which means that
  14. ;           0FFFFh:0010h: returns a pointer to 100000h!
  15. ;    Input: Eax - address to convert
  16. ;  Returns: 32bit pointer
  17. ;*****************************************************************************
  18.  
  19.     Include    STDDEF.INC
  20.  
  21.     Codeseg
  22.  
  23. Proc    MK_FAR  ,1
  24.         Mov    Edx,Eax
  25.         Shr    Eax,12
  26.         And    Edx,0FFFFh
  27.         And    Eax,0FFFF0h
  28.         Add    Eax,Edx
  29.         Add    Eax,[_zero]
  30.         Ret
  31. Endp
  32.  
  33.     End
  34.