================================================================



Similar documents
S7 for Windows S7-300/400

MICROPROCESSOR AND MICROCOMPUTER BASICS

Management Challenge. Managing Hardware Assets. Central Processing Unit. What is a Computer System?

Handout 17. by Dr Sheikh Sharif Iqbal. Memory Unit and Read Only Memories

UNIVERSITY OF CALIFORNIA, DAVIS Department of Electrical and Computer Engineering. EEC180B Lab 7: MISP Processor Design Spring 1995

Fondamenti su strumenti di sviluppo per microcontrollori PIC

Programming Logic controllers

MINIMUM TOOL REQUIREMENT FOR EPROM UPGRADE

MICROPROCESSOR. Exclusive for IACE Students iacehyd.blogspot.in Ph: /422 Page 1

3 SOFTWARE AND PROGRAMMING LANGUAGES

PART B QUESTIONS AND ANSWERS UNIT I

Microprocessor & Assembly Language

An Introduction to MPLAB Integrated Development Environment

CHAPTER 7: The CPU and Memory

Notes on Assembly Language

QUICK START GUIDE. SG2 Client - Programming Software SG2 Series Programmable Logic Relay

Chapter 1 Computer System Overview

DRV8312-C2-KIT How to Run Guide

Adapting the PowerPC 403 ROM Monitor Software for a 512Kb Flash Device

Apple II Technical Notes

Embedded Software development Process and Tools: Lesson-3 Host and Target Machines

Machine Architecture and Number Systems. Major Computer Components. Schematic Diagram of a Computer. The CPU. The Bus. Main Memory.

USBSPYDER08 Discovery Kit for Freescale MC9RS08KA, MC9S08QD and MC9S08QG Microcontrollers User s Manual

Logical Operations. Control Unit. Contents. Arithmetic Operations. Objectives. The Central Processing Unit: Arithmetic / Logic Unit.

Microcontrollers Figure 26-1 Objectives Key Words and Terms 26.1 OVERVIEW OF THE MICROCONTROLLER microcontroller

Computer System: User s View. Computer System Components: High Level View. Input. Output. Computer. Computer System: Motherboard Level

Topics. Introduction. Java History CS 146. Introduction to Programming and Algorithms Module 1. Module Objectives

SKP16C62P Tutorial 1 Software Development Process using HEW. Renesas Technology America Inc.

GETTING STARTED WITH PROGRAMMABLE LOGIC DEVICES, THE 16V8 AND 20V8

what operations can it perform? how does it perform them? on what kind of data? where are instructions and data stored?

Module 2. Embedded Processors and Memory. Version 2 EE IIT, Kharagpur 1

Technical Aspects of Creating and Assessing a Learning Environment in Digital Electronics for High School Students

Computers. Hardware. The Central Processing Unit (CPU) CMPT 125: Lecture 1: Understanding the Computer

Installing, upgrading and troubleshooting your CLIO system under the Windows environment.

How to Install and use Windows XP Mode and Windows Virtual PC in Windows 7 for older 32 bit only Applications

CS101 Lecture 26: Low Level Programming. John Magee 30 July 2013 Some material copyright Jones and Bartlett. Overview/Questions

Production Flash Programming Best Practices for Kinetis K- and L-series MCUs

Microcontroller Basics A microcontroller is a small, low-cost computer-on-a-chip which usually includes:

Chapter 4 System Unit Components. Discovering Computers Your Interactive Guide to the Digital World

Computer Systems Structure Input/Output

Newton Backup Utility User s Guide. for the Windows Operating System

ASSEMBLY LANGUAGE PROGRAMMING (6800) (R. Horvath, Introduction to Microprocessors, Chapter 6)

8-Bit Flash Microcontroller for Smart Cards. AT89SCXXXXA Summary. Features. Description. Complete datasheet available under NDA

Use of Simulator in Teaching Introductory Computer Engineering*

Fall Lecture 1. Operating Systems: Configuration & Use CIS345. Introduction to Operating Systems. Mostafa Z. Ali. mzali@just.edu.

Programming NAND devices

FlowKit in-circuit debug system

Procedure: You can find the problem sheet on Drive D: of the lab PCs. Part 1: Router & Switch

Chapter 2 Logic Gates and Introduction to Computer Architecture

MACHINE ARCHITECTURE & LANGUAGE

Discovering Computers Living in a Digital World

Central Processing Unit Simulation Version v2.5 (July 2005) Charles André University Nice-Sophia Antipolis

Parts of a Computer. Preparation. Objectives. Standards. Materials Micron Technology Foundation, Inc. All Rights Reserved

CSC 2405: Computer Systems II

UT69R000 MicroController Software Tools Product Brief

Memory Systems. Static Random Access Memory (SRAM) Cell

Technical Note. Micron NAND Flash Controller via Xilinx Spartan -3 FPGA. Overview. TN-29-06: NAND Flash Controller on Spartan-3 Overview

A Computer Glossary. For the New York Farm Viability Institute Computer Training Courses

BASIC COMPUTER ORGANIZATION AND DESIGN

MICROPROCESSOR BCA IV Sem MULTIPLE CHOICE QUESTIONS

Design of a High Speed Communications Link Using Field Programmable Gate Arrays

Chapter 8 Memory Units

High level code and machine code

How To Use An Ams 5812 Pressure Sensor With A Usb Starter Kit

EZ DUPE DVD/CD Duplicator

TNM Programmer User Manual. For Windows 7 / Vista / XP. TNM Electronics Ltd.

Computer Systems Structure Main Memory Organization

CHAPTER 4 MARIE: An Introduction to a Simple Computer

E-Blocks Easy RFID Bundle

_ v1.0. EVB-56x Evaluation & Development Kit for Motorola PowerPC MPC56x Microcontrollers USERS MANUAL. isystem, February /8.

THREE YEAR DEGREE (HONS.) COURSE BACHELOR OF COMPUTER APPLICATION (BCA) First Year Paper I Computer Fundamentals

EMP-20 Device Programmer

#65 4GHGTGPEG")WKFG #FXCPEGF"6GTOKPCN"5QHVYCTG 8GTUKQP"502 HQT"%QPVTQNNGT/#% Catalog # Rev.02

DsPIC HOW-TO GUIDE Creating & Debugging a Project in MPLAB

EXERCISE 3: String Variables and ASCII Code

A3 Computer Architecture

How to read this guide

by NetMedia, Inc. All rights reserved. Basic Express, BasicX, BX-01, BX-24 and BX-35 are trademarks of NetMedia, Inc. 2.

Chapter 2 Basic Structure of Computers. Jin-Fu Li Department of Electrical Engineering National Central University Jungli, Taiwan

The Programming Interface

Advanced Computer Architecture-CS501. Computer Systems Design and Architecture 2.1, 2.2, 3.2

Installing Your POS Hardware

An Overview of Stack Architecture and the PSC 1000 Microprocessor

CSE 141L Computer Architecture Lab Fall Lecture 2

(Refer Slide Time: 00:01:16 min)

PC2400 EEPROM PROGRAMMER INSTRUCTION MANUAL

ASSEMBLY PROGRAMMING ON A VIRTUAL COMPUTER

miniflash User Manual

CPU Organization and Assembly Language

Example of Standard API

RF Etch Monitor. Introduction

İSTANBUL AYDIN UNIVERSITY

CONFIGURATION M5000 APPLICATIONS SOFTWARE INSTALLATION HARDWARE INSTALLATION OPTION INSTALLATION HIGH MEMORY OPTION SIMM PACK INSTALLATION

When upgrading your TAPIT software make sure that all call accounting data has been exported before you begin the installation process.

INGENIEURBÜRO FÜR TECHNOLOGIE TRANSFER DIPL.-ING. B. P. SCHULZ-HEISE. Getting Started with. S7 for Windows. Version 6.x

BP-2600 Concurrent Programming System

FrontDesk Installation And Configuration

Computer Organization & Architecture Lecture #19

Block 3 Size 0 KB 0 KB 16KB 32KB. Start Address N/A N/A F4000H F0000H. Start Address FA000H F8000H F8000H F8000H. Block 2 Size 8KB 16KB 16KB 16KB

With respect to the way of data access we can classify memories as:

Transcription:

==== ==== ================================================================ DR 6502 AER 201S Engineering Design 6502 Execution Simulator ================================================================ Supplementary Notes M.J.Malone By: Use of Simulator ==================== Quick/Kick Start ================ using Some of dos and don'ts and reasons for m in DR6502 program will be given first. that default drive, not using card real be your used 2 use. be certain to 1) DO put all of DR6502 in on one drive and execute it from drive. It saves hassles later since it is easier to to current drive on all DR6502 files. 2) DO put your.bin file to be simulated on that same same reason. 3) Try not to use pathnames with DR6502. DR6502 does recognize pathnames. 4) DON'T expect to see any actual input or output when DR6502 without hardware simulator card. Without DR6502 is a software simulator only that is incapable of input/output though such operations can and should simulated through user intervention. 5) DON'T assume re is an error in DR6502 just because program did not work as expected. Many students have DR6502 in past and it has proven to work well, though small bugs were discovered in most recent YEAR of It is very common for students to make errors in logic or mistaken about operation of flags for instructions. If a genuine error is encountered, following should be provided: a) A listing of minimum assembly program required

produce error. IE 4-10 lines long where every line is required to induce error. b) The precise keystrokes/commands required to show error. Such documented errors will be repaired as expeditiously as possible. Starting ======== 1) System Requirements ---------------------- To run DR6502, a machine must be XT or AT compatible and have at least 640K of memory. Of that 640K at least 373K must be free after all memory resident programs and ram disks etc are installed. If re is not enough free memory in your computer, n some of memory resident programs must be removed or ram disk must be downsized. page 2 not 2) Code Requirements -------------------- Produce a pure text file containing your assembly code. Do use any text editor that encodes file in any way. If you are using project computer n remember that your final (target) computer code must start with following instructions:.org $E000 SEI LDX #$FF TXS ; LDX #$00 LDY #$00 InitDelay DEX BNE InitDelay DEY BNE InitDelay ; to Your code n follows. The first three statements are used

initialize microprocessor stack and se are also required when producing a code for DR6502. The next six instructions are a delay necessary to EVERY program used on project computer. These are required because project board uses a non-debounced reset switch circuit. Simple debouncing would violate rise time requirements of RST signal and more complex methods would require more chips on project computer board. A small addition to beginning of every student's program was not considered a problem. At end of your code you must have:.org $FFFC.WORD $E000.END This sets reset vector. When RST (reset) line is used to signal to processor to begin executing, processor is 'hardwired' to look in memory location $FFFC to find a vector pointing to beginning of user program. DR6502 expects to find reset vector in same place so se three directives are also required in programs to be simulated. 3) Assembling -------------- Any assembler capable of converting 6502 assembly language statements to a binary file of 6502 machine opcodes and operands would be acceptable. The TASM (Table oriented ASseMbler) is user supported package available to AER 201S students. TASM is a converter of ASC II assembly code files to binary executable files. It is capable of assembling for 6502 as well as several or processors. It is a common mistake to believe that re is some problem with fact that TASM program executes on an IBM type computer but produces code for a 6502 machine. Once again TASM is a

page 3 converter program. The machine it executes on does not determine what type of files it produces. TASM could be programmed to run on a Cray but it would still produce code for execution on a 6502 machine. The proper command line for assembling program 'myfile.asm' in current directory is: tasm -65 -b -l -fff myfile.asm myfile.bin myfile.lst Note on Options: -65 : Assemble for 6502 -b : Binary file output -l : List symbol table -fff: Fill unassigned spaces of EPROM with $FF any This produces a binary file named myfile.bin ready for DR6502 or EPROM programmer. The files myfile.lst can be used to look at errors that TASM may have found. 4) Eprom Burning ---------------- This is actually easier than simulating code so it will be dealt with first. The PC's in lab that are equipped with EPROM burners have software installed to copy.bin files onto EPROMs. The EPROM burner itself is a card for PC computers with a cable that leads to EPROM ZIF (Zero Insertion Force) socket module. You place your EPROM in socket in orientation suggested and press locking lever. Place disk with your software in floppy drive and type 'EPROM'. The EPROM burner menu has several options. You should check that EPROM type and programming voltage match EPROM you have. Load file from disk into EPROM program's buffer memory starting at address 0000. Check EPROM is blank by selecting 'blank check' function from menu. If EPROM checks out as blank, select 'program' or 'copy' from buffer to EPROM' function to program EPROM. Remove EPROM and place it in target computer. If you would like to change program in EPROM or if

EPROM did not check out as blank before programming n place EPROM in EPROM eraser unit. The EPROM eraser unit clears program from EPROM using ultraviolet light on memory gates. Erasing requires twenty minutes under ultraviolet light. 5) Writing an EEPROM -------------------- A routine has been written utilizing hardware simulator interface card, to write data to an EEPROM plugged into a project board RAM socket. EEPROMS must be of XL2864A type or equivalent. Simulating a Program with DR6502 ================================ page 4 Getting to Status Screen ---------------------------- To simulate program DR6502 needs code and memory configuration for target computer. To give this information to simulator re are two options. 1) Run CONFIG.EXE program by typing CONFIG, 2) Run DR6502.EXE by typing DR6502 and when it asks if it is configured for memory of target type 'n' for no. In this case DR6502 will call CONFIG program automatically. In CONFIG program user will be asked for type of memory elements and ir addresses. When EPROM is specified, user will be asked for name of.bin file that will be in memory of target computer. DR6502 expects to find this.bin file in current directory.

Once configuration is input, CONFIG will automatically call DR6502. This time since you have just finished running CONFIG program you can answer that 'y' "Yes, DR6502 is configured for memory of target". Provided you do not change name of binary file in subsequent revisions of your software, re is no need to run CONFIG program again. DR6502 will next ask if this will be a hardware simulator session. To use DR6502 in hardware mode, hardware simulator card and simulator software (DR6502) must be present in PC. The.BIN and all auxiliary files must be available. The simulator cable must be plugged into 6502 socket on target and target must be supplied with power from a power supply. DR6502 will read several files for information necessary for its operation and n will begin reading EPROM files. If hardware simulator is being used program will ask if EPROM corresponding to file is present or not. If EPROM is not present on target, simulator will use PC's memory to emulate it. The simulator will also ask if re is a symbol file that goes with.bin file (a.sym file produced with DRSYM.EXE and your.lst file) to be loaded into simulator. It is not necessary to have a symbol file but it does enhance performance of certain of simulator's functions. The simulator will next ask what type of processor you are using. The options are 0) - NMOS 6502, 1) Standard CMOS 65C02 and 2) Rockwell CMOS 65C02. The differences between each of se processors is instruction set. In newer revisions of processor, some new instructions were added. Choose selection that corresponds to processor that will be in your target computer.

page 5 look Interpreting Status Screen ------------------------------ The 'stopped' status screen will n appear and it should as shown below: --------------------------top of screen----------------------------- (Errors and Warnings Area) ================================================================ ==== ACC=00 XREG=00 YREG=00 SP=00 PC=E001 Status Register N V u B D I Z C 0 0 1 0 0 1 0 0 ================================================================ ==== E000 78 SEI (2) Fetch Address =FFFF E001 Next OpCode Vector Address=FFFF Elapsed Cycles (millions):000000.000002 ================================================================ ==== (Commands area) ---------------------------bottom of screen------------------------- The area at top of screen warns of error conditions detected by DR6502 and warns if opcode stream is becoming unusual. The next area down on screen shows current status of processor registers and flag register. The next area down on screen displays information about current program step. The opcode and operands are shown and n assembly mnemonic and addressing mode. If addressing mode involves a memory fetch n effective fetch address is shown. If address mode involves vector indirection n vector address

is was area also shown. The number of machine cycles since processor reset is also shown. Below lowest bar is commands where user commands are input. From status screen several commands are possible to view or manipulate memory or to start processor executing in one of several modes: shown processor Modes of Execution: (From slowest to fastest) --------------------------------------------- 'Single' Step Mode - While at 'Stopped' status screen (as above) user can press 's' key to cause to advance one machine instruction or STEP and return to 'Stopped' status screen. 'Go' Mode - While at 'Stopped' Status screen (as shown above) user can press 'g' key (for GO) to cause processor to execute a machine instruction, output all status information and continue on to next instruction. The 's' key will STOP execution and return simulator to 'Stopped' status screen. through mode status fast program page 6 'Go Fast' Mode - Since screen output takes most of time in execution loop, to speed processor's progress uninteresting parts of code a limited output 'fast' is available. By pressing '`' key in stopped screen, user can cause processor to enter execution where screen is cleared and only counter is displayed on screen. By pressing '`' again

user can make processor slow to full output 'go' mode. 'Go Really Fast' Mode - Since even printing program counter slows execution incredibly, a second fast mode was devised. Often user knows exactly to what point in code y would like processor to run. A 'breakpoint' could be used to halt processor at that point and user would need no screen output until that time. As a result when user has selected a breakpoint and enters '`' 'Go Fast' mode, processor will clear screen and enter a completely silent 'Really Fast' mode. There is about an order of magnitude speed difference between 'Go' and 'Go fast' and nearly anor order of magnitude between that and 'Go Really Fast'. The following are SOME of options are available in stopped menu. Influencing Execution --------------------- 'b' - 'set a Breakpoint' This allows user to set a point in memory as a breakpoint for execution. If processor encounters this memory location any time during execution, eir as a program location or a data access, execution in 'go' and 'go really fast' will stop and full stopped status screen is displayed. 'r' - 'change Registers' The user can modify contents of any of 6502 registers including flags, processor status register and program counter. Manipulating Memory ------------------- 'v' - 'View memory' This option performs a hexidecimal display of data space memory so that variables or arrays can be viewed. 'p' - 'Poke memory' This allows user to input hexidecimal

values into memory. page 7 Manipulating Programs --------------------- 'P' - '(re)program code' This option disassembles one page (256 bytes) of code and displays several lines on screen. The user can n edit code with a number of sub-options in 'P' program option. Changes made to code are not permanent unless 's'ave sub-option is selected before 'q'uit. Display Control --------------- 'm' - 'Monitor a variable' This option allows user to monitor on main output screen contents of a memory location that is an important variable to program. Summary ======= The previous explanations tried to address some of common concerns when students approach producing a piece of project software for AER201S. Complete information can only be gained by consulting: TASM documentation DR6502 documentation Project Computer Board Notes There is however no substitute for actually DOING. The sooner a student is completely familiar with process of moving a

code from concept to testing and implementation, faster it will go when design iterations become necessary. Design iterations result when software never works at all on first five tries, and doesn't work completely right until twentieth or fiftieth revision.