Return Stack Lecture L7.3. A 32 x 16 Stack Same as used in the Data Stack in Lab 7.

Slides:



Advertisements
Similar presentations
The LC-3 – Chapter 6 COMP 2620 Dr. James Money COMP
Advertisements

WHYP Test Files Lab 9. y1 The WC16 WHYP Core Modifications for Multiplication and Division.
1 Chapter 3 Jump, Loop, and Call Instructions. 2 Sections 3.1 Loop and Jump Instructions 3.2 Call Instructions 3.3 Time Delay Generation and Calculation.
CPS3340 COMPUTER ARCHITECTURE Fall Semester, /17/2013 Lecture 12: Procedures Instructor: Ashraf Yaseen DEPARTMENT OF MATH & COMPUTER SCIENCE CENTRAL.
Apr. 12, 2000Systems Architecture I1 Systems Architecture I (CS ) Lecture 6: Branching and Procedures in MIPS* Jeremy R. Johnson Wed. Apr. 12, 2000.
EECC250 - Shaaban #1 Lec # 6 Winter Stack-Related Instructions PEA Push Effective Address Calculates an effective address and pushes it.
TK 2633 Microprocessor & Interfacing
A Simple Microcontroller VHDL Tutorial R. E. Haskell and D. M. Hanna T6: VHDL State Machines.
Forth Lecture L7.1. A Brief History of Programming Languages
Data Stack Lecture 8.2 A VHDL Forth Core for FPGAs: Sect. 3.
COMP3221: Microprocessors and Embedded Systems--Lecture 8 1 COMP3221: Microprocessors and Embedded Systems Lecture 8: Program Control Instructions
Return Stack Lecture 8.4 A VHDL Forth Core for FPGAs: Sect. 5.
Programming Languages From FORTRAN to WHYP. A Brief History of Programming Languages
Multi-Base Calculator CSE378 Final Project By Matthew Lehn & Yanqing Zhu December 17, 2001 Professor Haskell.
Objective The object of the game is to convert as many hexadecimal numbers to binary coded decimal numbers correctly within thirty (30) seconds. How.
Room: E-3-31 Phone: Dr Masri Ayob TK 2633 Microprocessor & Interfacing Lecture 1: Introduction to 8085 Assembly Language.
CSCE 212 Quiz 2 – 2/2/11 1.What is the purpose of the jal instruction? 2.What are the two conditional branching (if, goto; not the slt instruction) instructions.
The FC16 Forth Core Lab 7 Module F4.1. Lab 7 Hex OpcodeNameFunction 0000NOP No operation 0001DUP Duplicate T and push data stack. N
Chapter 9 & 10 Subroutines and Interrupts. JSR Instruction: JSR offset (11 bit) xxxxxxxxxxx [PC ]  R7, JMP Offset Jump to Subroutine at offset.
A Programming Language for the FC16 Forth Core
Programming Example Lecture 8.6 A VHDL Forth Core for FPGAs: Sect. 7.
COMP3221: Microprocessors and Embedded Systems--Lecture 9 1 COMP3221: Microprocessors and Embedded Systems Lecture 9: Data Transfer Instructions
Data Stack Instructions Lab 7. Data Stack WHYP Data Stack Instructions DUP( n -- n n ) SWAP( a b -- b a ) DROP( a -- ) OVER( a b -- a b a ) ROT( a.
Design of Embedded Systems Using 68HC12(11) Microcontrollers - R. E. Haskell Subroutine and Stacks Chapter 2.
Other WC16 Instructions Lecture L7.4. OpcodeNameFunctionNumber of Clock Cycles Fetch the byte at address T in RAM and load it into T1 Fetch.
Microcontroller Intel 8051
Stacks and Subroutines ELEC 330 Digital Systems Engineering Dr. Ron Hayne Images Courtesy of Ramesh Gaonkar and Delmar Learning.
Instruction Set Design by Kip R. Irvine (c) Kip Irvine, All rights reserved. You may modify and copy this slide show for your personal use,
Computer Architecture Lecture 13 – part 2 by Engineer A. Lecturer Aymen Hasan AlAwady 7/4/2014 University of Kufa - Information Technology Research and.
13/02/2009CA&O Lecture 04 by Engr. Umbreen Sabir Computer Architecture & Organization Instructions: Language of Computer Engr. Umbreen Sabir Computer Engineering.
ECE 265 – LECTURE 8 The M68HC11 Basic Instruction Set The remaining instructions 10/20/ ECE265.
Microprocessor Dr. Rabie A. Ramadan Al-Azhar University Lecture 7.
The 8051 Assembly Language Branching & Subroutines
Computer Architecture Lecture 13 – part 1 by Engineer A. Lecturer Aymen Hasan AlAwady 31/3/2014 University of Kufa - Information Technology Research and.
Today’s Lecture Unconditional branch instruction
ECE 265 – LECTURE 5 The M68HC11 Basic Instruction Set 12/8/ ECE265.
Lecture Set 4 Programming the 8051.
JUMP, LOOP, AND CALL INSTRUCTIONS
Subroutines and Stacks. Stack The stack is a special area in memory used by the CPU to store register information or general data information during program.
ICS51 Introductory Computer Organization Accessing parameters from the stack and calling functions.
“ INSTRUCTIONS SET OF AVR MICROCONTROLLER ” SIGMA INSTITUTE OF ENGINEERING Prepared By: SR.NO NAME OF STUDENT ENROLLMENT 1 Abhishek Lakhara
Chapter 14 Functions.
Unit 1 Instruction set M.Brindha AP/EIE
Classification of Instruction Set of 8051
The Stack.
3.Instruction Set of 8085 Consists of 74 operation codes, e.g. MOV
Lecture Set 5 The 8051 Instruction Set.
Subroutines and the Stack
TAO1221 COMPUTER ARCHITECTURE AND ORGANIZATION LAB 3 & 4 Part 2
Microcomputer Programming
CS 301 Fall 2002 Control Structures
Stack and Subroutines Module M17.1 Section 11.2.
Fast, Asynchronous SRAM
Branching Instructions
Subroutines and the Stack
Chapter 8 Central Processing Unit
Processor Organization and Architecture
Microprocessors And Microcontrollers
The University of Adelaide, School of Computer Science
L13b – 32 bit multiply Department of Electrical and
COMP3221: Microprocessors and Embedded Systems
Chapter 6 - Procedures and Macros
Chapter 10 And, Finally... The Stack
EE6502/MPMC/UNIT II/STACK AND SUBROUTINE/T.THARANKUMAR
DIO2 Board Projects.
Subroutines and the Stack
COMP3221: Microprocessors and Embedded Systems
Some Assembly (Part 2) set.html.
Return Stack Lab 8.
Computer Organization
Presentation transcript:

Return Stack Lecture L7.3

A 32 x 16 Stack Same as used in the Data Stack in Lab 7

A 32 x 16 Stack Module

The Return Stack

The WC16 WHYP Core

CodeNameFunction 0030>R “To-R” Pop T and push it on return stack. 0031R> “R-from” Pop return stack R and push it into T. “R-fetch” Copy R to T and push data stack 0033R>DROP “R-from-drop” Pop return stack R and throw it away 0039LD! “LD store” Store 8-bits of T into the 8-bit LD register Return Stack and I/O Instructions

when tor => tload <= '1'; nload <= '1'; tsel <= "111"; nsel <= "01"; dpop <= '1'; rload <= '1'; rpush <= '1'; rinsel <= '1'; “To-R” Pop T and push it on return stack. >R

“R-from” Pop return stack R and push it into T. R> when rfrom => tload <= '1'; nload <= '1'; tsel <= "011"; dpush <= '1'; rsel <= '1'; rload <= '1'; rpop <= '1';

“R-fetch” Copy R to T and push data stack when rfetch => tload <= '1'; nload <= '1'; tsel <= "011"; dpush <= '1';

“R-from-drop” Pop return stack R and throw it away R>DROP when rfromdrop => rsel <= '1'; rload <= '1'; rpop <= '1';

CodeNameFunction 0030>R “To-R” Pop T and push it on return stack. 0031R> “R-from” Pop return stack R and push it into T. “R-fetch” Copy R to T and push register stack 0033R>DROP “R-from-drop” Pop return stack R and throw it away 0039LD! “LD store” Store 8-bits of T into the 8-bit LD register Return Stack and I/O Instructions

when ldstore => ldload <= '1'; tload <= '1'; nload <= '1'; tsel <= "111"; nsel <= "01"; dpop <= '1'; “LD store” Store 8-bits of T into the 8-bit LD register and pop data stack LD! ldreg LD(7:0) clr clk ldload

CodeNameFunction 0103DRJNE Decrement R and jump if R is not zero 0104CALL Call subroutine 0105RET Subroutine return Transfer Instructions

>R Decrement top of return stack and branch back to if not equal to zero. Therefore, are executed n times. FOR…NEXT Loop n FOR NEXT drjne

Decrement R and jump if R is not zero DRJNE when drjne => rdec <= not r1; pload <= not r1; psel <= '0'; pinc <= r1; rsel <= r1; rload <= r1; rpop <= r1; -- r1 <= '1' if R-1 is all zeros r1 := '0'; for i in width-1 downto 1 loop r1 := r1 or R(i); end loop; r1 := (not r1) and R(0);

The Return Stack

Call subroutine Jump to address M and push address of next instruction (P + 1) on return stack CALL when call => pload <= '1'; rload <= '1'; rpush <= '1'; call, X”1234”, In ROM:

Subroutine return Jump to address on top of the return stack, and pop the return stack RET when ret => psel <= '1'; pload <= '1'; rsel <= '1'; rload <= '1'; rpop <= '1';