Mail Archives: djgpp/1997/08/30/15:32:16
Egg Brains wrote:
>i can't print text to the string using asm. it prints, but not the stuff i
>want (just a bunch of garbled ascii characters with beeps and stuff.)
>here is the code i am/was using...
><-----start----->
>char *myHappy; /* i have also tried using a character */
>void main()
>{
>myHappy = "Hello, world!";
>asm("movw _myHappy, %dx");
>asm("movb $9, %ah");
>asm("int $0x21");
>}
><-----end----->
>Thanx...
> Paul
>P.S. is this because of the p-mode & passing data to the conventional
>memory etc...?
Despite of other bugs pointed out by other people you are right that the
asm wan't work because of dos expects it to be in es:dx (or ds:dx ? don't
have the documentation about me) and this must be real mode pointer (and it
of course isn't in your example). Can't see any reason why you would want to
do that though, I agree with the other guy that printf is good enough.
Michal 'MiMe' Mertl
e-mail:XMERM05 AT vse DOT cz
- Raw text -