CS3450
Fall 1997
Instructor:  Benitez-Lopez
Exam #1

Q#1:  Perform the conversions of the numbers indicated.  Assume there are n=16 binary digits available:

        a)  (37D5) base 16
        b)  (1111 1011 1101 1010) binary

        A#1a)  11011111010101 binary
               33725 octal

        A#1b)  -1062 decimal
                ?? base 4

Q#2:  As you know, there are up to 16 visible registers in the 486/Pentium microprocessors.  List and give a brief description of those registers available in the 8086/8088 microprocessor.

A#2:
            AX         General purpose
            BX         General purpose
            CX         General purpose
            DX         General purpose
            ES         Extra segment register
            DS         Data segment register
            SI         Segment index register
            SS         Stack segment register
            BP         Base pointer register
            DI         Data index register
            CS         Code segment register
            IP         Instruction pointer register
 
Q#3:  Match each term on the right with its correct description on the left:
 

F
1) calculates physical address a) PUSH instruction
D
2) generates object code b)illegal transfer
B
3) MOV 0FFFFh, DX c) 0B8000h
H
4) Overrides allocations d) TASM
A
5) saves word in the stack e) MODEL
M
6)sets autoincrement mode f) BIU
K
7) points to next instruction g) 00400h
E
8) determines memory requirements h) PTR
L
9) memory to memory transfer i) POP instruction
C
10) Text mode video segment address j) DATA
k) CS:IP
l) MOVSW
m) CLD
Q#4:  32-bit and 64-bit Intel microprocessors are provided with an extended memory management system that allows them to operat in both a real and a protected mode.  Briefly explain the following terms:

a)  Real mode:  A#4a:  In real mode, there is one meg of addressable memory.  Generally, older systems (ie. 8086) can only use the real mode.  Because of this relatively small amound of memory, large and complex programs cannot be designed to operate in real mode.

b)  Protected mode:  A#4b:  As processor architecture improved, the protected mode was also created to allow access to memory above one megabyte.  A protected mode system will also allow real mode applications to run, so that it is backward compatible.

Q#5:  Write the most appropriate data declaration statement for the following cases:

a)  Four distinct variables initialized with the following values:
    46, 0FFBCh, "this is a long message to display", 120000d

    A#5a:    one    DB    46d
             two    DW    0FFBCh
             three  DB    'this is a long message to display'
             four   DD    120000d

b)  An array of 100 double words initialized to zero.
 
    A#5b:    array    DD    100 DUP (0)

Q#6:  Calculate the physical address for the following seg:offset pointers:

a)  A8EC:0FFF            A#6a:  A9EBFh (695999d)
b)  A9FA:0AFF            A#6b:  AAA9Fh (699039d)

Q#7:  Consider the variables and their initialization values shown in the table.  Draw a map and indicate the actual allocation of these variables in memory.

        .DATA
    A    DW    1,2,3
    B    DW    0, 65535
    C    DW    ?
    D    DW    -32768

A#7:

             A                      B                C              D
 
01
00
02
00
03
00
 
 
00
00
FF
FF
 
 
?
?
 
 
00
80
 
low                                                                      high

Q#8:  Consider the data and the code segment provided below.  Assume that array is loaded at location 0A100:1020h.  Fill in the space provided as the program executes:

            .DATA
    array   DB    1,2,3,4,5,6
    A       DB    13h, 25h
    B       DW    1325h

            .CODE
            mov    ax, @data
            mov    ds, ax                    ; ds =  0A100h
            mov    si, OFFSET array          ; si =   1020h
            mov    ax, 0
            lodsb                            ; ax =     1
            mov    ax, B                     ; ax =   1325h
            mov    dx, WORD PTR A            ; dx =   2513