You are on page 1of 33

Terms in this set (127)

Assembly Language By Zeeshan Riaz


Guess:

---------------------------
-------------
An assembler converts source-code programs from
1. How do assemblers
assembly language into machine language. A linker
and linkers work
combines individual files created by an assembler into a
together?
single executable program.
3. What is meant by a In a one-to-many relationship, a single statement expands
one-to-many into multiple assembly language or machine instructions.
relationship when
comparing a high-level
language to machine
language?
4. Explain the concept A language whose source programs can be compiled and
of portability as it run on a wide variety of com- puter systems is said to be
applies to programming portable.
languages.
5. Is the assembly No. Each assembly language is based on either a processor
language for x86 family or a specific computer.
processors the same as
those for computer
systems such as the Vax
or Motorola 68x00?
Some examples of embedded systems applications are
6. Give an example of automobile fuel and ignition sys- tems, air-conditioning
an embedded systems control systems, security systems, flight control systems,
application. hand-held computers, modems, printers, and other
intelligent computer peripherals.
Device drivers are programs that translate general
7. What is a device
operating system commands into specific references to
driver?
hardware details that only the manufacturer knows.
8. Do you suppose type No, C++ does not allow a pointer of one type to be
checking on pointer assigned to a pointer of another type. Assembly language
variables is stronger has no such restriction regarding pointers.
(stricter) in assembly
language, or in C and
C++?
9. Name two types of Applications suited to assembly language: hardware device
applications that would driver and embedded systems and computer games
be better suited to requiring direct hardware access.
assembly language than
a high-level language.
10. Why would a high- A high-level language may not provide for direct hardware
level language not be access. Even if it does, awk- ward coding techniques must
an ideal tool for writing often be used, resulting in possible maintenance problems.
a program that directly
accesses a printer port?
11. Why is assembly Assembly language has minimal formal structure, so
language not usually structure must be imposed by programmers who have
used when writing large varying levels of experience. This leads to difficulties
application programs? maintaining existing code.
12. Challenge: Translate mov eax,Y ; move Y to EAX

the following C++ mov ebx,4 ; move 4 to EBX

expression to assembly imul ebx ; EAX = EAX * EBX

language, using the add eax,3 ; add 3 to EAX

example presented mov X,eax ; move EAX to X


earlier in this chapter as
a guide: X = (Y * 4) + 3.
1.2.1
Virtual machine concept: Computers are constructed in
-----
layers, so that each layer repre- sents a translation layer
from a higher-level instruction set to a lower-level
1. In your own words, instruction set.
describe the virtual
machine concept.
2. Why do you suppose 2. A translated program is often faster because it is coded
translated programs in a language that can be directly executed on the target
often execute more machine. This is not the case with interpreted programs,
quickly than interpreted since they must be translated while they are running.
ones?
3. (True/False): When an 3. True.
interpreted program
written in language L1
runs, each of its
instructions is decoded
and executed by a
program written in
language L0.
4. Explain the 4. An entire L1 program is converted into an L0 program by
importance of an L0 program specifically designed for this purpose. Then
translation when dealing the resulting L0 program is executed directly on the com-
with languages at puter hardware.
different virtual machine
levels.
5. At which level does 5. Assembly language appears at Level 3.
assembly language
appear in the virtual
machine example shown
in this section?
6. What software utility 6. The Java virtual machine (JVM) allows compiled Java
permits compiled Java programs to run on almost any computer.
programs to run on
almost any computer?
7. Name the four virtual 7. Digital logic, instruction set architecture, assembly
machine levels named in language, high-level language.
this section, from lowest
to highest.
8. Why don't 8. Machine language is difficult for humans to understand,
programmers write since it provides no visual clues relating to the instruction
applications in machine syntax.
language?
9. Machine language is 9. Instruction set architecture.
used at which level of
the virtual machine
shown in Figure 1-1?
10. Statements at the 10. Level 2 (Instruction Set Architecture).
assembly language level
of a virtual machine are
translated into
statements at which
other level?
1.3
1. The Least Significant Bit is position 0, having the value of 2
----
to the zero power.

1. Explain the term least


significant bit (LSB).
2. What is the decimal 2. (a) 248 (b) 202 (c) 240
representation of each
of the following
unsigned binary
integers?

a. 11111000 b. 11001010 c.
11110000
3. What is the sum of 3. (a) 00010001 (b) 101000000 (c) 00011110
each pair of binary
integers?

a. 00001111 00000010 b.
11010101 01101011 c.
00001111 00001111
4. How many bytes are 4.(a)2 (b)4 (c)8 (d)16
contained in each of the
following data types?

a. word

b. doubleword

c. quadword

d. double quadword
5. What is the minimum 5. (a) decimal 65 requires 7 bits (b) decimal 409 requires 9
number of binary bits bits (c) decimal 16,385 requires 15 bits
needed to represent
each of the following
unsigned decimal
integers?

a. 65

b. 409

c. 16385
6. What is the 6. (a) 35DA (b) CEA3 (c) FEDB
hexadecimal
representation of each
of the following binary
numbers?

a. 0011 0101 1101 1010 b.


1100 1110 1010 0011 c. 1111
1110 1101 1011
7. What is the binary 7. (a) A4693FBC = 1010 0100 0110 1001 0011 1111 1011 1100 (b)
representation of the B697C7A1 = 1011 0110 1001 0111 1100 0111 1010 0001 (c)
following hexadecimal 2B3D9461 = 0010 1011 0011 1101 1001 0100 0110 0001
numbers?

a. A4693FBC b.
B697C7A1 c. 2B3D9461
1.4
1. (NOT X) OR Y
---

1. Describe the following


boolean expression: ¬X
∨ Y.
2. Describe the 2. X AND Y
following boolean
expression: (X ∧ Y).
3. What is the value of 3. T
the boolean expression
(T ∧ F) ∨ T ?
4. What is the value of 4. F
the boolean expression
¬(F ∨ T) ?
5. What is the value of 5. T
the boolean expression
¬F ∨ ¬T ?
1.7 No (Ans)
...
---

1. In an 8-bit binary
number, which is the
most significant bit
(MSB)?

2. What is the decimal


representation of each
of the following
unsigned binary
integers?

a. 00110101 b. 10010110 c.
11001100

3. What is the sum of


each pair of binary
integers?

a. 10101111 + 11011011

b. 10010111 + 11111111

c. 01110101 + 10101100

4. Calculate binary
00001101 minus 00000111.

5. How many bits are


used by each of the
following data types?

a. word

b. doubleword

c. quadword

d. double quadword

6. What is the minimum


number of binary bits
needed to represent
each of the following
unsigned decimal
integers?

a. 4095

b. 65534

c. 42319

7. What is the
hexadecimal
representation of each
of the following binary
numbers?

a. 0011 0101 1101 1010

b. 1100 1110 1010 0011

c. 1111 1110 1101 1011

8. What is the binary


representation of the
following hexadecimal
numbers? a. 0126F9D4

b. 6ACDFA95

c. F69BDC2A

9. What is the unsigned


decimal representation
of each of the following
hexadecimal integers?

a. 3A

b. 1BF c. 1001
d Exercises 29
...
--------

decimal representation of each of the following

ationofeachofthefollowingsigneddecimalintegers?

ationofeachofthefollowingsigneddecimalintegers?

exadecimal numbers represent signed integers.


.

exadecimal numbers represent signed integers.


.

epresentation of each of the following signed


01

epresentation of each of the following signed


0000

y (two's-complement) representation of each of


imal integers?

ry (two's-complement) representation of each of


imal integers?

ch pair of hexadecimal integers?

30 Chapter 1 • Basic ...


Concepts (No Ans)

---------------------------
--

20. What is the sum of


each pair of
hexadecimal integers?

a. 7C4 3BE

b. B69 7AD

21. What are the


hexadecimal and
decimal representations
of the ASCII character
capital B?

22. What are the


hexadecimal and
decimal representations
of the ASCII character
capital G?

23. Challenge: What is


the largest decimal
value you can represent,
using a 129-bit unsigned

integer?

24. Challenge: What is


the largest decimal
value you can represent,
using a 86-bit signed
integer?

25. Create a truth table


to show all possible
inputs and outputs for
the boolean function
described by ¬(A ∨ B ).

26. Create a truth table


to show all possible
inputs and outputs for
the boolean function
described by ( ¬A ∧ ¬B
). How would you
describe the rightmost
column of this table in
relation to the table
from question number
25? Have you heard of
De Morgan's Theorem?

27. If a boolean function


has four inputs, how
many rows are required
for its truth table?

28. How many selector


bits are required for a
four-input multiplexer?

2.1
Control Unit, Arithmetic Logic Unit, and the clock. Data,
---
Address, and Control buses.
1. The central processor
unit (CPU) contains
registers and what other
basic elements?
2. The central processor Data, Address, and Control buses.
unit is connected to the
rest of the computer
system using what three
buses?
3. Why does memory Conventional memory is outside the CPU and it responds
access take more more slowly to access requests. Registers are hard-wired
machine cycles than inside the CPU.
register access?
4. What are the three Fetch, decode, execute.
basic steps in the
instruction execution
cycle?
5. Which two additional Fetch memory operands, store memory operands
steps are required in the
instruction execution
cycle when a memory

operand is used?
2.2
Real-address mode, Protected mode, and System
---
Management mode.
1. What are the x86
processor's three basic
modes of operation?
2. Name all eight 32-bit EAX, EBX, ECX, EDX, ESI, EDI, ESP, EBP.
general-purpose
registers.
3. Name all six segment CS, DS, SS, ES, FS, GS.
registers.

4. What special purpose Loop counter.


does the ECX register
serve?
2.4
...
---

3. List at least two


features found in the
Intel P965 Express
chipset.
4. Name four types of ...
RAM mentioned in this
chapter.
5. What is the purpose ...
of the 8259A PIC
controller?
2.5
1. The application program level.
---

1. Of the four levels of


input/output in a
computer system, which
is the most universal and
portable?

2. What characteristics 2. BIOS functions communicate directly with the system


distinguish BIOS-level hardware. They are independent of the operating system.
input/output?
3. Why are device 3. New devices are invented all the time with capabilities
drivers necessary, given that were often not anticipated when the BIOS was written.
that the BIOS already
has code that
communicates with the
computer's hardware?
4. In the example 4. The BIOS level.
regarding displaying a
string of characters,
which level exists
between the operating
system and the video
controller card?
5. Is it likely that the 5. No. The same BIOS would work for both operating
BIOS for a computer systems. Many computer owners install two or three
running MS-Windows operating systems on the same computer. They would
would be different from certainly not want to change the system BIOS every time
that used by a computer they rebooted the computer!
running Linux?
...

the stack pointer (ESP), what other register points to

tus flags.

result of an unsigned arithmetic operation is too large

result of a signed arithmetic operation is either too


he destination?

er operand size is 32 bits and the REX prefix is used,


or programs to use.

meticorlogicaloperationgeneratesanegativeresult?

forms floating-point arithmetic?

w many bits are contained in each floating-point data

uctionsetisbackward-
tionset.

-bit chip implementations, all 64 bits are used for

ctionsetiscompletelydifferentfromthex86instructionset.

usually less expensive than dynamic RAM.

DI register is available when the REX prefix is used.

bit mode, you can use 16-bit real mode, but not the

rocessors have 4 more general-purpose registers than

onofMicrosoftWindowsdoesnotsupportvirtual-

nly be erased using ultraviolet light.

de, you can use up to eight floating-point registers.

stic cable that is attached to the motherboard at both

otherboard.

is the same as static RAM, meaning that it holds its


wer or refresh cycles.

ors are used for graphics cards and sound cards.

a controller that handles external interrupts from


PCI stands for programmable component interface.

s for virtual random access memory.

ssembly language program manipulate input/output?

endtheirsoundoutputdirectlytothesoundcard'shardware

3.1
1. 35d, DDh, 335o, 11011101b
---

1. Using the value -35,


write it as an integer
literal in decimal,
hexadecimal, octal, and
binary formats that are
consistent with MASM
syntax.
2. (Yes/No): Is A5h a 2. No (a leading zero is required).
valid hexadecimal
literal?
3. (Yes/No): Does the 3. No (they have the same precedence)
multiplication operator
(*) have a higher
precedence than the
division

operator (/) in integer


expressions?
4. Create a single 4. Expression: 30 MOD (3 * 4) + (3 - 1) / 2 = 20
integer expression that
uses all the operators
from Section 3.1.2.
Calculate the value of
the expression.
5. Write the real number 5. Real number constant: 6.2E+04
-6.2 104 as a real
number literal using
MASM syntax.
6. (Yes/No): Must string 6. No, they can also be enclosed in double quotes.
literals be enclosed in
single quotes?
7. Reserved words can 7. Directives
be instruction
mnemonics, attributes,
operators, predefined
symbols,

and __________.

8. What is the maximum 8. 247 characters


length of an identifier?

3.2
1. The INCLUDE directive copies necessary definitions and
---
setup information from the Irvine32.inc text file. The data
from this file are inserted into the data stream read by the
1. In the AddTwo assembler.
program, what is the
meaning of the
INCLUDE directive?
2. In the AddTwo 2. The .CODE directive marks the beginning of the code
program, what does the segment.
.CODE directive
identify?
3. What are the names 3. Code and data.
of the two segments in
the AddTwo program?
4. In the AddTwo 4. EAX.
program, which register
holds the sum?
5. In the AddTwo 5. INVOKE ExitProcess,0.
program, which
statement halts the
program?
3.3
1. Object (.OBJ) and listing (.LST) files
---

1. What types of files are


produced by the
assembler?
2. (True/False): The 2. True
linker extracts
assembled procedures
from the link library and
inserts them in the
executable program.
3. (True/False): When a 3. True
program's source code
is modified, it must be
assembled and linked
again before it can be
executed with the
changes.
4. Which operating 4. Loader
system component
reads and executes
programs?
5. What types of files 5. Executable (.EXE)
are produced by the
linker?
3.4 (Large section - 1. var1 SWORD ?
REVIEW)

---

1. Create an uninitialized
data declaration for a
16-bit signed integer.
2. Create an uninitialized 2. var2 BYTE ?
data declaration for an
8-bit unsigned integer.
3. Create an uninitialized 3. var3 SBYTE ?
data declaration for an
8-bit signed integer.
4. Create an uninitialized 4. var4 QWORD ?
data declaration for a
64-bit integer.
5. Which data type can 5. SDWORD
hold a 32-bit signed
integer?
3.5
1. BACKSPACE 08h
---

1. Declare a symbolic
constant using the
equal-sign directive that
contains the ASCII code
(08h) for the Backspace
key.
2. Declare a symbolic 2. SecondsInDay 24 x 60 x 60
constant named
SecondsInDay using the
equal-sign directive and
assign it an arithmetic
expression that
calculates the number
of seconds in a 24-hour
period.

]
3. Write a statement that ...
causes the assembler to
calculate the number of
bytes in the follow- ing
array, and assign the
value to a symbolic
constant named
ArraySize:

myArray WORD 20
DUP(?)
3. ArraySize ($ myArray)

4. Show how to calculate


the number of elements
in the following array,
and assign the value to a
...
symbolic constant
named ArraySize:

myArray DWORD 30
DUP(?)

-> 4. ArraySize ($
myArray) / 4
5. Use a TEXTEQU 5. PROCEDURE TEXTEQU <PROC>
expression to redefine
"proc" as "procedure."
6. Use TEXTEQU to 6. Code example:

create a symbol named Sample TEXTEQU <"This is a string">

Sample for a string MyString BYTE Sample


constant, and then use
the

symbol when defining a


string variable named
MyString.
7. Use TEXTEQU to 7. SetupESI TEXTEQU <mov esi, OFFSET myArray>
assign the symbol
SetupESI to the
following line of code:

mov esi,OFFSET
myArray
...

e different instruction mnemonics.

tion, and how is it used in assembly language

ce for the stack in a program?

embler language is not quite correct.

etween big endian and little endian. Also, look up

olicconstantratherthananintegerliteralinyourcode?

rent from a listing file?

code labels different?

r cannot begin with a numeric digit.

mal literal may be written as 0x3A.

anguage directives execute at runtime.

anguage directives can be written in any

rts of an assembly language instruction.

example of an instruction mnemonic.

el is followed by a colon (:), but a data label does

block comment.

numericaddresseswhenwritinginstructionsthataccess

stions and Exercises 93

must be passed to the ExitProcess procedure?

procedure?

the purpose of the identifier in the END directive?

the PROTO directive?

file is produced by the Linker.

le is produced by the Assembler.

ry is added to a program just before producing an

eates a 32-bit signed integer variable?

eates a 16-bit signed integer variable?

eates a 64-bit unsigned integer variable?

eates an 8-bit signed integer variable?

eates a 10-byte packed BCD variable?

4.1
1. Register, immediate, and memory.
---

1. What are the three


basic types of
operands?
2. (True/False): The 2. False.
destination operand of a
MOV instruction cannot
be a segment register.
3. False.
on,thesecondoperandisknownasthedestinationoperand.
4. (True/False): The EIP 4. True.
register cannot be the
destination operand of a
MOV instruction.
5. In the operand 5. A 32-bit register or memory operand
notation used by Intel,
what does reg/mem32
indicate?
6. In the operand 6. A 16-bit immediate (constant) operand
notation used by Intel,
what does imm16
indicate?
4.2
...
---

Use the following data


for Questions 1-5:

.data

val1 BYTE 10h

val2 WORD 8000h

val3 DWORD 0FFFFh

val4 WORD 7FFFh


1. Write an instruction 1. inc val2
that increments val2.
2. Write an instruction 2. sub eax,val3
that subtracts val3 from
EAX.

3. Code:

3. Write instructions that


mov ax,val4

subtract val4 from val2.


sub val2,ax
4. If val2 is incremented 4. CF 0, SF 1
by 1 using the ADD
instruction, what will be
the values of the Carry

and Sign flags?


5. If val4 is incremented 5. OF 1, SF 1
by 1 using the ADD
instruction, what will be
the values of the Over-
flow and Sign flags?
6. Where indicated, 6. Write down the following flag values:

write down the values of (a) CF 1, SF 0, ZF 1, OF 0 (b) CF 0, SF 1, ZF 0, OF 1 (c) CF 0, SF


the Carry, Sign, Zero, 1, ZF 0, OF 0
and Overflow flags after
each instruction has
executed:
mov ax,7FF0h add al,10h
add ah,1 add ax,2

SF = SF = SF = ; a. CF =

ZF = ZF = ZF = ; b. CF =

OF = OF = OF = ; c. CF =
4.3
1. False
----

1. (True/False): The
OFFSET operator always
returns a 16-bit value.
2. (True/False): The PTR 2. False
operator returns the 32-
bit address of a variable.
3. (True/False): The TYPE 3. True
operator returns a value
of 4 for doubleword
operands.

4. (True/False): The 4. False


LENGTHOF operator
returns the number of
bytes in an operand.
5. (True/False): The 5. True
SIZEOF operator
returns the number of
bytes in an operand.
4.4
1. True
---

1. (True/False): Any 32-


bit general-purpose
register can be used as
an indirect operand.
2. (True/False): The EBX 2. False
register is usually
reserved for addressing
the stack.
3. (True/False): The 3. True (the PTR operator is required)
following instruction is
invalid: inc [esi]
4. (True/False): The 4. True
following is an indexed
operand: array[esi]

Use the following data


definitions for Questions
5 and 6:

myBytes BYTE
10h,20h,30h,40h

myWords WORD
8Ah,3Bh,72h,44h,66h

myDoubles DWORD
1,2,3,4,5

myPointer DWORD
myDoubles
5. Fill in the requested 5.(a)10h (b)40h (c)003Bh (d)3 (e)3 (f)2
register values on the
right side of the
following instruction
sequence:

(see img pg. 123)

6. Fill in the requested 6. (a) 2010h (b) 003B008Ah (c) 0 (d) 0 (e) 0044h
register values on the
right side of the
following instruction
sequence:

(see img pg. 123)


4.5
1. True
---

1. (True/False): A JMP
instruction can only
jump to a label inside
the current procedure.
2. (True/False): JMP is a 2. False
conditional transfer
instruction.
3. If ECX is initialized to 3. 4,294,967,296 times
zero before beginning a
loop, how many times
will the LOOP

instruction repeat?
(Assume ECX is not
modified by any other
instructions inside the
loop.)
4. (True/False): The 4. False
LOOP instruction first
checks to see whether
ECX is not equal to
zero; then LOOP
decrements ECX and
jumps to the destination
label.
5. (True/False): The 5. True
LOOP instruction does
the following: It
decrements ECX; then, if
ECX is not equal to
zero, LOOP jumps to the
destination label.
6. In real-address mode, 6. CX
which register is used as
the counter by the
LOOP instruction?
7. In real-address mode, 7. ECX
which register is used as
the counter by the
LOOPD instruction?
8. (True/False): The 8. False ( 128 to 127 bytes from the current location)
target of a LOOP
instruction must be
within 256 bytes of the
current

location.
9. (Challenge): What will 9. This is a trick! The program does not stop, because the
be the final value of first LOOP instruction decrements ECX to zero. The second
EAX in this example?
LOOP instruction decrements ECX to FFFFFFFFh, causing
(see image pg. 128) the outer loop to repeat.
10. Revise the code from 10. Insert the following instruction at label L1: push ecx. Also
the preceding question insert the following instruc- tion before the second LOOP
so the outer loop instruction: pop ecx. (Once you have added these instruc-
counter is not erased tions, the final value of eax is 1Ch.)
when the inner loop
starts.
4.6
1. True (bits 8-63 are cleared)
---

1. (True/False): Moving a
constant value of 0FFh
to the RAX register
clears bits 8 through 63.

2. (True/False): A 32-bit 2. False (64-bit constants are allowed)


constant may be moved
to a 64-bit register, but
64-bit constants are

not permitted.
3. What value will RCX 3. RCX = 12345678FFFFFFFF hexadecimal
contain after executing
the following
instructions?

mov
rcx,1234567800000000h

sub ecx,1
4. What value will RCX 4. RCX = 12345678ABABABAB hexadecimal
contain after executing
the following
instructions?

mov
rcx,1234567800000000h

add rcx,0ABABABABh
5. What value will the 5. AL = 1F hexadecimal
AL register contain after
executing the following
instructions?

.data

bArray BYTE
10h,20h,30h,40h,50h

.code

mov rdi,OFFSET bArray

dec BYTE PTR [rdi+1]

inc rdi

mov al,[rdi]
6. What value will RCX 6. RCX = DF02 hexadecimal
contain after executing
the following
instructions?

mov rcx,0DFFFh

mov bx,3

add cx,bx
4.9
...
---

1. What will be the value


n EDX after each of the
lines marked (a) and (b)
execute?

data

one WORD 8002h

two WORD 4321h

code

mov edx,21348041h

movsx edx,one ; (a)

movsx edx,two ; (b)

2. What will be the value


n EAX after the following
lines execute?

mov eax,1002FFFFh inc ax

3. What will be the value


n EAX after the following
lines execute?

mov eax,30020000h

dec ax

4. What will be the value


n EAX after the following
lines execute?

mov eax,1002FFFFh neg


ax

5. What will be the value


of the Parity flag after the
following lines execute?

mov al,1

add al,3

6. What will be the value


of EAX and the Sign flag
after the following lines
execute?

mov eax,5

sub eax,6

7. In the following code,


the value in AL is
ntended to be a signed
byte. Explain how the
Overflow flag helps, or
does not help you, to
determine whether the
final value in AL falls
within a valid signed
range.

mov al,-1 add al,130

8. What value will RAX


contain after the
following instruction
executes?

mov rax,44445555h

9. What value will RAX


contain after the
following instructions
execute?

data

dwordVal DWORD
84326732h

code

mov
rax,0FFFFFFFF00000000h

mov rax,dwordVal

10. What value will EAX


contain after the
following instructions
execute?

data

dVal DWORD 12345678h

code

mov ax,3

mov WORD PTR


dVal+2,ax

mov eax,dVal

11. What will EAX contain


after the following
nstructions execute?

data

dVal DWORD ?

code

mov dVal,12345678h

mov ax,WORD PTR


dVal+2

add ax,3

mov WORD PTR dVal,ax

mov eax,dVal

12. (Yes/No): Is it possible


to set the Overflow flag if
you add a positive
nteger to a negative
nteger?

13. (Yes/No): Will the


Overflow flag be set if
you add a negative
nteger to a negative
nteger and produce a
positive result?

14. (Yes/No): Is it possible


for the NEG instruction to
set the Overflow flag?

15. (Yes/No): Is it possible


for both the Sign and
Zero flags to be set at
the same time?

Use the following


variable definitions for
Questions 16-19:

data

var1 SBYTE -4,-2,3,1

var2 WORD
1000h,2000h,3000h,4000h

var3 SWORD -16,-42

var4 DWORD 1,2,3,4,5

16. For each of the


following statements,
state whether or not the
nstruction is valid:

a. mov ax,var1?

b. mov ax,var2

c. mov eax,var3

d. mov var2,var3

e. movzx ax,var2

f. movzx var2,al

g. mov ds,ax

h. mov ds,1000h

17. What will be the


hexadecimal value of the
destination operand after
each of the following
nstructions execute in
sequence?

mov al,var1 ; a.

mov ah,[var1+3] ; b.

18. What will be the value


of the destination
operand after each of the
following instructions
execute in sequence?

mov ax,var2 ; a.

mov ax,[var2+4] ; b.

mov ax,var3 ; c.

mov ax,[var3-2] ; d.

19. What will be the value


of the destination
operand after each of the
following instructions
execute in sequence?

mov edx,var4

movzx edx,var2

mov edx,[var4+4]

movsx edx,var1

You might also like