;---------------------------------------------------------------------- ; Task :Introduction to Assembly Programming ; Date :29 Aug 2000 ; By :S. L. Phung ID: ####### ; File :Ex.asm ; To compile ; TASM Ex.asm; ; TLINK /t Ex ; To run is simply ; Ex ;---------------------------------------------------------------------- .MODEL SMALL CommonSeg SEGMENT ASSUME CS:CommonSeg,DS:CommonSeg ORG 100h Entry: jmp Start ;---------------------------------------------------------------------- ;Data Area: ;--------- ;YOUR DATA GO HERE Message DB "Hello World!", 0Dh, 0Ah, '$' ; Message to be displayed Count EQU $-Message ; Message length ;---------------------------------------------------------------------- ;Code Area: ;---------- Start: mov AX, CS ; Initialise segment registers mov DS, AX ; DS, SS points to the common segment mov SS, AX ; ;---------------------------------------------------------------------- ;YOUR CODE GOES HERE mov DX, OFFSET Message; Pass parameter to subroutine call DisplayMsg ; Display the message mov AH, 0 ; Wait for a key press int 16h ; using interrupt 16h function 0 ;---------------------------------------------------------------------- ExitToDos: ; Exit program mov AH,4Ch ; Function 4Ch mov AL,0 ; Return code 0 int 21h ; Interrupt 21h ;---------------------------------------------------------------------- ;Subroutines used: ;----------------- ;YOUR SUBROUTINES GO HERE DisplayMsg PROC NEAR ;Procedure to display an $-terminated string ;Input: ; DX: points to the start of the string mov AH, 9h ; Display using function 9h int 21h ; Interrupt 21h ret ; End of subroutine DisplayMsg ENDP ;---------------------------------------------------------------------- CommonSeg ENDS END Entry