int 86
Moved from OS Design and Theory. Not sure if this really belongs in General Programming - could you be a little more specific please - 'int 86'? Do you just mean that you want to be able to handle interrupts on an x86, do you want to use real mode BIOS interrupts or do you want to do something else where I have missed the point completely?
If you want to move data from memory to registers and vice versa, I suggest you look around for a good assembly programming tutorial.
Cheers,
Adam
If you want to move data from memory to registers and vice versa, I suggest you look around for a good assembly programming tutorial.
Cheers,
Adam
I said I want to use only C and inline assembler.
What I Want is int86(INT int_no, REGS in_regs, REGS out_regs), a native dos function.
This function copies in_regs to registries, make an software intrerupt , and copies registries to out_regs.
Uses:
What I Want is int86(INT int_no, REGS in_regs, REGS out_regs), a native dos function.
This function copies in_regs to registries, make an software intrerupt , and copies registries to out_regs.
Uses:
Code: Select all
union REGS regs;
regs.h.ah = 0x00;
regs.h.al = 0x13;
int86(0x10,®s,®s);
-
- Member
- Posts: 566
- Joined: Tue Jun 20, 2006 9:17 am
Yup....
int86 function is something specific to dos ... you may check out the geninterrupt function ....(turbo C specific )
it should be very easy to implement .... eg... define the Regs structure ...
... save the initial regs ... call the given int ( or use a far jmp) ... save the resulting regs ....
Code: Select all
_AX = 0x3;
geninterrupt(0x10);
... save the initial regs ... call the given int ( or use a far jmp) ... save the resulting regs ....
-
- Member
- Posts: 566
- Joined: Tue Jun 20, 2006 9:17 am
hint ... i beleive u r using turbo C or borland C (somewhat apparent from ur question ) ...u can directly access and mauplate registers like
using inline asm is easy as welll ....
the segment addr of int is : 0000
and the offset is : int_num * 4
eg address of function int 21h h is in mem location 0000:0x21*4
Code: Select all
_AX = 0x4C00;
unsigned int exit code = _AX ;
...etc ...
Code: Select all
char crap;
asm
{
mov crap,al
}
the segment addr of int is : 0000
and the offset is : int_num * 4
eg address of function int 21h h is in mem location 0000:0x21*4
-
- Member
- Posts: 566
- Joined: Tue Jun 20, 2006 9:17 am
Hi,
Cheers,
Brendan
This inline assembly tutorial for GCC might help (but then again, it might not help if you don't have enough basic knowledge)...eddyb wrote:on my djgpp compiler inline asm is confusing..
Cheers,
Brendan
For all things; perfection is, and will always remain, impossible to achieve in practice. However; by striving for perfection we create things that are as perfect as practically possible. Let the pursuit of perfection be our guide.