0% found this document useful (0 votes)
2 views1 page

Assignmernt cs501

Uploaded by

chsumaira506
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
2 views1 page

Assignmernt cs501

Uploaded by

chsumaira506
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
You are on page 1/ 1

Task A:

LDR R0, 114 ; Load initial account balance (3000 cents) from memory address 114 into register R0

MOV R1, #2000 ; Load bonus amount (2000 cents, representing $20.00) into register R1

ADD R0, R0, R1 ; Add bonus to account balance in R0 (3000 + 2000 = 5000)

LDR R2, 118 ; Load salary deductions ( 1500 cents) from memory address 118 into register R2

SUB R3, R0, R2 ; Compute new balance after deductions, store result in R3(5000 – 1500 = 3500)

Task B:

In task B, we apply a penalty of 500 cents ( representing $5.00) to the balance obtained in Task A.

1. Starting Balance (from Task A): 3500 cents ( or $35.00)


2. Apply Penalty: Subtract 500 cents( or $5.00)
3. Final balance: 3500 – 500 = 3000 cents ( or $30.00)

Code

Task B: Penalty Deductions


MOV R4, #500 ; Load penalty amount (500 cents) into register R4

SUB R3, R3, R4 ; Deduct penalty from the balance in R3 (3500 – 500 = 3000)

; At this point, R3 holds the final balance of 3000 cents ( representing $30.00)

So, after all adjustments, the final balance is 3000 cents, which represents $30.00

You might also like