help! inline assemble
-
hi guys, is there any tutorials relate to how to pass variables from normal c++ program to inline assemble? and how to change it from character form or integer form to binary form? thank u very much in advance! =)
humm
main()
{
int x=6;
asm
{
mov ax,x;
mov x,69;
}
}This doesnt work??
P.R.A.K.A.S.H
-
humm
main()
{
int x=6;
asm
{
mov ax,x;
mov x,69;
}
}This doesnt work??
P.R.A.K.A.S.H
-
but when i use main() { int x=6; asm{ mov dx,37Ah mov al,x out dx, al } } i always get a error message "operand size conflict".. i really dont know wat's going wrong in here, since it's my first time to use inline assemble thank u =)
jfk_lili wrote: mov al,x its wrong, al is 8 bit, int is 16 bit, you should do mov ax,x out dx,al
P.R.A.K.A.S.H
-
jfk_lili wrote: mov al,x its wrong, al is 8 bit, int is 16 bit, you should do mov ax,x out dx,al
P.R.A.K.A.S.H
-
but after i hv changed the code to wat u suggest, it still got such a error message. relate to "out dx,al". it's still a "operand size error"
Gees I dont know why its not compiling :confused: i know the instructino is valid. sorry i cant help you more, i am out of ideas:-O
P.R.A.K.A.S.H
-
Gees I dont know why its not compiling :confused: i know the instructino is valid. sorry i cant help you more, i am out of ideas:-O
P.R.A.K.A.S.H
-
Gees I dont know why its not compiling :confused: i know the instructino is valid. sorry i cant help you more, i am out of ideas:-O
P.R.A.K.A.S.H
-
now i hv found the reason for the error, the machine is 32 bit, so the int is actually 32 bit long, to get 16 bits, we need to declare it as "short int" :-D thank U Prakash
Good!!! I learned something new today :-)
P.R.A.K.A.S.H