Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

INTERRUPT, INTERRUPTX, CALL ABSOLUTE

Status
Not open for further replies.

KenshinHimura

Programmer
May 8, 2003
91
US
can someone give me some examples on or tell me how these functions work and how to use them plz? :)
 
Call absolute works with assembly programming. There are some examples around at some QB sites.

You basically have to enter the assembly codes (hex values)
into an array then call absolute pointing to the first
array item.

Interrupt and interruptx call the MS-dos interrupts.
They can be used for all kinds of things.
You can set the AX,BX,CX registers using the type definitions in the qb.bi file (or qbx.bi for pds).
The AX register usually controls what sub-set of the interrupt is used. For example interrupt 20H has lots of
things it does, many for the screen. The different processes are accessed by what is in the AH/AL or AX registers.

There is a list of interrupts and what they do on my site.

 
Call Absolute calls a function via an absolute address in memory...

You usually use a string, insert machine code characters into it and the use Varseg so send the absolute address of the string to Call Absolute to run the opcodes at that address in memory...

Confused Yet? ;-)

Basically each Assembly command has an OpCode (Operation Code) associated with it...

Take this Assembly Code for Example:
mov AX, 1
int 33
Retf


Is the same as this in Hex Machine code...
B80100
CD33
CB


Expanation...
mov AX : B8
1 : 0001 ... 00 01 ... 01 00 ... 0100 (low byte:high byte)
int : CD
33 : 33 (same since it is only 1 byte)
retf : CB

Then you put it into a string...
Code:
M$ = CHR$(&HB8)
M$ = M$ + CHR$(&H01)
M$ = M$ + CHR$(&H00)
M$ = M$ + CHR$(&HCD)
M$ = M$ + CHR$(&H33)
M$ = M$ + CHR$(&HCB)

DEF SEG = VARSEG(M$)
CALL ABSOLUTE (SADD(M$))

------------------------------

Now the above code can also be done with
Call interupt...

Such as...
AX = &H33
Call interupt(AX, BX, CX, DX)


Vic wrote some VERY good tutorials on this...

See this tutorial for more information:


Have Fun, Be Young... Code BASIC
-Josh
cubee101.gif


PROGRAMMER: (n) Red-eyed, mumbling mammal capable of conversing with inanimate objects.
 
thx cubeE101. Buff the interrupts list download didn't work and so did most other file downloads, but awsome tip page.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top