Assembly Mid Answer
Assembly Mid Answer
Assembly Mid Answer
Data Bus
Address Bus
The CPU is divided into two general parts: the arithmetic logic unit
(ALU) and the control unit (CU). The former carries out arithmetic,
logical and shifting operations; the latter fetches data and instructions
and decodes addresses for the ALU. The CPUs internal clock
synchronizes each of the CPU and memory operations.
b.) Whats special about the register group design?
Data-registers: used for arithmetic and data movement.
Segment Registers: used as base locations for program instructions,
data and the stack.
Index registers: contain the offsets of data and instructions. The term
offset refer to the distance of a variable, label, or instruction from its
base segment.
Status and control registers: IP, always contains the offset of the next
instruction to be executed. Flag register is a special register wit
individual bit positions assigned to show the status of the CPU or the
results of arithmetic operations.
c.) Could you briefly compare the difference among Intel processor family?
80286: The 80286 could address up to 16MB of RAM using a 24-bit
address and had a clock speed between 12 and 25 MHz. It can run in
either real mode or in protected mode.
80386: The address bus was increased to 32 bits, permitting programs to
address up to 4GB of ram. It supported three modes of operation:
real mode, protected mode and virtual mode.
80486: The first Intel processor to integrate the floating-point unit
directly into the CPU chip. It has internal 8K high-speed level-1 cache
memory that holds copies of instructions and data that have been
most recently accessed.
Pentium: It is able to execute more than one instruction per clock cycle
because of it superscalar design with two instruction pipelines. It has
a 32-bit address bus and a 64-bit internal data path.
2. Software architecture:
a.) Whats the procedure when the computers OS is started up?
The CPU jumps to an initialization program in the ROM BIOS. A
program called the bootstrap loader loads the boot record from the
drive that has been designated as the startup drive. The boot record
contains a program that executes as soon as it is loaded. This program
in turn loads io.sys and msdos.sys. The last program loaded into
memory is the MS-DOS command processor, command.com
b.) What is virtual address? How does the CPU address up to 1MB memory?
3. Read the following program. What are the final values in the AX and BX registers?
a.) A 100
b) A 100
mov ax, 1234 mov ax, 6BFF
mov bl, al mov [250], ax
mov bh, ah mov bx, [250]
add bx, 03C6 inc bx
AX=1234, BX = 15FA AX = 6BFF, BX = 6C00
4. Which of the following registers cannot be used as destination operands?
AX, CL, IP, DX, CS, BH, SS, SP, BP
CS, IP cannot be used as destination operands
5. There are three basic types of operands: immediate, register, and memory. There are
six types of memory operands: direct, direct-offset, register-indirect, indexed, based-
indexed, based-indexed with displacement. As each of the following instruction is
executed, specify what type of operand is used, immediate or memory? What are the
values of destination register (in hex)? If it is a memory operand, what is the effective
address? If the instruction is illegal, indicates why?
.data
count db 2
wordList dw 0003h, 2000h
array db 0Ah, 0Bh, 0Ch, 0Dh
endlist label byte
acc dw endlist
.code
Mov si, 1 Immediate SI=1
Mov ax,[si] register indirect AX=0003 EA=1
Mov bx, ax Register BX=0003
Mov al, array[bx] Based AL=0D EA=05+03=08
Add al, count Direct AL=0F(d+2) EA=0
Mov ax, (40*50) Immediate AX=07D0
SUB ax, wordList+1 Direct-offset AX=07D0 EA=0
Mov ax, offset wordlist Direct AX=0001 EA=1
Mov al, array+2 Direct-offset AL=0C EA=05+02=07
Mov al, endlist 1 Direct-offset AL=0D EA=09-01=08
6. Correct any erroneous lines in the following program, based on the error messages
printed by the assembler:
1: Title Find The Errors
2:
3. .model small
4: .stack 100h
5: .code
6: main proc
7: mov bl, val1
8: mov cx, val2
9: mov ax, 4C00h
10: int 21h
11: main endp
12:
13: .data
14: val1 db 10h
15: val2 dw 1000h
16: end main
8. There are three levels of accessing video, what are they? What interrupt can be
used? Describe as detail as possible.
1. Direct video access
2. BIOS-level access
3. DOS-level access
In BIOS-level access, INT 10h function is used. Function number is from 00
to 11 setting in AH.
In DOS-level access, INT 21h function is used with function number 02h,
06h, and 09h