Category : C Source Code
Archive   : JAZ_CLIB.ZIP
Filename : DOSREADS.ASM

 
Output of file : DOSREADS.ASM contained in archive : JAZ_CLIB.ZIP
Comment *
ÚÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄ¿
³Dosreads.asm ³
³Allows direct sector access from 'C' which is not possible using int86 ³
³because this int leaves a word on the stack which would cause int86 to ³
³return to some unknown place. ³
³usage: ³
³char wbuf[512]; ;at lease 512 bytes for sector buffer ³
³int werror; ³
³ ³
³werror = dosreads(0,0,1,wbuf); ; reads drive 'A',sector 0, 1 sector into ³
³ ; wbuf. ³
³ ³
³ ³
³ (C) JazSoft Software by Jack A. Zucker (301) 794-5950 ³
ÀÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÙ
*
assume cs:_text
_text segment public byte 'code'
public _dosreads

_dosreads proc near

push bp
mov bp,sp
push si ; save user's "C" register variables
push di

mov al,[bp+4] ; drive number
mov dx,[bp+6] ; which sector to read
mov cx,[bp+8] ; amount of sectors
mov bx,[bp+0Ah] ; offset of buffer
int 25h
jc _dosreadserror ; if carry then error occurred
mov ax,0 ; else return a zero
_dosreadserror:
popf ; int 25h pushes flags
pop di ; restore user's "C" register variables
pop si
pop bp ; restore base pointer
ret
_dosreads endp
_text ends
end


  3 Responses to “Category : C Source Code
Archive   : JAZ_CLIB.ZIP
Filename : DOSREADS.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/