Solve the following Assembly Language questions. Only implementing the codes wil
ID: 3874845 • Letter: S
Question
Solve the following Assembly Language questions. Only implementing the codes will be enough, i.e. without adding main PROC or END main:Appreciated... Convert the following arithmetic expression to sembly code. (VAR1 is SDWORD) Q2. Implement the following pseudo code in assembly. (INT1 and INT2 are SDWOrD) Fori-1 to 5 do 0) while (ax- bx) and (cx If (ax - dx) dxdx 1 Else .3 How many bytes of wasted space will there be when storing 27.500-byte file if a disk has a cluster size... u) 2 sectors b) 4 sectors c) 8 sectors
Explanation / Answer
Question 1 is not completely visible.
Solution 2:
Assembly Code:
xor cx,cx ; cx-register is the counter, set to 0
inc cx ; increment cx to 1
L1: ; for loop starts
jmp C1 ; jump to while condition first
L2: ; while loop starts
cmp ax,dx ; compare ax and dx
jl E1 ; jump to else condition is ax < dx
dec dx ; decrement dx
jmp C1 ; jump to while condition
E1: ; else case
inc ax ; increment ax
C1: ; while condition
cmp ax,bx ; compare ax and bx
jge EXIT ; while loop exit if ax >= bx
cmp cx,0 ; compare cx to zero
jne L2 ; jump to L2 if both the condition satisfies else exit the while loop
EXIT: ; while loop exit
inc cx ; increment cx
cmp cx,5 ; compare cx to 5
jle L1 ; jump to L1 if cx <= 5
Related Questions
drjack9650@gmail.com
Navigate
Integrity-first tutoring: explanations and feedback only — we do not complete graded work. Learn more.