This preview shows pages 1–2. Sign up to view the full content.
EE 3750 — HW 2 solutions
1
EE 3750 — Homework 2 solutions
Fall 2002
1.
Let
⟨
AX
⟩
= 19C3H,
⟨
BX
⟩
= 2B11H,
⟨
CX
⟩
= 3EE0H, and
⟨
SP
⟩
= 1988H.
What are the
contents of AX, BX, CX, and SP after the following sequence of instructions?
PUSH BX
POP AX
PUSH AX
PUSH CX
POP BX
⟨
AX
⟩
= 2B11H,
⟨
BX
⟩
= 3EE0H,
⟨
CX
⟩
= 3EE0H, and
⟨
SP
⟩
= 1986H.
2.
The following equation arises in calculating flow conditions for natural gas through a
pipe.
H
=
Q
C
2
P
+
A
(a)
Write an 8086 instruction sequence to compute the equation assuming that the values
are given as unsigned binary integers.
Let
Q
be a word variable, and let
C
,
P
, and
A
be byte
variables.
What type of variable should
H
be?
(b)
Write an 8086 instruction sequence to compute the equation assuming that the values
are given in unpacked BCD format.
All variables are byte variables.
Variable
Q
is a two digit value,
while
C
,
P
, and
A
are one digit values.
Additional simplifications:
Part (a)  To simplify the problem, ignore the remainders of both divisions, and assume that
the sum of P+A fits into one byte.
Part (b)  To simplify the problem, assume that the quotient of Q/C is one digit long,
This preview has intentionally blurred sections. Sign up to view the full version.
View Full Document
This is the end of the preview. Sign up
to
access the rest of the document.
 Fall '08
 DeSouza

Click to edit the document details