Assembly in VC 6 ++
Hi
I''m tryng to make a little assembler function inside VC, and i keep getting a stupid compilation error.
The error is:
D:\diske\test.cpp(463) : error C2415: improper operand type
being the line 463 the last assembler line.
If i delete that line, then the compiler will go to the previous line, and so on, until i have no assembler code.. lol
With _asm before each line, the result is the same., do i have to
setup visual c, somewhere, so that i can compile asm inline code?
thanks
My code, is the following:
void drawH(int ymin,int ymax,int y)
{
int i=ymin;
__asm
{
um:
mov ax,1
mov sbuffer[y],1
cmp i,ymax
jne um
}
}
thanks
Bruno
If it''s anything like Borland, it should be like this:
void drawH(int ymin,int ymax,int y)
{
int i=ymin;
__asm {
um:
mov ax,1
mov sbuffer[y],1
cmp i,ymax
jne um
}
Notice the squigily bracket just after __asm
void drawH(int ymin,int ymax,int y)
{
int i=ymin;
__asm {
um:
mov ax,1
mov sbuffer[y],1
cmp i,ymax
jne um
}
Notice the squigily bracket just after __asm
Just a thought: do you have a ";" after it all?
like:
??
BTW, I have no experiense of assembler in VC++
like:
__asm{//code};
??
BTW, I have no experiense of assembler in VC++
It''s been a long time ago since I''ve done assembly, but I think this will compile:
btw. Just a question, why are you filling sbuffer with one byte at a time?
void drawH(int ymin, int ymax, int y){ int i=ymin; __asm { um: mov ax, 1 mov WORD PTR [sbuffer+y], 1 cmp i, ymax jne um }}
btw. Just a question, why are you filling sbuffer with one byte at a time?
Hi
thanks for the replys.
I have just started assembler., i''m filling one byte at a time, because i still don''t know a fast way to do it
I still can''t compile, i tried everything you guys said, my compiler simply refuses any assembler command.. , any ideias ???
thanks for the replys.
I have just started assembler., i''m filling one byte at a time, because i still don''t know a fast way to do it
I still can''t compile, i tried everything you guys said, my compiler simply refuses any assembler command.. , any ideias ???
This works :D. I think it''s an endless loop though . I don''t know much asm at all. I learned just enough to understand adresses and values for pointers.
__asm { um: mov ax, 1 add ax, 2 jmp um }
sbuffer's global?
I don't think you can do a [][] in asm
You have to do it in multiple steps, [][] takes 2 derefences
Edited by - Magmai Kai Holmlor on October 7, 2000 8:29:29 PM
I don't think you can do a [][] in asm
You have to do it in multiple steps, [][] takes 2 derefences
Edited by - Magmai Kai Holmlor on October 7, 2000 8:29:29 PM
Hmm.. don''t the labels have to be outside the brackets?
like:
void drawH(int ymin,int ymax,int y)
{
int i=ymin;
um:
__asm
{
mov ax,1
mov sbuffer[y],1
cmp i,ymax
jne um
}
like:
void drawH(int ymin,int ymax,int y)
{
int i=ymin;
um:
__asm
{
mov ax,1
mov sbuffer[y],1
cmp i,ymax
jne um
}
This topic is closed to new replies.
Advertisement
Popular Topics
Advertisement