Help With Turbo C, Asm, And Structures
Posted: Fri Aug 01, 2008 7:46 am
Hello, thanks for reading my post. I writing a function to load a sector into an structure. My function's code is the following:
and this is how i call it:
well this is not working... and i can't undertstand why...
thanks
Code: Select all
void loadsct(unsigned char size, unsigned char *where, unsigned char track, unsigned char sector, unsigned char head)
{
asm {
mov ah, 2h
mov al, [size]
lea bx, where
mov ch, [track]
mov cl, [sector]
mov dh, [head]
mov dl, 0
int 13h
}
}
Code: Select all
struct entry
{
unsigned char name[10];
unsigned char size;
unsigned char track;
unsigned char sector;
unsigned char head;
};
struct entry direntries[14];
void main(void)
{
loadsct(1, &direntries[0].name[0], 0, 1, 0);
}
thanks