Anonymous user
C--: Difference between revisions
Jump to navigation
Jump to search
→Examples
[unchecked revision] | [unchecked revision] |
Line 91:
$ POP SI
}
byte readDisk(byte drive, head, sector, track, howmany; word segm, offs)
int err;
{
err = 0;
lab1:
$ MOV AH, 0
$ MOV DL, drive
$ INT 0x13
$ MOV AX, segm
$ MOV ES, AX
$ MOV BX, offs
$ MOV DL, drive
$ MOV DH, head
$ MOV CL, sector
$ MOV CH, track
$ MOV AL, howmany
$ MOV AH, 2
$ INT 0x13
AL = 0;
if (CARRYFLAG)
{
err++;
if (err < maxDiskErrors) $jmp lab1;
return(AH);
}
return(0);
}
These snippets may seem a bit spaghetti code, but not because of some language defficiency but because I didn't look very far for them snippets.
|