- (16 points)A byte of memory contains the hexadecimal value E6. What
decimal number does this represent, if the byte is interpreted as containing:
- an 8-bit unsigned integer
- an 8-bit signed integer in sign-magnitude form
- an 8-bit signed integer in one's complement form
- an 8-bit signed integer in two's complement form
- (8 points) Assume that the hex value 42018000 represents a
floating point number in IEEE-standard single precision format. What
decimal number does it represent? Show your work.
- (12 points) Given the following register values in hex:
DS 9312 SP 0012 AX 0001 SI FFFF
SS 6676 BP 00F3 BX 0002 DI ABCD
CS 4ABC IP 112A CX 0003
ES 9312 DX 0004
- Calculate the effective address from which the next byte of machine code
will be fetched. Give your answer as a 5-digit hexadecimal number.
- What is the segment address for the stack segment? Give your answer
as a 5-digit hexadecimal number.
- Which two values could be used as offsets into the stack segment?
- (5 points each) Write an assembly language instruction or set of
instructions to perform the following:
- Put the value 12 (decimal) in the high-order byte of the AX register.
- Compare the signed values in AX and BX and jump to LESS if BX is less than AX.
- Subtract the value in AX from the value in BX.
- Move into the AX register the contents of the word whose address
is contained in the BX register.
- (16 points) Write assembly language code to implement the following
IF-THEN-ELSE statement. Assume you are dealing with unsigned numbers.
IF ( ((AX) < 10) AND ((BX) < 10) ) THEN
assign 1 to the CX register
ELSE
assign 0 to the CX register
ENDIF
- (10 points) An assembly language program contains this data declaration:
.data
Array1 DB 1, 2, 3
Array2 DW -1, -2, -3
Assume these values get loaded into memory beginning at location 1124C.
Show the contents of memory at each of the following byte addresses (give
your answers in hex). You may put ? as the contents of a memory location
if it is not defined by the .data area given.
address contents
------- --------
1124C
1124D
1124E
1124F
11250
11251
11252
11253
11254
11255
11256
11257
- (10 points) Given below is a portion of an assembly language program.
What does it do? (Don't give a line-by-line description; give me a general
description).
.data
strng db ``Happy Valentines Day''
N = $ - strng
.code
.
.
.
LEA BX, strng
MOV SI, BX
MOV CX, N
A1: MOV AL, BYTE PTR [BX]
CMP AL, 'a'
JE A2
MOV [SI], AL
INC SI
A2: INC BX
LOOP A1
.
.
.
- (8 points) Show the settings in the flags register after the execution
of the following pair of instructions.
MOV BL, 0FAH CF= ZF=
ADD BL, 0AH SF= OF=