assembly and c code problem please help
-
the problem in this code is that it can't compile it when "A" is defined as "int" "C:\Documents and Settings\simon\Desktop\the program.cpp(34) : error C2443: operand size conflict" in my program A is in the range of 1-512 in decimal so thier is no problem with the size. so how i force it to compile? or how i change the program to compile it? void light_port_b(int A) { _asm { mov Dx,PORTB Mov Al,A Out Dx,Al } }
-
the problem in this code is that it can't compile it when "A" is defined as "int" "C:\Documents and Settings\simon\Desktop\the program.cpp(34) : error C2443: operand size conflict" in my program A is in the range of 1-512 in decimal so thier is no problem with the size. so how i force it to compile? or how i change the program to compile it? void light_port_b(int A) { _asm { mov Dx,PORTB Mov Al,A Out Dx,Al } }
Ints are 32 bits nowadays, and AL is a 16 bit reg. Change it to unsigned short. Odd forum for a programming question by the way :) Ryan
-
Ints are 32 bits nowadays, and AL is a 16 bit reg. Change it to unsigned short. Odd forum for a programming question by the way :) Ryan
-
Oops. Teach me to answer questions when drunk. I'll leave my stupidity for prosperity :O Ryan