In: Computer Science
Write an assembly language program that will print out the message of your choosing
#NOTE #write in a simple way, so that i can execute it from command window using masm
Answer:
;x8086 assembly program for printing a message on screen
DATA SEGMENT
MSG DB 'Hello World $' ;declaring a string
DATA ENDS
CODE SEGMENT
ASSUME CS:CODE, DS:DATA
BEGIN:
MOV AX,DATA ; DATA is moved to AX register
MOV DS,AX : contents of AX is moved to data segment
LEA DX, MSG ; loads the effective address of the string into register DX
MOV AH, 09 ; DOS function call to print a string
INT 21H ; DOS interupt function
CODE ENDS
END BEGIN
-----------------------------------------------------------------------------------------------------------------------------------------