add this to the data section of your program:
message1 db "Sum is 10!!!!$"
;program section ends
add this to the code section:
je finish
;add these 3 lines
mov ah,09h
mov dx,offset message1
Int 21h
;end added lines
finish:
;program section ends
What you're doing here is to define a message in the data section. Then, the three lines you added call a "DOS function." In assembly a DOS function is a service rendered by DOS for application programs. One function is called Function 09h "Display $-terminated string." The function number (here, 09h) is loaded in ah. However, some functions (such as DOS's display string function) need to have other information. For example, Function 09h needs to know the address of the message. It expects the dx register to contain the address, so we load dx using "mov dx, offset message1". The "offset" here is an assembler operator which gives the address of a label (kinda like & in C, although different context).
Note that DOS's Function 09h is "Display $-terminated string." While you can't use it to output dollars and cents, it is very simple and is commonly used even in commercial programs (although most commercial programs use it only for certain error messages)
Note that you will also encounter "BIOS Functions," "NetWare Functions," "Mouse Functions," etc. Most of them are called by loading ah with a function number and issuing an Int <somenumber> where <somenumber> is dependent on what set of functions you are interested in.
With a bit of work you can add other messages, such as:
message2 db "Checking sum of nta1 and nta2$"
message3 db "Checking sum of nta1, nta2, and nta3$"
;program section ends
of course you need to add code to handle these... but hey, it ain't so hard! "Information has a tendency to be free. Which means someone will always tell you something you don't want to know."