EE180: Microprocessor Systems Lecture Notes 5


Instructions requires that it must be specified by destination and then source

MOV instruction – copies data from one place to another

XCHG instruction – exchanges information between two registers or between a register and a data item

LEA instruction – “load effective address,” obtains the offset of the second operand and copies the value to the first operand.

PUSHA – “push all,” pushes the values of all the following registers in order: AX, CX, DX, BX, SP, BP, SI, DI

POPA – restored the values of these registers by popping the stack

Flag – whose value is 0 or 1, and used to indicate a particular condition.

Status Flag – describes the results generated by a certain instruction

Control Flag –control the operation of the processor

Flag Registers – 16 bits. Has 6 Status Flags, 3 control flags and 7 unused.



Status Flag
Control Flag
AF
Auxiliary Carry Flag
Used with decimal arithmetic
DF
Direction Flag
Used with strings
CF
Carry Flag
Used with unsigned number. Set to indicate that the result of an operation is too long to be stored in the destination operand
OF
Overflow Flag
Used with signed number. Set to indicate that the result of an operation is too long to be stored in the destination operand
IF
Interrupt Flag

PF
Parity Flag
If the result of an instruction contains an even number of bits with the value 1
SF
Sign Flag
Indicate that the result of an operation is negative
TF
Trap Flag

ZF
Zero Flag
Indicate that the result of an operation is zero




15
14
13
12
11
10
9
8
7
6
5
4
3
2
1
0




OF
DF
IF
TF
SF
ZF

AF

PF

CF


Modification of the status flag
a.    STC – set carry flag; Sets CF to 1
b.    CLC – clear carry flag; clears CF to 0
c.    CMC – complement carry flag;

Modification of the Control Flag
a.    STD
b.    CLC
c.    STI
d.    CLI

Jump is an instruction that tells the processor to continue execution at the address give3n by a particular label

Conditional Flag – is a jump that is executed only if a specified condition is true

JCXZ – the only jump instruction that test a register.

CMP Instruction – to compare two number
Share:

No comments:

Post a Comment

Thanks for Suggestion / Comment!

God Bless!

Our Sponsor

Popular Post

Blog Archive