contents   index   previous   next



Dos.interrupt()

syntax:

Dos.interrupt(interrupt, regIn[, regOut])

where:

interrupt - DOS interrupt number.

 

regIn - an object/structure with properties/elements that correspond to the registers of an 8086 processor. The registers will be set to these values when the method is called.

 

regOut - an object/structure with properties/elements that will be set to the corresponding registers of the processor when the function is exited.

 

return:

boolean - since many interrupts set the carry flag for error, this function returns false if the carry flag is set, else true.

 

description:

Executes an 8086 interrupt. Set registers, call 8086 interrupt function, and then get the return values of the registers. The parameters regIn and regOut are structures containing the elements corresponding to the registers on an 8086. On input, those structure members that are defined will be set, and those that are not defined will be set to zero, with the exception of the segment registers (es and ds) which retain their current values if not explicitly specified. The possible defined input values are ax, ah, al, bx, bh, bl, cx, ch, cl, dx, dh, dl, bp, si, di, ds, and es. All Fields of the output reg structure are the same, with the addition of the FLAGS member, and all are set before returning. If regOut is not supplied, then the return registers and FLAGS register will be set for regIn on return from the interrupt call.

 

The parameter regOut is set to the register values upon return from Interrupt. If regOut is not supplied then regIn is set to contain the register values upon return from Interrupt.

 

example:

// The following example calls the DOS interrupt

// service 0x2C to read the clock:

 

   // display DOS time as accurately as it is read

PrintDOStime()

{

   reg.ah = 0x2C;

   interrupt(0x21,reg);

   printf("%2d:%02d:%02d",reg.ch,reg.cl,reg.dh);

}

 


Dos.offset()