News:

MASM32 SDK Description, downloads and other helpful links
MASM32.com New Forum Link
masmforum WebSite

What are the advantages of INT over CALL?

Started by matemp, November 15, 2006, 07:53:17 PM

Previous topic - Next topic

matemp

What are the advantages of INT over CALL? With using CALL it is possible to provide the same actions. What is the fundamental difference between them?
                        Thanks!

PBrennick

The GeneSys Project is available from:
The Repository or My crappy website

Relvinian

Quote from: matemp on November 15, 2006, 07:53:17 PM
What are the advantages of INT over CALL? With using CALL it is possible to provide the same actions. What is the fundamental difference between them?
                        Thanks!

There are two major differences between and INT CPU instruction and a CALL instruction.
1) INT is for access "interrupt" driven calls (most notably in DOS mode).
2) CALL is for calling another procedure/function with code and optionally passing parameters (data) to that function.

Does this answer your question?

Relvinian

matemp

Is it not possible to call procedures from DOS using CALL instruction and to get the same (as with INT) result?

MAtemp

hutch--

MAtemp,

You are mixing up two different technologies from two different operating system types. Real mode DOS used interrupts for both DOS and BIOS functions but 32 bit protected mode does not. Under ring0 there are some system based interrupts but the are not usually used in application programming.

The CALL mnemonic does not more than store the next IP location, branch to another location and on the next RET/RETN it returns to the IP location after the original CALL.
Download site for MASM32      New MASM Forum
https://masm32.com          https://masm32.com/board/index.php

MichaelW

Quote from: matemp on November 16, 2006, 10:39:33 AM
Is it not possible to call procedures from DOS using CALL instruction and to get the same (as with INT) result?

It is possible, but to make it work you must effectively simulate an INT with a far CALL. There are at least several methods of doing this, but assuming you avoid tying up a segment register and a base or index register, the simulation requires on the order of 9 instructions. For repeated calls, if the interrupt vector (a far pointer to the interrupt handler) had already been copied to your data segment, each simulation would require 3 instructions:

pushf
cli
call int_ptr

eschew obfuscation

matemp

Thanks!
                        MAtemp