iSearchNotes is a FREE service that allows College Students to
Search and Share Class Notes.
The 8088 Processor
- Within every Pentium there resides an 8088
- Not used much, but provides a simpler way to learn assembler
- Assembler Programs use a '.s' extension
Processor Cycle
- Fetch the instruction from memory from the code segment using PC
- Increment the program counter
- Decode the fetched instruction
- Fetch the necessary data from memory and/or registers
- Perform the instruction
- Store the results of the instruction in memory and/or registers
- Go back to first step
The 8088 Registers - pictures on page 706
8088 General Registers
- AX - accumulator register. Collects results of computations and the target of many instructions. AC is the implied destination for many instructions
- BX - base register. Can be used as AX, but can also be used as a pointer to memory
- Move AX, BX !copy the contents BX to AX
- Move AX, (BX) !copy the contents of the address BX points to to AX
- Used in array processing
- CX - counter register. May be used for multiple tasks, but normally used for loop counters. The loop terminates when CX reaches zero
- DX - data register, For double word (32 bit) instructions DX contains high-order bits and AX low-order bits. Otherwise, use as needed
- All general registers can be used as either 16-bit registers or 8-bit registers.
- AX contains AL and AH
8088 Pointer Registers - This group contains pointer and index registers
- SP - stack pointer. Pointer to top of the stack (stack frame)
- As you PUSH and POP information on and off the stack this register tracks the top of the stack
- BP - Base pointer. May point anywhere in the stack, but normally points at the beginning of the current stack frame that contains the local variables
- SI - source index, Pointer used for sources in register indirect addressing and register displacement addressing
- DI - destination index. Pointer used for destinations in register indirect...
8088 Flag Register - Also known as the condition code register. A series of single-bit registers as follows:
- Z - result is zero
- S - result is negative
- V - result generated an overflow
- C - result generated a carry
- A - auxiliary carry (not gonna worry about)
- P - parity of the result (not gonna worry about)
- I - enable interrupts (not gonna worry about)
- T - use tracing mode (not gonna worry about)
- D - the direction of string operations (positive and negative direction depends on this bit)
8088 Segment Registers
- The original 8086 had only 16 bits (64-kilobytes)
- How then to address 1MB that requires 20 address lines?
- Segment registers that hold 4-bits were the answer
- With the 8088 this was expanded to 20 bits and the segment registers were born
- The segment registers all are 4-bit registers that contain the current segment being utilized
- CD - code segment
- DS - data segment
- SS - stack segment
- ES - extra segment
Addressing
- Instructions need data
- Most 8088 instructions have two operands.
For example:
* MOVE AX, BX !moves the contents of the BX to AX
* ADD CX, 20 !Add 20 to CX
- For some instructions, only one operand is given and the destination can only be the AX
Addressing - picture page 713
The 8088 Instruction Set - picture page 717
Conditional Jumps - picture page 721
Subroutine Calls - picture page 722
If increasing stack then decrease SP because stack is upside down...
Access Levels for Input-Output Operations
- Applications Program. Calls the operating system after loading proper parameters
- Operating System (OS) Function. The OS is responsible for the generic I/O
- BIOS Function. BIOS interfaces the OS to the hardware
- Hardware. Actually preforms the I/O
- An assembly language program can write directly to any of these levels
System Calls and System Subroutines - picture on page 723
- as88 uses a standard calling sequence for system calls
- Push the arguments on the stack in reverse order
- Push the call number
- Execute the SYS command
- Return values are put in either AX or AX : DX combination
- Arguments are left on the stack after the SYS call. Programmer must adjust the stack pointer to remove the arguments
- Examples on picture
The ACK-Based Assembler - picture on page 729
Tracer Commands - picture on page 734
Hello Word Example on page 737
Start on page 735, make sure tracer is installed on your computer. Then go through Hello World extensively.


