About Convert C to Assembly Language Write the following sta
About: Convert C to Assembly Language.
Write the following statement in C, in Assembly language unsigned char i, j, k; j = 10; do This exercise is about Decrement/Increment for counting loop and Shift Left/Right and rotate instructions. {k = k + i; j = j + 1;} while (j ! = 18);//... rest of code ...Solution
Mov j,0AH //constant 10 equivalent Hex value 0A is assigned to memory location j
L1: //beginning of loop
ADD k, i //adds i to value of k
INC j //increments j value
CMP j,#18 //compares the contents of j with 18;
JNE L1 // JNE checks the condition and jumps to loop L1
