; (c) Ray Walshe 2010 ;==================== .model small .data .stack 100h .code ;================= Main Program ============== main: ; Start Main Program call PrintChar ; Call the Printchar Procedure call Exit ; Call the Exit Procedure ; ; ; Start My Procedures ; ==== PRINTCHAR ==== PROC Printchar ; PROCedure to print a character PUSH AX DX ;save AX and DX on the STACK MOV AH, 2 ; Put 2 in AH (Setup Function 2 of INT 21H API) MOV DL, '#' ; Put Character to be printed in DL [# char] INT 21H ; Execute INT 21h API Function POP DX AX ;restore AX and DX from STACK RET ;RETurn back to where CALLed from ENDP Printchar ; ==== EXIT ==== PROC exit ;PROCedure to exit to DOS push ax mov ah,04cH ; Function 4c (Put into AH=4c) int 21h ; INVOKE INT 21h pop ax RET ; RETURN BACK to where CALLed from ENDP exit ; ==== END OF PROCEDURES ==== ; ==== END OF PROGRAM ==== end main ;====================================