hi,
I have to do a task and i have to write an assembly lanuage program to read in a series of pairs of numbers and for each pair output the sum and the difference. That's my code already pls help i have no idea:
BR main ; Branch around data
sum: .WORD 0x0000
num1: .BLOCK 2 ; Set up a block for num1
num2: .BLOCK 2 ; Set up a block for num2
msg1: .ASCII " Enter two numbers : \x00"
msg2: .ASCII " The sum is :\x00"
msg3: .ASCII " The difference is :\x00"
letter: .BLOCK 1
main: LDA num1,d
LDA num2,d
while:STRO msg1,d
DECI num1,d ; Read and store num1
ADDA num1,d
DECI num2,d ; Read and store num2
ADDA num2,d
;output the sum
STRO msg2,d
STA sum,d ; Store the sum
DECO sum,d ; output sum
; output the difeerence
STRO msg3,d
SUBA num2,d
BR while
BREQ quit
quit: STOP ; Stop the processing
.END ; End of the program