Setting up IVT from C address
Posted: Thu Sep 26, 2013 10:52 am
I am trying to create function from this tutorial http://wiki.osdev.org/Real_mode_assembly_IV
How should I get segment from a to pass it on this line
Code: Select all
void set_interrupt(char c,void* a){
asm("push %es ;save es");
asm("xor %es,%es ;null out es");
asm("mov %al,%0 ;set al to int number"::"g"(c):);
asm("mov %bl,0x4 ;prepare mul by 0x4");
asm("mul %bl ;multiply al by 0x4");
asm("mov %bx,%ax ;mov result to bx");
asm("mov es:(bx),%0"::"m"(a):);
asm("add %bx,$2");
asm("mov es:(bx), segment");
asm("pop %es ;restore es ");
}
Code: Select all
asm("mov es:(bx), segment");