EEE226 - PowerPoint PPT Presentation

About This Presentation
Title:

EEE226

Description:

EEE226 DR. ZAINI ABDUL HALIM Flag The flag are set or reset after the execution of an arithmetic or logic operation; data copy instructions do not affect any flags. – PowerPoint PPT presentation

Number of Views:46
Avg rating:3.0/5.0
Slides: 14
Provided by: PuanZ
Category:
Tags: eee226

less

Transcript and Presenter's Notes

Title: EEE226


1
EEE226
  • DR. ZAINI ABDUL HALIM

2
Flag
  • The flag are set or reset after the execution of
    an arithmetic or logic operation data copy
    instructions do not affect any flags.
  • Z-Zero set to 1 when the result is zero,
    otherwise it is reset
  • CY-Carry operation has a carry, CY is 1,
    otherwise it is 0.
  • S-Sign is set if bit D7 of the result is 1,
    otherwise it is reset.
  • P-Parity set if the result has an even number of
    1s, odd number of 1s, the flag is reset.
  • AC-Auxiliary Carry, carry is generated by digit
    D3 and passed to D4, the AC flag is set.

3
Logical Operation
  • AND, Or, exclusive OR-Any 8 bit number, or the
    contents of a register or of a memory location
    The result are stored in accumulator. The result
    are stored in acc.
  • ANA D Assume A 54H D 82H
  • 54H 01010100
  • 82H 10000010
  • 00000000
  • Flag S0, Z1, P1, AC0
  • , CY0
  • ANI 97H Assume AA3H
  • A3H 10100011
  • 97H 10010111
  • 10000011 S1, Z0, AC1, P0, CY0

4
Logical Operation
  • Rotate-each bit in acc can be shifted either left
    or right to the next position.
  • RAR rotate acc right through carry
  • RRC - rotate acc right bit D0 is placed in the
    position of D7 As well as in the carry flag

5
Logical operation
  • Compare-any 8 bit number, or the contents of the
    register or a memory location can be compared for
    equality, greater than or less than with the
    contents of acc. (acc operands)
  • Altreg/Mem C1 and Z0
  • AReg/Mem Z1, C0
  • AgtReg/Mem C and Z0
  • Example CMP B compare with acc
  • Assume A 57H, B62H
  • A57H01010111
  • B62H01100010
  • After execution A 57H and B62H
  • S1, Z0, AC1, P1, CY1

6
Cont..
  • CPI compare Immediate with Acc
  • Example CPI 0C2H

7
Logical operation
  • Complement The contents of the acc can be
    complemented, 0 to 1 and 1 to 0.
  • Example
  • CMA complement acc
  • Assume the data byte of acc is 89H
  • 89H 10001001
  • After 0111011076H
  • Example
  • CMC complement carry

8
Branching Operation
  • This group of instruction alters the sequence of
    program execution either conditionally or
    unconditionally.
  • Jump JC, JNC, JP (S0 JM(S1), JZ (Z1), JNZ
    (Z0)
  • Example JZ start
  • Call, return and Restart
  • CALL DELAY
  • RET

9
Machine control operation
  • Example Halt, Interrupt, NOP

10
Data Format
  • µp operates in binary. However real world
    operates in decimal number
  • Therefore we need to code binary number into
    different media.
  • In 8 bit processor, commonly used codes and data
    formats are ASCII, BCD, signed integer and
    unsigned integers

11
Data Format
  • ASCII Code- 7 bit alphanumeric code that
    represents decimal number, English alphabets. 8
    bit code, 1 bit to represent graphical character.
  • BCD Code- used for decimal number, 0 to 9. 4
    bits are required to represent 10 digits. 8 bit
    register can accommodate two BCD numbers.
  • Signed Integer- either positive or negative
    number. D7 is used for the sign, 0 represent the
    positive sign and 1 represents the negative
    sign.D0-D6 represent maginitude. The largest
    magnitude is 7F. All negative numbers are
    represented in 2s complement.

12
Cont..
  • Unsigned Integers 8 bits to represent magnitude.
    The largest number can be processed at one time
    is FFH. Numbers larger than 8 bits (such as
    16-bit or 24 bit) are processed by dividing them
    in groups of 8 bits.

13
THANK YOU
Write a Comment
User Comments (0)
About PowerShow.com