Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

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

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image

Step: 3

blur-text-image

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

Expert Oracle9i Database Administration

Authors: Sam R. Alapati

1st Edition

1590590228, 978-1590590225

More Books

Students also viewed these Databases questions

Question

1. How is the newspaper help to our daily life?

Answered: 1 week ago

Question

1. Prepare a short profile of Mikhail Zoshchenko ?

Answered: 1 week ago

Question

What is psychology disorder?

Answered: 1 week ago