home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
World of Shareware - Software Farm 2
/
wosw_2.zip
/
wosw_2
/
CPROG
/
CEXPRESS.ZIP
/
BITS.ASM
/
RORCHAR.ASM
< prev
next >
Wrap
Assembly Source File
|
1989-05-03
|
630b
|
26 lines
;unsigned char rotate_char_right(value,number_bits);
; unsigned char value,number_bits;
EXTRN _memory_model:byte
_TEXT SEGMENT BYTE PUBLIC 'CODE'
ASSUME CS:_TEXT
PUBLIC _rotate_char_right
_rotate_char_right proc near
mov bx,sp ;set stack frame
cmp _memory_model,0 ;near or far?
jle begin ;jump if near
inc bx ;else add 2 to BX
inc bx ;
begin: mov cl,ss:[bx+4] ;number of bits to rotate
mov al,ss:[bx+2] ;get the byte
ror al,cl ;make the rotation
cmp _memory_model,0 ;quit
jle quit ;
db 0CBh ;RET far
quit: ret ;RET near
_rotate_char_right endp
_TEXT ENDS
END