I'm not sure how to input a two digit number and actually be able to work with it (add, subtract, AND, etc.). So far I can enter my start and end numbers as strings and use LEA to output the strings, but I need them in registers so I can convert them from ASCII to integers and compute the sum. I think my logic for the sum computation is fine, but I could be wrong. So far I have this:
.ORIG x3000
AND R0, R0, #0 ; clear R0
LEA R2, blankspace ; string space R2
LD R1, pooploop ; loop condition
LEA R0, ENTER
PUTS ; print start number prompt
startloop
GETC
OUT
STR R0, R2, #0
ADD R2, R2, #1
ADD R1, R1, #-1
BRp startloop
LEA R3, deathnote ; string space R3
LD R1, pooploop ; loop condition
LEA R0, END
PUTS ; print end number prompt
endloop
GETC
OUT
STR R0, R3, #0
ADD R3, R3, #1
ADD R1, R1, #-1
BRp endloop
ADD R2, R2, #-12 ; convert
ADD R2, R2, #-12
ADD R2, R2, #-12
ADD R2, R2, #-12
ADD R3, R3, #-12 ; convert
ADD R3, R3, #-12
ADD R3, R3, #-12
ADD R3, R3, #-12
NOT R2, R2 ; negate R2
ADD R4, R3, R2 ; R3 - R2
BRn NEG
NOT R2, R2 ; if end number is greater, negate R2 again
loop
ADD R2, R2, #1 ; increment start number by 1
NOT R2, R2 ; negate R2
ADD R5, R3, R2 ; R3 - (R2+1)
BRz exit ; exit when start number is equal to end number
NOT R2, R2 ; negate R2 if start number is less than end number
AND R5, R2, #1 ;
BRp sum
BRnzp loop
sum
ADD R6, R2, #0
BRnzp loop
exit
NEG LEA R0, ERROR
PUTS
HALT
deathnote .blkw 50
blankspace .blkw 100
pooploop .FILL x02
ENTER .STRINGZ "\nEnter Start Number > "
END .STRINGZ "\nEnter End Number > "
ERROR .STRINGZ "\nERROR! Invalid Entry!"