Question

In: Computer Science

Please complete both questions in MASM. Explain code clearly, thank you. Please screenshot memory outputs. Symbolic...

Please complete both questions in MASM. Explain code clearly, thank you. Please screenshot memory outputs.

  1. Symbolic Text Constants

Write a program that defines symbolic names for several string literals (characters between quotes). Use each symbolic name in a variable definition.

Use this code to get started:

; Symbolic Text Constants

Comment !
Description: Write a program that defines symbolic names
for several string literals (characters between quotes).
Use each symbolic name in a variable definition.
!

.386
.model flat,stdcall
.stack 4096
ExitProcess proto,dwExitCode:dword

.data


.code
main PROC

   INVOKE ExitProcess,0
main ENDP
END main

  1. Listing File for AddTwoSum

Generate a listing file for the AddTwoSum program and write a description of the machine code bytes generated for each instruction. You might have to guess at some of the meanings of the byte values.

AddTwoSum code:

.386

.model flat,stdcall

.stack 4096

ExitProcess proto,dwExitCode:dword

.code

main PROC

       ; Give each register an integer value

       mov eax, 100                      ; A = EAX = 10

       mov ebx, 24                        ; B = EBX = 24

       mov ecx, 8                        ; C = ECX = 23

       mov edx, 23                       ; D = EDX = 8

       ; Add everything

       add eax, ebx               ; EAX = A + B (b/c eax is first)

       add ecx, edx               ; ECX = C + D

       sub eax, ecx               ; EAX = (A + B) - (C + D)

       INVOKE ExitProcess,0

main ENDP

END main

Solutions

Expert Solution

1)Symbolic Text Constants

Generally a symbolic constant is created by associating an identifier (a symbol) with either an integer expression or some text. Unlike a variable definition, which reserves storage, a symbolic constant does not use any storage. The value of a symbolic constant is defined by the assembler and does not change at run time.

2)

Hey i didn't understand the code that u asked me to start with, but this program that i'm gonna write will print characters between quotes. and also The program cannot be run on an online editor, please use MASM to run the program and use dos box to run MASM, you might use any 8086 emulator to run the program.

MODEL SMALL
.STACK 100H
.DATA

;The string to be printed
STRING DB 'This is a sample string', '$'

.CODE
MAIN PROC FAR
MOV AX,@DATA
MOV DS,AX

; load address of the string
LEA DX,STRING

;output the string
;loaded in dx
MOV AH,09H
INT 21H

;interrupt to exit
MOV AH,4CH
INT 21H

MAIN ENDP
END MAIN

Hope it helps, if u get want u wanted give a thumps up, it means a lot thanks:)


Related Solutions

Please do both questions in MASM and complete these two in two separate files. 3. Summing...
Please do both questions in MASM and complete these two in two separate files. 3. Summing the Gaps between Array Values Write a program with an indexed addressing that calculates the sum of all the gaps between successive array elements. The array elements are doublewords, sequenced in nonde- creasing order. So, for example, the array {0, 2, 5, 9, 10} has gaps of 2, 3, 4, and 1, whose sum equals 10.      4. Copying a Word Array to a DoubleWord...
Please show screenshot outputs and fully functional code for the Java program. Write the following methods...
Please show screenshot outputs and fully functional code for the Java program. Write the following methods to   1) read the content of an array of 5 doubles public static double[] readingArray() 2) find and print:the smallest element in an array of 5 double public static void smallest(double [] array) 3) find and print:the largest element in an array of 5 doubles pubic static void largest (double [] array) In the main method - invoke readingArray and enter the following numbers...
Please complete in MASM (x86 assembly language). Use the code below to get started. Use a...
Please complete in MASM (x86 assembly language). Use the code below to get started. Use a loop with indirect or indexed addressing to reverse the elements of an integer array in place. Do not copy the elements to any other array. Use the SIZEOF, TYPE, and LENGTHOF operators to make the program as flexible as possible if the array size and type should be changed in the future. .386 .model flat,stdcall .stack 4096 ExitProcess PROTO,dwExitCode:DWORD .data    ; define your...
Please in C++ thank you! Please also include the screenshot of the output. I have included...
Please in C++ thank you! Please also include the screenshot of the output. I have included everything that's needed for this. Pls and thank you! Write a simple class and use it in a vector. Begin by writing a Student class. The public section has the following methods: Student::Student() Constructor. Initializes all data elements: name to empty string(s), numeric variables to 0. bool Student::ReadData(istream& in) Data input. The istream should already be open. Reads the following data, in this order:...
----- Please solve the questions with the code below. Thank you. ----- Exercise Overview Refactor your...
----- Please solve the questions with the code below. Thank you. ----- Exercise Overview Refactor your code to enhance the user experience and to use objects and classes. All functional requirements in Project 1 remain, except where enhancing the system replaces specific functions. Functional Requirements The console entry point for the user inputs is on the same line as the prompt. (new) User enters name at the beginning of a session. System covers four math operations – addition, subtraction, multiplication,...
Please explain clearly. Thank you. Part 1. a. The dipole moment of a molecule is 6.17E-30...
Please explain clearly. Thank you. Part 1. a. The dipole moment of a molecule is 6.17E-30 [C·m]. The dipole has a separation of distance of d [m]. It is given that the dipole moment has a magnitude of p = 2qd. In an electric field of (6.0*10^6) [N/C], find the maximum torque on the molecule. We assume an answer in 10-23 N.m b. There is a uniformly charged spherical shell, whose inner and outer radii are R1 and R2, and...
Please answer #14-19, explain and clearly indicate which # you are answering. Thank you so much!...
Please answer #14-19, explain and clearly indicate which # you are answering. Thank you so much! Q14-19 We crossed pure-bred female flies with yellow body and forked-shaped bristles with male flies extra bristles. The subsequent F1 flies showed all normal phenotypes except that all of the F1 males are yellow-body. We crossed again the normal F1 females with males homozygous for yellow body, extra bristles, and forked bristles as a testcross. The number of each category of F2 progeny is...
Please answer the following questions to the best of your abilities. Write complete sentences to clearly...
Please answer the following questions to the best of your abilities. Write complete sentences to clearly communicate your ideas. Do not change the format of the document. Due to the school’s computer systems only Microsoft Word or PDF documents are accepted. Submit the completed assignment by uploading it to blackboard. 1. Explain the concept that muscles can enhance joint stability and at the same joint they can also create instability? 2. Which end of the muscle receives greater force when...
Please provide the Stata commands and outputs where necessary, thank you. 4. The following are data...
Please provide the Stata commands and outputs where necessary, thank you. 4. The following are data on y = quit rate per 100 employees in manufacturing x = unemployment rate The data are for United States and cover the period 1990-2002. Year Y X 1990 1.3 6.2 1991 1.2 7.8 1992 1.4 5.8 1993 1.4 5.7 1994 1.5 5.0 1995 1.9 4.0 1996 2.6 3.2 1997 2.3 3.6 1998 2.5 3.3 1999 2.7 3.3 2000 2.1 5.6 2001 1.8 6.8...
For Astronomy class, please answer this question clearly, thank you. Describe the similarities and the differences...
For Astronomy class, please answer this question clearly, thank you. Describe the similarities and the differences between the mechanisms by which Terrestrial and Jovian planets generate their magnetic fields.
ADVERTISEMENT
ADVERTISEMENT
ADVERTISEMENT