Category : OS/2 Files
Archive   : DD_IN_C.ZIP
Filename : MOVEBYTE.ASM

 
Output of file : MOVEBYTE.ASM contained in archive : DD_IN_C.ZIP
; movebyte.asm OS/2 Version 2.0
;
; this routine transfers data to and from the device driver
;
; C Calling Sequence:
; if (MoveBytes(virt &From,virt &To,USHORT Lenth)) err
;
.286
include drvlib.inc
public MOVEBYTES
extrn _ DevHlp:dword
assume CS:_TEXT
_TEXT segment word public 'CODE'

MOVEBYTES proc near

push bp
mov bp,sp
pushf ; save flags
push di ; save segment regs
push si ; and others we use
push es
push ds
mov cx,[bp+4] ; length
or cx,cx ; exit if zero
mov ax,1 ; set for bad parameter
jz get_out
lds si,[bp+10] ; from
les di,[bp+6] ; to
cld
test cx,1 ; if even number of bytes, save a
jz wordmove ; little time by doing a word move
rep movsb
jmp short finish; done

wordmove:

shr cx,1 ; half the number of bytes
rep movsw

finish:
xor ax,ax

get_out:
pop ds
pop es
pop si ; restore regs
pop di
popf ;restore flags
pop bp
ret 10 ; fix up stack

MOVEBYTES endp
_TEXT ends
end




  3 Responses to “Category : OS/2 Files
Archive   : DD_IN_C.ZIP
Filename : MOVEBYTE.ASM

  1. Very nice! Thank you for this wonderful archive. I wonder why I found it only now. Long live the BBS file archives!

  2. This is so awesome! 😀 I’d be cool if you could download an entire archive of this at once, though.

  3. But one thing that puzzles me is the “mtswslnkmcjklsdlsbdmMICROSOFT” string. There is an article about it here. It is definitely worth a read: http://www.os2museum.com/wp/mtswslnk/