Line Feed issue in assembler using Win XP

Reply

Join Date: Mar 2005
Posts: 1
Reputation: simf is an unknown quantity at this point 
Solved Threads: 0
simf simf is offline Offline
Newbie Poster

Line Feed issue in assembler using Win XP

 
0
  #1
Mar 23rd, 2005
I have the following problem. Using 16 bit assembler code to send a character string to the screen. Following is an example:

in my data segment, I have the following defined:

Str1 DB 'Hello world', 10
DB 'and hello again','$'

in the Code segment, i do the following:

mov ah,9h
mov dx,offset Str1
int 21h

this should create the following output:

Hello world
and hello again

However, I am getting:

Hello world
and hello again

In other words, the linefeed value (the decimal 10) should just cause the second line of output to drop straight down, but it is affecting a line feed and carriage return.
The strange thing is, this problem only occurs when I run this code under Win 2000 or Win XP; when this SAME code runs under Win 98 or Win ME, it works as it is supposed to. This is not just on my machine; I teach an assembler class and the same is true for all my students - run the code under Win 98 or Win ME and it is fine; under Win 2000 or Win XP and the new line of output always starts at the beginning of the next line even though the code only sees a line feed and NOT a carriage return.
I've searched the net and can find no explanation for this.
Anyone have any ideas?
Thanks.
sim
Reply With Quote Quick reply to this message  
Join Date: Feb 2005
Posts: 195
Reputation: Tight_Coder_Ex is an unknown quantity at this point 
Solved Threads: 13
Tight_Coder_Ex's Avatar
Tight_Coder_Ex Tight_Coder_Ex is offline Offline
Junior Poster

Re: Line Feed issue in assembler using Win XP

 
0
  #2
Mar 23rd, 2005
XP/NT/2000 have restructured the way DOS works, and many people have complained too that after installing SP2, QBasic and other programs won't work. Virus writers have depended extensively in the past using DOS and more particularly dropping into BIOS to circumvent kernel code.
Reply With Quote Quick reply to this message  
Reply

This thread is more than three months old.
Perhaps start a new thread instead?
Message:


Thread Tools Search this Thread



About Us | Contact Us | Advertise | DaniWeb | Acceptable Use Policy | RSS Feed

©2003 - 2009 DaniWeb® LLC