Question: 3-9. Write an Assembly Language program that will sum three ASCII characters. Prompt and input three characters from the user into three labels. Add the
3-9. Write an Assembly Language program that will sum three ASCII characters. Prompt and input three characters from the user into three labels. Add the integer ASCII values of those three characters and store the result. Output the integer sum in decimal with a label telling what you are printing. Include a blank line between input and output. I have this so far in my assignment but I get an invalid operation at num1 db ? I'm not sure why this is please help me with any corrections that must be made.
CODE:
;DATA SEGMENT
NUM1 DB 0 NUM2 DB 0 RESULT DB 0 Msg1 DB 10,13 "Enter First number to add: $" msg2 DB 10,13 "Enter the second number to add: $" msg3 DB 10,13 "Result of addition is: $" ends
;Code segment ASSUME DS:DATA CS:CODE start: mov ax,DATA mov DS,AX lea DX,msg1 mov AH,09H int 21H sub AL,30H mov num1,AL lea DX,msg2 mov alt,09H int 21H SUB AL,30H mov num2,AL ADD AL,num1 MOV Result,AL mov AH,0 AAA ADD AH,30H ADD AL,30H mov BX,AX lea DX,msg3 mov AH,09H
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
