Question

In: Computer Science

Assume we have two string variables: Shakespeare byte 'Brevity is the soul of wit' and

​Assembly Language

 

Assume we have two string variables:
Shakespeare byte 'Brevity is the soul of wit' and
Poet byte 'The problem is not in the stars but within ourselves'
 
Write a AL program that will interchange the contents of the two variables.

Solutions

Expert Solution

Copyable Code:

SECTION .data
input db 'Enter SHAKESPEARE and POET Strings: ', 0Ah
inputLen equ $ - input
answer db 'After Interchanging: ', 0Ah
answerLen equ $ - answer

SECTION .bss
firstMSG: resb 255 ;for shakespeare byte
secondMsg: resb 255 ;for poet byte

SECTION .text
global _start

_start:

;print input
mov edx, inputLen
mov ecx, input
mov ebx, 1
mov eax, 4
int 80h

mov edx, 255
mov ecx, firstMSG
mov ebx, 0
mov eax, 3   
int 80h

mov edx, 255
mov ecx, secondMsg
mov ebx, 0
mov eax, 3
int 80h

;display the input
mov edx, answerLen
mov ecx, answer
mov ebx, 1
mov eax, 4
int 80h
  
mov edx, 255
mov ecx, secondMsg
mov ebx, 1
mov eax, 4
int 80h

mov edx, 255
mov ecx, firstMSG
mov ebx, 1
mov eax, 4
int 80h
mov ebx, 0
mov eax, 1
int 80h


Related Solutions

Assume that the following variables have been declared: String a = “Ready, Set, Go!”; String b...
Assume that the following variables have been declared: String a = “Ready, Set, Go!”; String b = a.substring(5, 10); char b1 = b.charAt(2); Evaluate the following expression: 1. Character.isLowerCase(b1) 2. b1 + 5 3. b + 5 4. Character.toLowerCase(b1) 5. a.charAt(2 + a.indexOf(“e”))
Assume we have a dataset that includes 60 observations surrounding two variables of interest: (1) Soybean...
Assume we have a dataset that includes 60 observations surrounding two variables of interest: (1) Soybean yields in bushels per acre (bu/acre) and (2) fertilizer treatment. Variable (1) is quantitative while variable (2) is categorical; assume that there were four different fertilizer treatments tested. Assume also that the number of observations of each fertilizer treatment was the same for each group; i.e., 15 observations of each fertilizer treatment were collected. Write out the “Generic” null hypothesis. Write out the “Specific”...
Let's say that we have two variables X and Y. We calculate their correlation value to...
Let's say that we have two variables X and Y. We calculate their correlation value to be r = -.8012. What is the interpretation of this value?
We can allocate string literals and global variables in the .data section of an assembly language...
We can allocate string literals and global variables in the .data section of an assembly language program. Write MARS directives which would allocate the following C-like variables in the .data section. char ch1 = ' ', ch2 = '$'; // Assume char variables/values are 1-byte int x = 0, y = -1, z; // Assume int variables/values are 4-bytes char *name = "Marge Simpson"; // name is a label assoc'd with the address of the first char int iarray[250] =...
Assume we have equally invested in two different companies; ZICTA and AIRTEL. We anticipate that there...
Assume we have equally invested in two different companies; ZICTA and AIRTEL. We anticipate that there is a 15% chance that next year’s stock returns for ZICTA will be 6%, a 60% probability that they will be 8% and a 25% probability that they will be 10%. In addition, we already know the expected value of returns is 8.2%, and the standard deviation is 1.249%. We also anticipate that the same probabilities and states are associated with a 4% return...
1. What is meant when we say that two variables have a strong positive (or negative)...
1. What is meant when we say that two variables have a strong positive (or negative) linear correlation? Is it possible that two variables could be strongly related but have a low linear correlation? Can you give an example? 2. Give a very general description of how the least-squares criterion is involved in the construction of the least squares line.
1. We have the data as follows. There are three independent variables and three dependent variables...
1. We have the data as follows. There are three independent variables and three dependent variables (You may use the following table to solve this problem) x y 3 11 5 6 7 4 Total 15 21 a) Calculate b1 and b0, and write the equation of the least squares line. b) Determine the values of SSE and SST. c) Calculate the standard error. d) Find the rejection point for the t statistic at α = .05 and test H0:...
Suppose we have the following projects on two stocks. Assume thecorrelation among the two assets...
Suppose we have the following projects on two stocks. Assume the correlation among the two assets returns is 0.6State of EconomyProbabilityStock AStock BRecession0.2-2%6%Slow0.448Average0.41219a. Find the expected return and standard deviation of shares A and B.b. Find the investment percentage (weights) needed in A and B shares to create the minimum variance portfolio.
48. {Exercise 4.31 (Algorithmic)} Assume that we have two events, A and B, that are mutually...
48. {Exercise 4.31 (Algorithmic)} Assume that we have two events, A and B, that are mutually exclusive. Assume further that we know P(A) = 0.7 and P(B) = 0.3. If an amount is zero, enter "0". What is P(A  B)? What is P(A | B)? Is P(A | B) equal to P(A)? - Select your answer -YesNoItem 3 Are events A and B dependent or independent? - Select your answer -Events A and B are dependentEvents A and B are independentEvents...
Assume that it is appropriate and meaningful to calculate the correlation coefficient of two variables X...
Assume that it is appropriate and meaningful to calculate the correlation coefficient of two variables X and Y. If the correlation coefficient, r, has a value -0.95 Select one: a. it is impossible to tell if there is a linearly relationship between the two variables b. there is a strong linear relationship between the two variables c. there is no relationship between the two variables d. the slope of the regression line will be -0.95 2. The father's height (in...
ADVERTISEMENT
ADVERTISEMENT
ADVERTISEMENT