help!!!!!!!!!!!!!!! about inline assemble
-
i hv used inline assemble which hv been showed below: do{ for(int test=0;test<5000;test++);// reach the high output to send a read data properly __asm{//the normal case which used to transfer the data ///* mov dx,portaddress mov bx,data mov cx,i //need to shift it to the large register bt bx,cl jc Current_Bit2_Is_1 Current_Bit2_Is_0: /* mov al,00000010b mov cx,10h loop_label7: out dx,al loop loop_label7*/ mov al,11111101b mov cx,25h loop_label8: out dx,al loop loop_label8 mov al,11111111b mov cx,35h loop_label9: out dx,al loop loop_label9 mov al,11111101b mov cx,25h loop_label7: out dx,al loop loop_label7 jmp END2 //jump without any condition Current_Bit2_Is_1: mov al,11111101b mov cx,25h loop_label1: out dx,al loop loop_label1 mov al,11111001b mov cx,35h loop_label2: out dx,al loop loop_label2 mov al,11111011b mov cx,35h loop_label3: out dx,al loop loop_label3 mov al,11111001b mov cx,25h loop_label4: out dx,al loop loop_label4 mov al,11111101b mov cx,25h loop_label5: out dx,al loop loop_label5 END2: } for(test=0;test<7000;test++); __asm{ mov dx,portaddress mov al,11111101b out dx,al } i--; }while(i>=0); if i just use like this then no problem. but when i use inline assemble in another part of my program, it always make the program hang. if(i==-1){ __asm{ mov dx,portaddress mov bx,data mov al,00000010b mov cx,10h loop_labelA: out dx,al loop loop_labelA mov al,00000000b mov cx,15h loop_labelB: out dx,al loop loop_labelB mov al,00000010b mov cx,10h loop_labelC: out dx,al loop loop_labelC } } this one is just under the while statement.....but it always make the program hang. i really dont know what is the problem in here. is there anyone know how to solve it?:doh: thank u in advance!!!!!:)
-
i hv used inline assemble which hv been showed below: do{ for(int test=0;test<5000;test++);// reach the high output to send a read data properly __asm{//the normal case which used to transfer the data ///* mov dx,portaddress mov bx,data mov cx,i //need to shift it to the large register bt bx,cl jc Current_Bit2_Is_1 Current_Bit2_Is_0: /* mov al,00000010b mov cx,10h loop_label7: out dx,al loop loop_label7*/ mov al,11111101b mov cx,25h loop_label8: out dx,al loop loop_label8 mov al,11111111b mov cx,35h loop_label9: out dx,al loop loop_label9 mov al,11111101b mov cx,25h loop_label7: out dx,al loop loop_label7 jmp END2 //jump without any condition Current_Bit2_Is_1: mov al,11111101b mov cx,25h loop_label1: out dx,al loop loop_label1 mov al,11111001b mov cx,35h loop_label2: out dx,al loop loop_label2 mov al,11111011b mov cx,35h loop_label3: out dx,al loop loop_label3 mov al,11111001b mov cx,25h loop_label4: out dx,al loop loop_label4 mov al,11111101b mov cx,25h loop_label5: out dx,al loop loop_label5 END2: } for(test=0;test<7000;test++); __asm{ mov dx,portaddress mov al,11111101b out dx,al } i--; }while(i>=0); if i just use like this then no problem. but when i use inline assemble in another part of my program, it always make the program hang. if(i==-1){ __asm{ mov dx,portaddress mov bx,data mov al,00000010b mov cx,10h loop_labelA: out dx,al loop loop_labelA mov al,00000000b mov cx,15h loop_labelB: out dx,al loop loop_labelB mov al,00000010b mov cx,10h loop_labelC: out dx,al loop loop_labelC } } this one is just under the while statement.....but it always make the program hang. i really dont know what is the problem in here. is there anyone know how to solve it?:doh: thank u in advance!!!!!:)
Did you consider that the loop variable test may be optimised to register variable and your inline code is currupting it.
MSN Messenger. prakashnadar@msn.com