Academic Integrity: tutoring, explanations, and feedback — we don’t complete graded work or submit on a student’s behalf.

Need help with Assembly language. Using Code warrior nd trying to solve this pro

ID: 3789429 • Letter: N

Question

Need help with Assembly language. Using Code warrior nd trying to solve this problem.

Need this in assembly language and comments to help understand

example) LDAA $1200

1. Write a program to add two 32-bit numbers stored at $1200-$1203 and $1204-S1207, and save the sum at $1211-1214. Since the result could be 33 bits if a carry out bit is gener need another byte to save the carry bit. Please check the bit C in the CCR register at the end of the calculation. If bit C is set, put 401 at the memory location $1210, otherwise, put #00 there.

Explanation / Answer

%Assembly program to add to numbers

push rbp
mov rbp, rsp
mov DWORD PTR [rbp-4], 5 % push 5 into register
mov DWORD PTR [rbp-8], 3 % push 3 into register
mov eax, DWORD PTR [rbp-8]
mov edx, DWORD PTR [rbp-4]
lea eax, [rdx+rax]
mov DWORD PTR [rbp-12], eax
mov eax, 0
leave
ret