DaniWeb IT Discussion Community

DaniWeb IT Discussion Community (http://www.daniweb.com/forums/index.php)
-   Assembly (http://www.daniweb.com/forums/forum125.html)
-   -   Line Feed issue in assembler using Win XP (http://www.daniweb.com/forums/thread20744.html)

simf Mar 23rd, 2005 11:21 am
Line Feed issue in assembler using Win XP
 
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

Tight_Coder_Ex Mar 23rd, 2005 12:59 pm
Re: Line Feed issue in assembler using Win XP
 
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.


All times are GMT -4. The time now is 9:33 pm.

Forum system based on vBulletin Copyright ©2000 - 2009, Jelsoft Enterprises Ltd.
©2003 - 2009 DaniWeb® LLC