home *** CD-ROM | disk | FTP | other *** search
/ Monster Media 1993 #2 / Image.iso / clipper / nettos11.zip / MISC / FNROR.ASM < prev    next >
Assembly Source File  |  1992-10-18  |  1KB  |  76 lines

  1. ; File......: FNROR.ASM
  2. ; Author....: Ted Means
  3. ; CIS ID....: 73067,3332
  4. ; Date......: $Date$
  5. ; Revision..: $Revision$
  6. ; Log file..: $Logfile$
  7. ; This is an original work by Ted Means and is placed in the
  8. ; public domain.
  9. ;
  10. ; Modification history:
  11. ; ---------------------
  12. ;
  13. ; $Log$
  14. ;
  15.  
  16. ; $DOC$
  17. ; $FUNCNAME$
  18. ;    FN_ROR()
  19. ; $CATEGORY$
  20. ;    Miscellaneous
  21. ; $ONELINER$
  22. ;    Rotate bits in an integer to the right
  23. ; $SYNTAX$
  24. ;
  25. ;    fn_ror( <nInt> | <cInt>, <nBits> ) -> nResult
  26. ;
  27. ; $ARGUMENTS$
  28. ;
  29. ;   <nInt> may either be a numeric integer, or a 16-bit character string
  30. ;   that is the binary representation of a numeric integer.  <nBits>
  31. ;   must be a numeric integer.
  32. ;
  33. ; $RETURNS$
  34. ;
  35. ;   <nResult>, a numeric
  36. ;
  37. ; $DESCRIPTION$
  38. ;
  39. ;   The value returned is obtained by rotating the bits in <nInt>
  40. ;   to the right.  <nBits> determines the number of bits to rotate.
  41. ;   If any parameters are invalid, the function will return zero.
  42. ;
  43. ; $EXAMPLES$
  44. ;
  45. ;   nX := 12
  46. ;   ? fn_ror( nX, 2 ) // 3
  47. ;
  48. ; $SEEALSO$
  49. ;
  50. ; $INCLUDE$
  51. ;
  52. ; $END$
  53. ;
  54. ;
  55.  
  56. IDEAL
  57.  
  58. PUBLIC   FN_ROR
  59.  
  60. EXTRN    __FNCBALL:FAR
  61.  
  62. SEGMENT  _FNNET  WORD      PUBLIC    "CODE"
  63.          ASSUME    CS:_FNNET
  64.  
  65. PROC     FN_ROR       FAR
  66.  
  67.          MOV       AX,4ED3h
  68.          MOV       DX,0CBFAh
  69.          JMP       __FNCBALL
  70.  
  71. ENDP     FN_ROR
  72. ENDS     _FNNET
  73. END
  74.  
  75.