微算機與組合語言 Microprocessor & Assembly language

Chapter 2

Internal architecture

BIU (Bus Interface Unit)

EU (Execution Unit)

BIU prefetch instructions into instruction queue

Register

ALU (Arithmetic logic unit)

Flags

Register

Instruction Pointer

Segment Register

Data Register

Pointer & Index

Status Register

Status flags

CF (Carry Flag):
PF (Parity Flag):
AF (Auxiliary Flag):
ZF (Zero Flag):
SF (Signed Flag):
OF (Overload Flag):

Control flags

TF (Trap Flag):
DF (Direction Flag):
IF (Interrupt Flag):

Chapter 3

Native language is machine language

A program written in language is often called machine code

An instruction can be divided into two parts (Operation code)

Each opcode is assigned a unique letter combination called a menmonic

Advantages of assembly program than high-level program

Small code size

Short execution time

Low level control

Addressing mode

Specify an operand

Register operand addressing mode

Immediate operand addressing mode

Memory operand addressing mode

Direct addressing mode

Register indirect addressing mode

Based addressing mode

Indexed addressing mode

Based-Indexed addressing mode

Chapter5

Data transfer instructions

MOV

XCHG

XLAT

LEA

LDS

LES

Arithmetic instructions

Addition instruction

ADD

ADC

INC

AAA

DAA

Subtraction instructions

SUB

SBB

DEC

AAS

DAS

NEG

Multiplication and Division instrucion

MUL

DIV

IMUL

Logic instructions

AND

OR

XOR

NOT

Shift instructions

SAR/SAL

SHL/SHR

Rotate instructions

ROL/ROR

RCL/RCR

tags:CSnote