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

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!