.ORIG x3000

;Getting first sentence out put.
LEA R0,MESG1 ;load the address of the message string
TRAP x22 ;"PUTS" outputs a string

;Get character
GETC
PUTC

;put first input to r1
ADD R1, R0, #0;

LEA R0,MESG2 ;load the address of the message string
TRAP x22 ;"PUTS" outputs a string

;Get character
GETC
PUTC

;put second input to r2
ADD R2, R0, #0;

LEA R0,MESG3 ;load the address of the message string
TRAP x22 ;"PUTS" outputs a string

;print the result

ADD R0, R1, #0
PUTC

LEA R0,MESG4 ;load the address of the message string
TRAP x22 ;"PUTS" outputs a string

ADD R0, R2, #0
PUTC

LEA R0,MESG5 ;load the address of the message string
TRAP x22 ;"PUTS" outputs a string

;Do the calculation

LD R6, SUBB
NOT R6, R6
ADD R6, R6, #1
ADD R1, R1, R6	;Get the integer value of first value
ADD R2, R2, R6	;Get the integer value of first value

ADD R1, R2, R1	;Add value together

LD R6, SUBB
ADD R1, R1, R6

AND R0, R0, #0
ADD R0, R0, R1

PUTC

HALT
MESG1 .STRINGZ "\nThis program adds two single-digit numbers together and prints the result.\nPlease type in a number: "
MESG2 .STRINGZ "\nPlease type in another number: "
MESG3 .STRINGZ "\nResult: "
MESG4 .STRINGZ " + "
MESG5 .STRINGZ " = "
SUBB   .FILL   48           ; Value of 1st number

.END