ASSEMBLY LANGUAGE Write a program using authors routine Writ

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

Solution

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.

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.

ASSEMBLY LANGUAGE Write a program using author\'s routine, WriteString, to print \

Get Help Now

Submit a Take Down Notice

Tutor
Tutor: Dr Jack
Most rated tutor on our site