1 / 14

Lecture 11 Z80 Registers

Lecture 11 Z80 Registers. 동국대학교 홍유표. Registers in CPU. A CPU has registers that store key information for CPU operation. For example, PC is a register that stores the address of memory for next instruction fetch. Z80 Registers. Program Counter (PC).

Download Presentation

Lecture 11 Z80 Registers

An Image/Link below is provided (as is) to download presentation Download Policy: Content on the Website is provided to you AS IS for your information and personal use and may not be sold / licensed / shared on other websites without getting consent from its author. Content is provided to you AS IS for your information and personal use only. Download presentation by click this link. While downloading, if for some reason you are not able to download a presentation, the publisher may have deleted the file from their server. During download, if you can't get a presentation, the file might be deleted by the publisher.

E N D

Presentation Transcript


  1. Lecture 11Z80 Registers 동국대학교 홍유표

  2. Registers in CPU A CPU has registers that store key information for CPU operation. For example, PC is a register that stores the address of memory for next instruction fetch.

  3. Z80 Registers

  4. Program Counter (PC) The program counter holds the 16-bit address of the current instruction being fetched from memory. The PC is automatically incremented after its contents have been transferred to the address lines.

  5. Accumulator and Flag Registers “A” is an 8-bit accumulators and associated 8-bit flag register “F”. The accumulator holds the results of 8-bit arithmetic or logical operations while the FLAG register indicates specific conditions for 8-bit or 1 16-bit operations, such as indicating whether or not the result of an operation is equal to zero.

  6. Memory Stack 1000 • Bottom of stack: 4001 • As stack grows, SP decreases • No FULL, EMPTY flags • Instead, use CPU register to hold upper/lower limits of stack and checked  before PUSH  after POP Program Instr. PC 2000 Data AR 3000 Stack SP 3999 4000 4001 DR Stack is placed in a finite portion of main memory SP is a special-purpose register

  7. Stack Pointer (SP) The stack pointer holds the 16-bit address of the current top of a stack located anywhere in external system RAM memory. The external stack memory is organized as a last-in first-out (LIFO) file. Data can be pushed onto the stack from specific CPU registers or popped off of the stack to specific CPU registers through the execution of PUSH and POP instructions.

  8. General Purpose Registers General-purpose registers do not have specific mission so they can be used for any purpose that the programmer wants. each set containing six 8-bit BC, DE, and HL are such registers for Z80.

  9. Let’s Go Back to Z80 Instruction

  10. JP (Jump) • 형식 : JP address • PC <- address • 형식 : JP condition address • If condition is true, PC <- address

  11. Label 을 이용한 JP 명령어의 사용 형식 : JP LABEL (Similar to goto in C.) 예 : …. START : …. …. JP START

  12. CALL 형식 : CALL Label (Similar to function call in C.) 예 : …. CALL DELAY …. DELAY : …. RET

  13. DEC • 형식 : DEC reg • Decrement the content of reg. • If register pair HL contains 1001H, at execution of DEC HL the contents of HL are 1000H.

  14. HW #4 여러분의 Z80 oneboard상 LED에불이 켜지는 코드를 작성해 봅시다. 즉, output port 주소 7번에 다음과 같은 데이터가 나가는 프로그램을 작성해서 내일 실습시간에 보드에 올려 보도록 해요. 0000 1111 프로그램은 오늘 밤 9시까지 작성하여 yhong@dgu.edu와 ykang@mmchips.com로 보내 주세요.

More Related