Question
ASSEMBLY LANGUAGE - I really need help with this problem Write a Program to print Hello, ' ' , World. (3 steps - 2 procedures)
ASSEMBLY LANGUAGE - I really need help with this problem
Write a Program to print "Hello", ' ' , "World".
(3 steps - 2 procedures) Procedures are created with the PROC/ENDP pseudo-ops.
To print the message we will use the author's routines, WriteString, WriteChar and CRLF. The WriteString routine will output to the screen any character data pointed to by the EDX register. It will continue to print until it runs into the null character (zero). The WriteChar routine output to the screen the single character contained int he AL register. The CRLF routine will output to the screen a CR and LF.
CODE:
.data
helloMsg BYTE "Hello", 0
worldMsg BYTE "World", 0
.code
main PROC ; Start
call Clrsrn
call prtHello ; PRINT "Hello", ' ', "World"
mov AL, ' '
call WriteChar
call prtWorld
call CRLF
exit ; Stop
main ENDP
; **********************************************
; Print "Hello"
; input: none
; output: none
;******************************************************
prtHello PROC
mov EDX, OFFSET helloMsg ; Print "Hello"
call WriteString
ret ; Exit
prtHello ENDP
; ****************************************************
; Print "World"
; input: none
; output: none
;******************************************************
prtWorld PROC ;Enter
mov EDX, OFFSET worldMsg ;Print "Hello"
call WriteString
ret ;Exit
prtWorld ENDP
END main
Step by Step Solution
There are 3 Steps involved in it
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started