Interruption service in assembler (int 21h) and it's behavior (w/OllyDbg)

38 Views Asked by At

Hello, fellow programmers!
I have a stupid (for your lvl) question:
Using "flat assembler" and debugging it using "ollydbg (v2.00.01)"

I have a following code:

format PE

org    100h

start:
       mov eax, 0    ; clear entire register
       mov edx, 0    ; clear entire register
       
       mov ah,  02h  ; define control character 
       mov dl,  'A'  ; character it needs to print to "standart output" (?)
       int      21h  ; interruption service call
       
       hlt

So, with the code above I have 2 problems:

  1. OllyDbg says "Access violation when reading [FFFFFFFF]" when it comes to the line with interruption service call.
  2. I rewrote the code above using mov ah, 05h control character. Still got an error from 1st item.

It would be kind of you to help me solve this two requirements:

  1. Understanding the difference between the "standart output" and "default printer".
  2. Writing a single character to console(?) without using ds register (and any previously defined data).

My greatest thanks to everyone, who reply!

Solved by...
As it comes out, you cannot use direct call of DOS services from Win32 executable.

0

There are 0 best solutions below