CYBR 215 –
Computer Programming with a Low Level Language
Norwich
University
College of
Graduate and Continuing Studies
Problem Set 8
Problems 1 – 3 are from chapter 7. Problems 4
– 5 are from chapter 8.
NAME:
1. (5 Points
Each) Each of these problems gives "before" conditions and an
instruction. Give the indicated
"after" state.
|
Before |
Instruction
executed |
After |
||||
(a) |
EBX:
FF 00 8E BA |
not ebx |
EBX |
|
|
|
|
|
|
|
|
|
|
|
|
(b) |
AX: 8E BA |
or ax, 0EDF2h |
AX |
|
|
|
|
|
|
|
|
SF __ |
ZF__ |
|
|
|
|
|
|
|
|
|
|
(c) |
AX: 8E BA |
xor ax, 0EDF2h |
AX |
|
|
|
|
|
|
|
|
SF __ |
ZF__ |
|
|
|
|
|
|
|
|
|
|
(d) |
AX: 8E BA |
and ax, 0EDF2h |
AX |
|
|
|
|
|
|
|
|
SF __ |
ZF__ |
|
|
(d) |
AX: 8E BA |
test
ax, 80h |
AX |
|
|
|
|
|
|
|
|
SF __ |
ZF__ |
|
|
(e) |
AX: 8E BA |
shl ax, 4 |
AX |
|
|
|
|
|
|
|
|
CF __ |
|
|
|
|
|
|
|
|
|
|
|
(f) |
AX: 8E BA |
sar ax, 4 |
AX |
|
|
|
|
|
|
|
|
CF __ |
|
|
|
2. (5 Points) Suppose
that value is an unsigned integer in the EAX register. Give instructions to
compute (value mod 64), putting the
result in the EBX register and leaving EAX unchanged.
3. (20 Points) Starting
with the PROC
directive and ending with the ENP directive, write an 80x86 procedure that implements the
function described by the following C++ function header:
void arrMix(int arr1[], int arr2[], int
arr3[], int count);
// for i=0, 1,...,count-1 bits 0-7 and
16-23 of arr3[i] come
// from arr1[i] and bits 8-15 and 24-31
come from arr2[i]
Follow
32-bit cdecl protocol.
Get Free Quote!
429 Experts Online