|
-
December 31st, 2004, 06:46 AM
#1
Segment:Offset adddressing
Dear friends,
Can anyone show me how to implement segment: offset addressing in C/C++. I just want to read the buffer pointed by the DS:SI after calling the function 48h of BIOS interrupt 13h which yields hard disk parameters.
How can I read the 4-byte integer at offset 8h from the DS:SI buffer address. Please help me and attach a sample code if possible.
Thanks, you were always helpful !
susiriss.
-
December 31st, 2004, 09:32 PM
#2
Re: Segment:Offset adddressing
I'm assuming you need this in a 16bit (DOS) C/C++ program ?
Code:
long int far * lpfData = (long int far *)(((long unsigned int)regs.x.DS<<16) + regs.x.SI + 8);
you can then dereference lpfData to get the value.
If you need this in a 32Bit program, things are somewhat more difficult. For starters because you can't as easily call interrupts from 32bit code.
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|