Answered step by step
Verified Expert Solution
Question
1 Approved Answer
Aswer and explain fully with details Write a program to print Hello World. Example run: Hello World. Discussion: Assembly language is writing in a specific
Aswer and explain fully with details
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: IITLE, 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 Irvine 32 . ine - data mylame BYTE "Iisa Perez" Note: ITLE, NNCUDE, . 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: TIILE alignment specifics INCUUDE Irvine32. 1nc - data mylame BYTE "Lisa Perez" . code main PROC ; start mytabel: 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 Discussion: 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 mag BYTE "Hello World", o In the .code section we move the address of the message to EDX and call author's routine. . code lea EDX,mgg call Writestring The actual program does this a little differently than the above but is equal. EQU, '=', ETEQU 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 LE. 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 HO1 ; Lisa Perez ; Print "Hello World" ; zasignment HOL ; 9/1/21 INCLUDE Irvine32.ine CR=13 IF EQU 10 ; Question: What is the difference between = and EQU? ; Answer: mag TEXTEQU ; Question: What is the difference between EQU and TEXTEQU? ; Answer: . data hellolsg BYTE meg . code main PROC ; Start call Clracr mov EDX, OEFSET helloMag ; Print "Hello Norld" eall Writestring exit ; Stop main ENDP END manStep 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