Welcome, Guest. Please login or register.

Author Topic: Arghhh What is wrong with this asm code? (must be something stupid...)  (Read 4600 times)

Description:

0 Members and 1 Guest are viewing this topic.

Offline Thomas

Quote
Arghhh What is wrong with this asm code? (must be something stupid...)


Yes.

Code: [Select]
move.l consolename,d1

There are two erros in this single line.

it should either read

Code: [Select]
move.l #consolename,d1

or

Code: [Select]
lea consolename(pc),a0
move.l a0,d1


First error is that you load the contents instead of the address into d1, second error is that consolename is on an odd address which makes move.l fail on a 68000 ("dos.library",0,0 are 13 bytes).

And of course I totally agree that leading error: into text is not a very user friendly handling. And I also agree that with C this would be a trivial.

Code: [Select]

#include
int main (void)
{
BPTR f;
if (f = Open("con:/[b][/b]///bla/CLOSE/WAIT",MODE_OLDFILE))
   {
   Write (f,"whatever",8);
   Close (f);
   }
return (0);
}


Bye,
Thomas