home *** CD-ROM | disk | FTP | other *** search
/ Super Net 1 / SUPERNET_1.iso / PC / OTROS / MSDOS / WATTCP / MSWATTCP.ZIP / ELIB / INTEL.ASM < prev    next >
Encoding:
Assembly Source File  |  1993-05-20  |  1.1 KB  |  50 lines

  1. ; File: intel.asm
  2. ;
  3. ; 16-Jun-92 lr
  4. ;
  5. PAGE    66,132
  6. ;
  7. ;
  8. ;  intel - convert intel <--> bigendian
  9. ;
  10. ;
  11. ;  (c) 1990 University of Waterloo,
  12. ;           Faculty of Engineering,
  13. ;           Engineering Microcomputer Network Development Office
  14. ;
  15. ;
  16. ;
  17.     include masmdefs.hsm
  18.     include model.hsm
  19.  
  20. codedef intel
  21. datadef
  22.  
  23. cstart  intel
  24.  
  25. ;*************************************************************************
  26. ;  USAGE:  ULONG intel( ULONG val )
  27. ;          - convert to intel format
  28. ;*************************************************************************
  29. cpublic intel
  30. ;clabel  ntohl
  31. ;clabel  htonl
  32.     mov     AX, +@AB + 2 [BP]
  33.     mov     DX, +@AB + 0 [BP]
  34.     xchg    AL, AH
  35.     xchg    DL, DH
  36. creturn intel
  37. ;*************************************************************************
  38. ;  USAGE:  UINT intel16( UINT val )
  39. ;          - convert to intel format
  40. ;*************************************************************************
  41. cpublic intel16
  42. ;clabel  ntohs
  43. ;clabel  htons
  44.     mov     AX, +@AB [BP]
  45.     xchg    AL, AH
  46. creturn intel16
  47. cend    intel
  48.     end
  49. ; end of file intel.asm
  50.