www.digitalmars.com         C & C++   DMDScript  

digitalmars.D - inline assembler interrupts

reply llee <llee_member pathlink.com> writes:
I'm trying to call dos interrupts using the inline assembler.
Unfortunately I keep getting the following message during compilation:
end of instruction
The code I used is listed below. Any help is welcome.
asm
{
mov AH, interrupt_code ;
int 21H                ;
..
}
where interrupt_code is of type long. 
Jun 27 2006
next sibling parent Lionello Lunesu <lio lunesu.remove.com> writes:
llee wrote:
 I'm trying to call dos interrupts using the inline assembler.
 Unfortunately I keep getting the following message during compilation:
 end of instruction
 The code I used is listed below. Any help is welcome.
 asm
 {
 mov AH, interrupt_code ;
 int 21H                ;
 ..
 }
 where interrupt_code is of type long. 
Are those int 21h dos services available under windows!?! That would surprise me. L.
Jun 27 2006
prev sibling parent Frank Benoit <keinfarbton nospam.xyz> writes:
I did not test it, but perhaps this works:

const uint DOS_IRQ_VECTOR = 0x21;

void callIrq( ushort interrupt_code ){
  asm{
    mov AH, interrupt_code ;
    int DOS_IRQ_VECTOR ;
  }
}
Jun 28 2006