Page 1 of 4
int 86
Posted: Tue Feb 19, 2008 11:02 am
by eddyb
Posted: Tue Feb 19, 2008 11:12 am
by AJ
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
Posted: Tue Feb 19, 2008 11:23 am
by eddyb
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:
Code: Select all
union REGS regs;
regs.h.ah = 0x00;
regs.h.al = 0x13;
int86(0x10,®s,®s);
Yup....
Posted: Tue Feb 19, 2008 11:33 am
by DeletedAccount
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 ....
Posted: Tue Feb 19, 2008 11:38 am
by eddyb
I have regs struct, I can make an intreerupt using inline asm.
But how I can acces registries from C?
Posted: Tue Feb 19, 2008 11:50 am
by DeletedAccount
hint ... i beleive u r using turbo C or borland C (somewhat apparent from ur question ) ...u can directly access and mauplate registers like
Code: Select all
_AX = 0x4C00;
unsigned int exit code = _AX ;
...etc ...
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
Posted: Tue Feb 19, 2008 11:58 am
by eddyb
( i use djgpp/gcc. i can do this on my compiler?
Posted: Tue Feb 19, 2008 12:07 pm
by DeletedAccount
Sorry ... you cant .... AS AJ pointed out ..you should read a good book on assembly language or 80x86 architecture .... I have provided u enough information .. or hints ... We are not here to do your work .. you should put some effort on ur part .... I am sorry if i sound rude ....
Posted: Tue Feb 19, 2008 1:56 pm
by Combuster
GCC is aimed at protected mode code, Turbo C and friends for real mode. You can't call bios interrupts directly from protected mode, you need to provide the proper environment first.
Given that you want to do video stuff, I suggest look at the various threads on the matter.
Posted: Wed Feb 20, 2008 9:19 am
by eddyb
I have installed turbo c. Now how i can use my code to this compiler? Are there incompatibilities?
Posted: Wed Feb 20, 2008 9:30 am
by JamesM
STFW!
Posted: Sun Feb 24, 2008 5:55 am
by eddyb
please...
Can I make my compiler:D?(something like hacking gcc, etc)
Posted: Sun Feb 24, 2008 9:16 am
by jal
eddyb wrote:please...:?
Can I make my compiler:D?(something like hacking gcc, etc)
Really, you don't know what you're talking about. Let it go.
JAL
Posted: Mon Feb 25, 2008 4:17 am
by eddyb
so, ho i do in inline asm do this:
set 0x10 to %dx
set 0x13 to%ax
call int 0x3
?
on my djgpp compiler inline asm is confusing..
Posted: Mon Feb 25, 2008 4:37 am
by Brendan
Hi,
eddyb wrote:on my djgpp compiler inline asm is confusing..
This
inline assembly tutorial for GCC might help (but then again, it might not help if you don't have enough basic knowledge)...
Cheers,
Brendan