Question: Who knows about Assembly language codes and with pseudocode comments Write a program to print Hello World. Example run: Hello World Discussion: Assembly language is
Who knows about Assembly language codes and with pseudocode comments



Write a program to print "Hello World". Example run: Hello World Discussion: Assembly language is writing in a specific format. Names and labels are always left justified on the margin. Opcodes and pseudo-op (assembler directives) are always indented in the second column. Operands are always in the third column. Pseudocode comments appear in the fourth column. Note: TITLE, INCLUDE, . data and . code directives are an exception and are lined up on the left margin. Comments always start with a semi-colon. The semi-colon for pseudocode comments always line up with each other. When writing loops and ifs, indents must be made from semi-colon. Indents should be at least two spaces. Comments which are made to clarify code are written starting on the left margin. All programs will be graded on your efforts to adhere to indenting standards. example: TITLE alignment specifics INCLUDE Irvine32. inc . data myName BYTE "Lisa Perez" . code main PROC ; start myLabel: opcode operand ; pseudocode comment ; this is my comment to myself or anyone else reading this ; for the best results use two tabs (size 8) to opcode, one more for operand ; three more tabs to pseudocode comments. Pseudocode is code that is in the form of a language but it is not really a language. We should always solve the problem first logically using pseudocode in the form of any language that you know. I will use a hybrid form using various real language statements. PSEUDOCODE SOLUTION: ; Start ; Print "Hello World" ; Stop To print the message, we will use the author's routine, WriteString. This 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). We need only to move the address into the EDX register and call his routine. To print "Hello World" we would define a string in the .data section: - data msg BYTE "Hello World", 0 In the .code section we move the address of the message to EDX and call author's routine. . code leacallEDX,msgWritestring The actual program does this a little differently than the above but is equal. EQU, '=', TEXTEQU define names which can be used with the value being substituted for the name. Lookup in the ASCII code chart the value represented by CR and LF. In the program I will define these values using the equal (=) and the EQU pseudo-ops. Answer the question that is asked in the program. We will also use the TEXTEQU to demonstrate its usage. PROGRAM: TITLE H01 ; Lisa Perez ; Print "Hello World" ; Assignment H01 ; 9/1/21 INCLUDE Irvine32. inc CR=13 LF EQU 10 ; Question: What is the difference between = and EQU? ; Answer: msg TEXTEQU ; Question: What is the difference between EQU and TEXTEQU? ; Answer: - data helloMsg BYTE msg - code main PROC ; Start call Clrscr mov EDX, OFFSET helloMsg ; Print "Hello World" call writestring exit ; stop main ENDP END main
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
