Question: Answer Fully with details Write a program to print Hello, ', World. Discussion: This lab is going to do the same thing that assignment #01




Answer Fully with details
Write a program to print "Hello", '", "World". Discussion: This lab is going to do the same thing that assignment \#01 did but we will do it in three steps using two procedures. This will introduce procedures early but is not a good thing to do for such a simple program. For instance, do not call a routine to call a routine. Procedures are created with the PROC/ENDP pseudo-ops. Ma in is a procedure but it returns to the operating system using the exit. Other procedures use the ret instruction. PSEUDOCODE SOLUTION: i start ; Print "Hello", ", "World" ; Stop Discussion: 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 outputs to the screen the single character contained in the AL register. The CRLF routine will output to the screen a CR and LF. PROGRAM: TITLE L01 Discussion: 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 outputs to the screen the single character contained in the AL register. The CRLF routine will output to the screen a CR and LF. PROGRAM: TITLE L01 ; Print "Hello" ; input: none ; output: none prtHello PROC ; Enter ; Print "Hello" ret i Exit prthello ENDP ; Print "World" i input: none ; output: none prtWorld PROC ; Enter ; Print "World" ret ; Exit prtworld ENDP END main
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
