Mail Archives: djgpp/1997/08/26/01:22:22
Egg brains <eggbrains AT aol DOT com> 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 */
^^^^^^^^^^^^^^ (1)
> void main()
^^^^^^^^^^^ (2)
> {
> myHappy = "Hello, world!";
^^^^^^^^^^^^^^^^^^^^^^^^^^ (3)
> asm("movw _myHappy, %dx");
> asm("movb $9, %ah");
> asm("int $0x21");
> }
> <-----end----->
1: No memory is allocated that this pointer points to.
2: main() -always- returns an int.
3: you're assiging a string to a variable, but this string really has no
storage allocated for it.
I think also your asm is questionable... is there something wrong with
printf that you can't print strings with it?
--
[- firewind -]
[- email: firewind AT metroid DOT dyn DOT ml DOT org (home), firewind AT aurdev DOT com (work) -]
[- "You're just jealous because the voices talk to -me-." -]
- Raw text -