domingo, 20 de maio de 2007

Work with INT21 to handle strings files on Assembler

What are Interupts ?
Interrupt is an external event that takes the processor to stop current program in execution, and execute a certain code block called interrupt routine (normally they occur due I/O operations )
When the interrupt ends, control is passed to the program that has been interrupted, exactly at the point where interrupt started.
On Assembler interrupts ocurr when use the reserved expression INT21. It makes part of the vectors interrupts table like others (it starts on 00h until FFh), as you can see on table vectrores just low

To undertand what we are doing let me wite a sample programe in C (i build it on Dev-C++)

Check the code
Now lets build a similiar code using Assembler
Check if you try to test this code it won´t work, just like this. It needs somethig on top and low of this code.It is the code that is needed to run any application on assembler .
Think on it as the #include on C.
The code right next will print a message on sreen like the program in C does.
But before show the code , you will need a table more to see how

The code in assembler to display an message

Check that you have to declare the variable to store the message, rigt after this code, like this

Lets now use IN21 to create files

The same application on C