Tuesday, September 25, 2012

X86 Assembly MS DOS int 21h 0x09 wierdness

Hello everyone, I know this is a Linux forum but I was wondering if anyone could tell me why the below code acts oddly with DOS printing function? Program is compiled using NASM with nasm -o test.com test.asm. I am running the program in a command prompt on windows 7 but have also tested it with a win98 boot disk and I get the same result?

Here is the code

Code:

 
 org 100
 bits 16 
 
  
 
 section .data 
 garbage: db "zzzzzzzzzzzzzzzzzzzzzzzzzzzzzz" 
 message: db "Good message." ,'$'
 
 
 section .text
 
 
 mov ah, 0x09 
 mov dx, message
 int 21h 
 
 xor ax, ax 
 int 21h
Here is the output

Code:

F:\OS_Files>test.com
 
              ?       ?? ?!1??! zzzzzzzzzzzzzzzzzzzzzzzzzzzzzzGood message.
 F:\OS_Files>

Source: http://feedproxy.google.com/~r/linuxquestions/latest/~3/lDn5857ZcnU/showthread.php

georgia bulldogs football rashard mendenhall rachel zoe penn state football mt rainier national park rose parade mount rainier national park

No comments:

Post a Comment