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 answer these questions clearly in hand written, thank you! 1. Explain 4 things you can...
Please answer these questions clearly in hand written, thank you! 1. Explain 4 things you can do with a JTAG unit while debugging code. 2. The first time an optical shaft encoder was connected to a microprocessor the engineer used an external interrupt but with it configured as a level edge triggered interrupt. Explain why that was not a good idea 3. Discuss the differences between “bare metal” and a Linux operating system and give an example of when each...
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...
Can you please show both in RStudio code? Thank You Airports: The temperature is recorded at...
Can you please show both in RStudio code? Thank You Airports: The temperature is recorded at 60 airports in a region. The average temperature is 68 degrees Fahrenheit with a standard deviation of 5 degrees. The last known average temperature from all airports is 67 degrees Fahrenheit.   Is the recorded temperature at the 60 airports different from the average temperature at all airports? Answer by determining statistical significance using the test statistic, degrees of freedom, and p-value. Answer substantive significance...
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...
ADVERTISEMENT
ADVERTISEMENT
ADVERTISEMENT