subject

Assembly Language Programming in MASM Use the following data definitions for this problem:
.data
myBytes BYTE 40h, 30h, 20h, 10h myWords WORD 10 DUP(00ABh), 2000h myString BYTE "ABCDEFGHI"
myDword DWORD 12345678h

(A) What will be the value of EAX after each of the following instructions execute?
[5]
mov eax, TYPE myBytes ; a. mov eax, SIZEOF myBytes ; b. mov eax, TYPE myWords ; c. mov eax, LENGTHOF myWords ; d. mov eax, SIZEOF myString ; e.

(B) Write a single instruction that moves the first byte in myDword to the AL register. The resulting value in AL will be 78h. [2] Ans:

(C) Write an instruction that moves the second word in myDword to the AX register. The resulting value in AX will be 1234h. [2] Ans:

Use the following variable definitions for this problem:
.data
var1 SBYTE -8, -4, 2, 1 var2 WORD 2000h, 4000h, 6000h, 8000h
var3 SWORD -18, -46 var4 DWORD 11, 22, 33, 44, 55

(A) For each of the following statements, state if the instruction is valid. If invalid, provide the argument. [5] a. mov ax, var1
b. mov eax, var3
c. mov var2, var3
d. movzx ax, var1
e. mov ds, 1000h

(B) What will be the hexadecimal value of the destination operand after each of the following instructions execute in sequence? [2] mov al, var1 ; a. mov ah, [var1+3] ; b.

(C) What will be the value of the destination operand after each of the following instructions execute in sequence? [2] mov eax, var4 ; a. mov eax, [var4+4] ; b.

(D) What doe the instructions MOVSX and MOVZX do? Show an example. [4] Ans:

(A) Determine the value of AX after each of the following increment/decrement instructions (inc/dec). [4]
mov ax,00FFh
inc al ; AX = mov ax,0000h dec al ; AX =

(B) If the relative offset is encoded in a single signed byte (8 bits), [4] (a) what is the largest possible backward jump? Ans:
(b) what is the largest possible forward jump? Ans:

Problem 6 [5 points]

Determine whether the following is TRUE/FALSE.
a. Assembly language is a high-level language (i. e., similar to Java/C). F
b. Assembly language is a good choice for writing device driver code or code for embedded systems.
c. In 2’s complement system, there are two different representations of zero.
d. The largest positive number in 8-bit system is 1111 1111.
e. EAX serves as loop counter.

Problem 7 [5 points]

Write an assembly program that computes the expression: varD = -varA + (varB + varC). Fill in the code segment. You may only use ADD, MOV, and NEG instructions.

.data varA byte 10 varB byte 20 varC byte 30 varD byte ?

.code

1) What will be the value in EDX after each of the lines marked (a) and (b) execute? [2]

.data varA WORD 9000h varB WORD 5000h

.code
movsx edx, varA ; (a) movsx edx, varB ; (b) _

2) What will be the value in EAX after the following assembly code execute? [1]
mov eax, 1004h inc ax ; EAX =

3) What values will be in EAX and EBX registers after the following instructions executed. [2] eax: ebx:
.data
array1 DWORD 5 DUP(?)
.code mov eax, LENGTHOF array1 mov ebx, SIZEOF array1

ansver
Answers: 2

Another question on Computers and Technology

question
Computers and Technology, 21.06.2019 22:00
Match the steps of the process to julia's analysis. 1. analyze choices. current costs for making phone calls to foreign countries averages between five and ten cents a minute. 2. determine the goals. julia needs to reduce the cost of telecommunications without reducing her employees' ability to do their jobs. 3. gather data. the corporate computer network will be able to handle the increased traffic that will occur as a result of voip. 4. evaluate the decision. julia will have her it department set up voip in the smallest domestic office. 5. make the decision. julia will have employees document the benefits and problems that result from using the new technology.
Answers: 1
question
Computers and Technology, 22.06.2019 19:10
10. when you create a pivottable, you need to specify where to find the data for the pivottable. is it true
Answers: 2
question
Computers and Technology, 23.06.2019 01:30
How do you set up a slide show to play continuously, advancing through all the slides without requiring your interaction? a. click set up slide show, and then select the loop continuously until ‘esc' and show without narration options. b. click set up slide show, and then select the loop continuously until ‘esc' and use timings, if present options. c. click set up slide show, and then select the show presenter view and use timings, if present options. d. click set up slide show, and then select the show without animation and browsed at a kiosk (full screen) options.
Answers: 3
question
Computers and Technology, 23.06.2019 12:00
If you embed a word table into powerpoint, what happens when you make edits to the embedded data? a. edits made to embedded data change the data in the source file; however, edits made to the source file will not be reflected in the embedded data. b. edits made to embedded data will change the data in the source file, and edits made to the source file will be reflected in the embedded data. c. edits made to embedded data don't change the data in the source file, nor will edits made to the source file be reflected in the embedded data. d. edits made to embedded data don't change the data in the source file; however, edits made to the source file will be reflected in the embedded data.
Answers: 1
You know the right answer?
Assembly Language Programming in MASM Use the following data definitions for this problem:
....
Questions
question
Mathematics, 21.08.2019 22:30
question
French, 21.08.2019 22:30
question
Mathematics, 21.08.2019 22:30
question
Mathematics, 21.08.2019 22:30
question
Mathematics, 21.08.2019 22:30