Assuming all the variables are declared as sdword write asse
Assuming all the variables are declared as sdword, write assembly language instructions to implement each of the following C statements or segments :
A. i = 1;
B. x = y;
C. c = 2; b = c; a = b;
D. x = y = 1;
Solution
mov i,1 ;Move 1 to variable i
B. x = y
mov eax,y ;Move Y value to temporary register
mov x,eax ;Move temporary register value to x
C. c = 2; b = c; a = b;
mov c,2 ;Move value 2 to variable c
mov eax,c ;Move value in c to temporary register
mov b,eax ;Move temporary register value to b
mov a,eax ;Move temporary register value to a
D. x = y = 1;
mov x,1 ;Move 1 to variable x
mov y,1 ;Move 1 to variable y
