🔒 Locked
what's wrong?
Advertisement
Original Post
All I can say is that this is completely wrong assembly. You should do:
This is as far as I understand from your code. I hope this gives you some idea.
[edited by - mathematix on February 2, 2004 9:00:01 AM]
asm{
mov ax, 0x0005
mov bx, ax
add ax, 0x0005
mov dx, ax
}
This is as far as I understand from your code. I hope this gives you some idea.
[edited by - mathematix on February 2, 2004 9:00:01 AM]
Mathematix:
well, all you can say is wrong, this is not completely wrong assembly. all compilers on earth are not VC++ and do not necessarily use intel''s asm syntax (although I really prefer intel''s syntax), that syntax looks like GNU asm syntax (AT&T?), the one used in GCC.
jmg5 > replace the opening and closing braces by parenthesis. (assuming DevC++ uses the gnu asm syntax)
quote:
All I can say is that this is completely wrong assembly. You should do:
well, all you can say is wrong, this is not completely wrong assembly. all compilers on earth are not VC++ and do not necessarily use intel''s asm syntax (although I really prefer intel''s syntax), that syntax looks like GNU asm syntax (AT&T?), the one used in GCC.
jmg5 > replace the opening and closing braces by parenthesis. (assuming DevC++ uses the gnu asm syntax)
quote:
Original post by sBibi
Mathematix:quote:
All I can say is that this is completely wrong assembly. You should do:
well, all you can say is wrong, this is not completely wrong assembly. all compilers on earth are not VC++ and do not necessarily use intel''s asm syntax (although I really prefer intel''s syntax), that syntax looks like GNU asm syntax (AT&T?), the one used in GCC.
jmg5 > replace the opening and closing braces by parenthesis. (assuming DevC++ uses the gnu asm syntax)
All I can say is, sBibi, on reading the original post I didn''t kow what the hell I was doing.
quote:
Sorry, but that''s just stupid (and I''m being nice). So you''re just guessing the notation and can''t figure why it won''t work. Well, the compiler is not a oracle who can understand every imaginary syntax you input to it. I hope this is a joke.
No, it wasn''t a joke. I was using gnu syntax (and i''m not quite familiar with it, as you can tell) and figured it''d be the same, but wasn''t quite sure.
sBibi, thanks. I replaced ''em with parentheses and it worked.
quote:
Original post by Mathematix
All I can say is that this is completely wrong assembly. You should do:
asm{
mov ax, 0x0005
mov bx, ax
add ax, 0x0005
mov dx, ax
}
This is as far as I understand from your code. I hope this gives you some idea.
[edited by - mathematix on February 2, 2004 9:00:01 AM]
dev-C++ uses AT&T not INTEL. OH and the command for ASM in DEv-C++ is __asm thats 2 underscores
TAKEN FROM THE DEV-C++ FAQ!1~
How to use assembly with Dev-C++ ?
The "GNU as" assembler uses AT&T syntax (not Intel). Check out this page for more information.
Here's an example of such a syntax :
// 2 global variables
int AdrIO;
static char ValIO;
void MyFunction(..........)
{
__asm("mov _AdrIO, %dx") ; // loading 16 bits register
__asm("mov _ValIO, %al") ; // loading 8 bits register
/*
Don't forget the underscore _ before each global variable names !
*/
__asm("mov %ax,%dx") ; // AX --> DX
}
[edited by - DerAngeD on February 2, 2004 5:56:44 PM]
quote:
Original post by DerAngedquote:
Original post by Mathematix
All I can say is that this is completely wrong assembly. You should do:
asm{
mov ax, 0x0005
mov bx, ax
add ax, 0x0005
mov dx, ax
}
This is as far as I understand from your code. I hope this gives you some idea.
[edited by - mathematix on February 2, 2004 9:00:01 AM]
dev-C++ uses AT&T not INTEL. OH and the command for ASM in DEv-C++ is __asm thats 2 underscores
TAKEN FROM THE DEV-C++ FAQ!1~
How to use assembly with Dev-C++ ?
The "GNU as" assembler uses AT&T syntax (not Intel). Check out this page for more information.
Here's an example of such a syntax :
// 2 global variables
int AdrIO;
static char ValIO;
void MyFunction(..........)
{
__asm("mov _AdrIO, %dx") ; // loading 16 bits register
__asm("mov _ValIO, %al") ; // loading 8 bits register
/*
Don't forget the underscore _ before each global variable names !
*/
__asm("mov %ax,%dx") ; // AX --> DX
}
![]()
[edited by - DerAngeD on February 2, 2004 5:56:44 PM]
Yes, you're right.
[edited by - mathematix on February 2, 2004 7:14:55 PM]
Topic Locked
This topic has been locked by a moderator. New replies are not allowed.
Sign in to reply to this topic.
Advertisement