Code 501
Code 501
.ORG 100
ADDI R1, R1, 2000 ; Add bonus of 2000 cents ($20.00), R1 = 5000
دوسرا
; Task A: Calculate the new account balance after bonus and fine deduction
; Load the initial account balance from memory address 114
MOV AX, [114] ; AX register holds the account balance (3000 cents)
MOV BX, [118] ; BX register holds the fine amount (1500 cents)
; This part may vary depending on the system, so here it’s abstractly represented
END_PROGRAM:
تیسرا
Section .data
Section .text
Call print_number
; Exit program
Int 0x21
Print_number:
Push ax
Mov cx, 0
Next_digit:
Mov dx, 0
Push dx
Inc cx
Test ax, ax
Jnz next_digit
Print_digits:
Pop dx
Int 0x21
Loop print_digits
Pop ax
Ret
Section .data
Ten dw 10