Other WC16 Instructions Lecture L7.4. OpcodeNameFunctionNumber of Clock Cycles Fetch the byte at address T in RAM and load it into T1 Fetch.

Slides:



Advertisements
Similar presentations
8086 Ahad.
Advertisements

8085 Architecture & Its Assembly language programming
Microprocessors.
Programming 68HC11.
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.
Chapter 2 HARDWARE SUMMARY
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.
Return Stack Lecture 8.4 A VHDL Forth Core for FPGAs: Sect. 5.
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.
Lab 6 Program Counter and Program ROM Mano & Kime Sections 7-1 – 7-6.
Digilab DIO2 LCD Module F5.1. DIO2 circuit board block diagram.
The FC16 Forth Core Lab 7 Module F4.1. Lab 7 Hex OpcodeNameFunction 0000NOP No operation 0001DUP Duplicate T and push data stack. N
Recap – Our First Computer WR System Bus 8 ALU Carry output A B S C OUT F 8 8 To registers’ input/output and clock inputs Sequence of control signal combinations.
Return Stack Lecture L7.3. A 32 x 16 Stack Same as used in the Data Stack in Lab 7.
A Programming Language for the FC16 Forth Core
Programming Example Lecture 8.6 A VHDL Forth Core for FPGAs: Sect. 7.
8051 ASSEMBLY LANGUAGE PROGRAMMING
The Serial Communication Interface (SCI) MC9S12-DP256 Chapter 11.
LCD Display DIO2 Board CPLD. DIO2 Board CPLD Interface LCD Display.
RS-232 Port Lecture L9.3. Loop feedback RS-232 voltage levels: +5.5 V (logic 0) -5.5 V (logic 1)
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.
Microcontroller Intel 8051
The 8051 Microcontroller architecture
Forth A stack language.
CS-280 Dr. Mark L. Hornick 1 ASCII table. 2 Displaying Numbers as Text Problem: display numerical values as text Consider the numerical value 0x5A held.
SAP1 (Simple-As-Possible) Computer
Computer architecture Microprocessor based computers.
Computer Architecture Lecture 13 – part 2 by Engineer A. Lecturer Aymen Hasan AlAwady 7/4/2014 University of Kufa - Information Technology Research and.
Interrupts and reset operations. Overview  Introduction to interrupts – What are they – How are they used  68HC11 interrupt mechanisms – Types of interrupts.
University Of Engineering And Technology Taxila REF::NATIONAL TAIWANOCEAN UNIVERSITY 國立台灣海洋大學 Chapter 3 JUMP, LOOP and CALL Instructions.
The 8051 Assembly Language Branching & Subroutines
ECE 265 – LECTURE 3 68HC11 Address Space, Memory, Registers, and data transfers 3/29/ ECE265.
ELE22MIC Lecture 8 ASll Examples –16 Bit Counters –Buffalo Jump Table Interrupt processing (IRQ/RTI) Stack Frame & Base Pointer Wired OR.
Microprocessor Microprocessor (cont..) It is a 16 bit μp has a 20 bit address bus can access upto 220 memory locations ( 1 MB). It can support.
Lecture Set 4 Programming the 8051.
Computer Systems Organization
Microcontrollers. An embedded microcontroller is a chip which a computer processor with all it’s support functions (clocking and reset), memory, and i/O.
Picoblaze Overview EENG Introduction 8-bit microcontroller for Xilinx devices Soft Core – Soft Processor 5% of the resources of spartan 3 (3S200.
JUMP, LOOP, AND CALL INSTRUCTIONS
Ass. Prof. Dr Masri Ayob TK 2123 Lecture 14: Instruction Set Architecture Level (Level 2)
1 Basic Processor Architecture. 2 Building Blocks of Processor Systems CPU.
8085 INTERNAL ARCHITECTURE.  Upon completing this topic, you should be able to: State all the register available in the 8085 microprocessor and explain.
8 085Microprocessor Temp Reg (8) Accumulator (A reg) Flag flip flops(8) Instruction Register (8) Arithmetic Logic Unit ALU Instruction Decoder and Machine.
DEPARTMENT OF ELECTRONICS ENGINEERING V-SEMESTER MICROPROCESSOR & MICROCONTROLLER 1 CHAPTER NO microcontroller & programming.
Programmable System on Chip
BLOCK DIAGRAM OF INTEL 8085.
Lecture 2 Programming of 8086 Лектор: Люличева И.А. 1.
Microprocessor Systems Design I
Classification of Instruction Set of 8051
Assembly Language Programming of 8085
Lecture Set 5 The 8051 Instruction Set.
TAO1221 COMPUTER ARCHITECTURE AND ORGANIZATION LAB 3 & 4 Part 2
Machine control instruction
Data Processing Instructions
CS 301 Fall 2002 Control Structures
Branching and Looping Lecture L3.2.
Timer.
Fast, Asynchronous SRAM
Introduction to Micro Controllers & Embedded System Design Instruction set Department of Electrical & Computer Engineering Missouri University of Science.
ECE 3430 – Intro to Microcomputer Systems
Microprocessors And Microcontrollers
Introduction to Micro Controllers & Embedded System Design Instruction set Department of Electrical & Computer Engineering Missouri University of Science.
Important 8051 Features On chip oscillator 4K bytes ROM 128 bytes RAM
DIO2 Board Projects.
The Von Neumann Machine
Return Stack Lab 8.
8/23/
Presentation transcript:

Other WC16 Instructions Lecture L7.4

OpcodeNameFunctionNumber of Clock Cycles Fetch the byte at address T in RAM and load it into T1 Fetch the byte at address T in ROM and load it into T1 Fetch the 8-bit byte from Port S and load it into T1 Fetch the 8-bit byte from the DIO2 data bus and load it into T DIO2! Store the byte in N at the DIO2 address in T. Pop both T and N3 0100LIT Load inline literal to T and push data stack2 0101JMP Jump to inline address2 0102JZ Jump if all bits in T are ‘0’ and pop T2 0106JB1LO Jump if input pin B1 is LO2 0107JB2LO Jump if input pin B2 is LO2 0108JB3LO Jump if input pin B3 is LO2 0109JB0LO Jump if input pin B0 is LO2 010AJB1HI Jump if input pin B1 is HI2 010BJB2HI Jump if input pin B2 is HI2 010CJB3HI Jump if input pin B3 is HI2 010DJB0HI Jump if input pin B0 is HI2 010ERAMSTORE Store the byte in N at the address in T. Pop both T and N2 Other Instructions

when lit => tload <= '1'; nload <= '1'; tsel <= "001"; dpush <= '1'; Load inline literal to T and push data stack. LIT

when jb0LO => pload <= not B(0); psel <= '0'; pinc <= B(0); Jump if input pin B0 is LO. JB0LO

when jb0HI => pload <= B(0); psel <= '0'; pinc <= not B(0); Jump if input pin B0 is HI JB0HI

Hex2asc.whp \ Convert hex to ASCII HEX : hex2asc ( n -- asc ) 0F AND \ mask upper nibble DUP 9 > \ if n > 9 IF 37 + \ add $37 ELSE 30 + \ else add $30 THEN ; : main( -- ) BEGIN waitb0 DUP DIG! waitb0 hex2asc DIG! AGAIN ;

LIT, --2 X"000f", --3 andd, --4 dup, --5 LIT, --6 X"0009", --7 gt, --8 JZ, --9 X"0010", --a LIT, --b X"0037", --c plus, --d JMP, --e X"0013", --f LIT, --10 X"0030", --11 plus, --12 RET, --13 : hex2asc ( n -- asc ) 0F AND \ mask upper nibble DUP 9 > \ if n > 9 IF 37 + \ add $37 ELSE 30 + \ else add $30 THEN ;

when jmp => pload <= '1'; psel <= '0'; pinc <= '0'; Jump to inline address. JMP

when jz =>-- pop flag pload <= not z; psel <= '0'; pinc <= z; tload <= '1'; nload <= '1'; tsel <= "111"; nsel <= "01"; dpop <= '1'; Jump if all bits in T are ‘0’ and pop T JZ -- z <= '0' if T = all zeros

BEGIN…WHILE…REPEAT BEGIN WHILE REPEAT

x = 1 i = 2 DO WHILE i <= n x = x * i i = i + 1 ENDDO factorial = x : factorial ( n -- n! ) 1 2 ROT \ x i n BEGIN \ x i n 2DUP <= \ x i n f WHILE \ x i n -ROT TUCK \ n i x i * SWAP \ n x i 1+ ROT \ x i n REPEAT \ x i n 2DROP ; \ x Factorial

Fact16.whp \ Example of BEGIN...WHILE...REPEAT : UM* ( u1 u2 - upL upH ) 0 mpp mpp ROT_DROP ; : *( n1 n2 -- n3 ) UM* DROP ; : factorial ( n -- n! ) 1 2 ROT \ x i n BEGIN \ x i n OVER OVER <= \ x i n f WHILE \ x i n -ROT TUCK \ n i x i * SWAP \ n x' i 1+ ROT \ x' i' n REPEAT \ x i n DROP DROP ; \ x : main( -- ) BEGIN waitB0 DUP DIG! waitB0 factorial DIG! AGAIN ;

LIT, --1a X"0001", --1b LIT, --1c X"0002", --1d rot, --1e over, --1f over, --20 lte, --21 JZ, --22 X"002d", --23 mrot, --24 tuck, --25 CALL, --26 X"0016", --27 swap, --28 plus1, --29 rot, --2a JMP, --2b X"001f", --2c drop, --2d drop, --2e RET, --2f : factorial ( n -- n! ) 1 2 ROT BEGIN 2DUP <= WHILE -ROT TUCK * SWAP 1+ ROT REPEAT 2DROP ;