Question

ASSEMBLY LANGUAGE

Write a program using author's routine, WriteString, to print "Hello World". 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 calll his routine. Lookup in the ASCII code chart the value reqresented 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.

CR 13 LF EQU 10 Question What is the difference between and EQU? Answer msg TEXTEQU Hello World CR LF, 0 Question What about TEXTEQU Answer data hello Msg BYTE msg code main PROC Start call Clr EDX, OFFSET hello Msg Print Hello World mov call Write String exit Stop ma in ENDP END main

0 0
Add a comment Improve this question Transcribed image text
Answer #1

1.what is the difference between = and equ in assembly language?

"=" isused for assign the value or variable.

EQU:

The EQU directive is used to replace a number by a symbol.

For example:

MAXIMUM EQU 99

After using this directive, every appearance of the label “MAXIMUM” in the program will be interpreted by the assembler as the number 99 (MAXIMUM = 99).

Symbols may be defined this way only once in the program.

The EQU directive is mostly used at the beginning of the program therefore.

EQU is more general in that it allows numeric constants as well as text constants. EQU also explicitly states that a text value can be changed after declaration.

2.What about TEXTWQU?

TEXTEQU, on the other hand, only deals with text literals.

The use of the normal double quoted text, literals proceeded by % (which I've never seen), and the values of macros. The latter two types do not seem to be supported by EQU, but I have not tested that.

Example:

msg1 byte "Hello World", nl
msg1 byte "Hello World", 13, 10

13 = CR, carriage return
10 = LF, linefeed

TEXTEQU, which works on strings, not numeric values.

Add a comment
Know the answer?
Add Answer to:
ASSEMBLY LANGUAGE Write a program using author's routine, WriteString, to print "Hello World". This routine will...
Your Answer:

Post as a guest

Your Name:

What's your source?

Earn Coins

Coins can be redeemed for fabulous gifts.

Not the answer you're looking for? Ask your own homework help question. Our experts will answer your question WITHIN MINUTES for Free.
Similar Homework Help Questions
  • X86 Assembly Language Help to implement the CipherChar Procedure at the end of the given code...

    X86 Assembly Language Help to implement the CipherChar Procedure at the end of the given code INCLUDE Irvine32.inc         .data       KeyPrompt BYTE "Enter the passphrase: ",0       TextPrompt BYTE "Enter the plaintest: ",0           str1 BYTE "The passphrase has length:",0           str2 BYTE "The plaintest has length:",0       KeyIs BYTE "The passphrase: ",0       PlainTextIs BYTE "The plaintext: ",0       CipherTextIs BYTE "The ciphertext: ",0       KMAX = 64                        ; passphrase buffer maximum size       BMAX = 128                       ; test...

  • Using the AddTwo program from Section 3.2 as a reference, write a program that calculates the...

    Using the AddTwo program from Section 3.2 as a reference, write a program that calculates the following expression, using registers: A = (A + B) + (C + D). Assign integer values to the EAX, EBX, ECX, and EDX registers. AddTwo program: ; AddTwo.asm - adds two 32-bit integers ; Chapter 3 example .386 .model flat,stdcall .stack 4096 ExitProcess PROTO, dwExitCode:DWORD .code main PROC mov eax,5 ; move 5 to the eax register add eax,6 ; add 6 to the...

  • MASM Assembly Language programming question. I'm having serious issues. I am attempting to scan through a...

    MASM Assembly Language programming question. I'm having serious issues. I am attempting to scan through a string and replace all the "o" characters with an exclamation mark (!). However my program does not work and no change seems to occur to the string. Also the loop breaks once the first "o" character is encountered.Is there anyone in this Universe that can help me???Please main PROC    ;mov edi,OFFSET string    mov ecx, LENGTHOF string    mov edi,OFFSET string    L1:...

  • NOTE: explain the lines in comments for better understanding Write an assembly program (for x86 processors...

    NOTE: explain the lines in comments for better understanding Write an assembly program (for x86 processors - Irvine) that has two procedures, a main procedure and a procedure called Fib. The fib procedure is to uses a loop to calculate and printout the first N Fibonacci numbers. Fibonacci sequence is described by the following formula: Fib(1) = 1, Fib(2) = 1, Fib(n) = Fib(n – 1) + Fib(n – 2). The value of N is to be communicated to this...

  • Assembly Language NASM create a substring ASSIGNMENT INSTRUCTIONS: Create the Substring from the Given string, beginIndex...

    Assembly Language NASM create a substring ASSIGNMENT INSTRUCTIONS: Create the Substring from the Given string, beginIndex and endIndex The program should create a new string that is a substring of this string. The substring begins at the specified beginIndex and extends to the character at index endIndex – 1. Thus the length of the substring is endIndex-beginIndex. In other words you can say that beginIndex is inclusive and endIndex is exclusive while getting the substring. Initialize the following values in...

  • 1. Write a program in Easy68K to print out “Hello World” in two lines as Hello...

    1. Write a program in Easy68K to print out “Hello World” in two lines as Hello World Paste your code and screenshot of the output in this file.

  • 1) Write a complete C or C++ program to print Hello World Greetings. 2) Using the...

    1) Write a complete C or C++ program to print Hello World Greetings. 2) Using the command line, compile and generate the executable for the above program. Let’s call helloWorld the target executable. 3) Write a C program that does the following: a) forks a child to execute helloWorld b) waits for the child execution to end 4) Reuse the above program to try a different variant of exec family of system calls. OPTIONAL: 1) write a program main that...

  • MIPS ASSEMBLY PROGRAM: PLEASE Write in MIPS Assembly language. Take strings as input and calculate and...

    MIPS ASSEMBLY PROGRAM: PLEASE Write in MIPS Assembly language. Take strings as input and calculate and print a simple checksum for each string. Make your string long enough to hold 50 characters. Don't forget to leave space for the null byte. Our checksum algorithm will produce a value which you can print with the syscall for printing a character. Stop reading strings when the user enters ".". The syscall to read a string (sycall code 8) adds a newline to...

  • I need help with ARM assembly program : Using the following code as basic : 1...

    I need help with ARM assembly program : Using the following code as basic : 1 ) Write a program code that is able to calculate the following : Result = A + ( B * C ) - D Place the result as the return value so you can print it afterwards in the command prompt. 2) This time, use MLA instruction to reduce the number of instructions in question 1. Place the result as the return value so...

  • 10. Using the Java "Hello World" program you used for question 10 on Homework 1, you...

    10. Using the Java "Hello World" program you used for question 10 on Homework 1, you will need to add import for Date, provide a couple additional lines of code to print the current date and then take a screenshot of the code after execution. Submit youi screenshot.

ADVERTISEMENT
Free Homework Help App
Download From Google Play
Scan Your Homework
to Get Instant Free Answers
Need Online Homework Help?
Ask a Question
Get Answers For Free
Most questions answered within 3 hours.
ADVERTISEMENT
ADVERTISEMENT
ADVERTISEMENT