Free for personal use but you must have written permission to reproduce

Similar documents
COSC 243. Instruction Sets And Addressing Modes. Lecture 7&8 Instruction Sets and Addressing Modes. COSC 243 (Computer Architecture)

Example Programs for 6502 Microprocessor Kit

NEW CEIBO DEBUGGER. Menus and Commands

ME4447/6405. Microprocessor Control of Manufacturing Systems and Introduction to Mechatronics. Instructor: Professor Charles Ume LECTURE 7

The "Branding Iron" EPROM Programmer (MOD ) INSTRUCTIONS Read all instructions prior to actual programming.

Programming Book for 6809 Microprocessor Kit

Cross Assembly and Program Development

NAM M6800 DISK-BUG DS VER 3.5 OPT PAG

538 Lecture Notes Week 5

538 Lecture Notes Week 5

Assembly Language programming (1)

You can examine the contents of a single memory location by typing a single address followed by a Return.

The 6502 Instruction Set

A. CPU INSTRUCTION SET SUMMARY

CHAPTER ASSEMBLY LANGUAGE PROGRAMMING

The Arnor products for the Amstrad CPC and Amstrad PCW are Copyright Brian Watson. All rights reserved.

2001 PET POCKET REFERENCE GUIDE TO COMMODORE'S LEADING EDGE COMPUTER PRODUCTS. ~ COPYRIGHT 1979, LEADING EDGE CO. ALL RIGHTS RESERVED

Getting Started with the HCS12 IDE

Intel Architecture Segment:Offset Memory Addressing

HESMON64TM By Terry Peterson. Instruction Manual

Using the stack and the stack pointer

EE 5340/7340 Motorola 68HC11 Microcontroler Lecture 1. Carlos E. Davila, Electrical Engineering Dept. Southern Methodist University

MOS 6502 Architecture

Accumulator and memory instructions 1. Loads, stores, and transfers 2. Arithmetic operations 3. Multiply and divide 4. Logical operations 5. Data test

COMPUTE! ISSUE 36 / MAY 1983 / PAGE 244

You can enter commands at the console any time after the prompt character is displayed.

2) We have to agree with this legal disclaimer before using the software. This step is necessary to ensure that nothing unpleasant occurs.

EXPERIMENT NO. 1 THE MKT 8085 MICROPROCESSOR TRAINER

; Once Initialized, monitor character in calls to CN05 ; set carry for input, to be tested CN35 C SEC

NOTE: ESCAPE is not always being checked for when the Monitor is performing a selected function,

Exam 2 E2-1 Fall Name: Exam 2

ME 4447/6405. Microprocessor Control of Manufacturing Systems and Introduction to Mechatronics. Instructor: Professor Charles Ume LECTURE 6

April 4, 2001: Debugging Your C24x DSP Design Using Code Composer Studio Real-Time Monitor

EB301. Motorola Semiconductor Engineering Bulletin. Programming EEPROM on the MC68HC811E2 during Program Execution. Freescale Semiconductor, I

melabs Serial LCD Firmware Version 1.1 3/5/07

2. Arithmetic Instructions addition, subtraction, multiplication, divison (HCS12 Core Users Guide, Sections 4.3.4, and ).

ECE3120: Computer Systems Hardware & Software Development Tools

instruction 1 Fri Oct 13 13:05:

SWTPC 6800/CT-1024/AC-30 Cassette Tape

OSIAC Read OSIAC 5362 posted on the course website

i ntel lee 8 Features 5 pecifications

3. (3) Convert the following CUSP instruction into the appropriate bit pattern: ADS+! $103

Programming the Motorola MC68HC11 Microcontroller

ME 6405 Introduction to Mechatronics

Disassembly of MC9S12 op codes Decimal, Hexadecimal and Binary Numbers

Disassembly of MC9S12 op codes Decimal, Hexadecimal and Binary Numbers

Chapter. Computer Architecture

Lab 10 CST8214 Ian! D. Allen Fall 2007

538 Lecture Notes Week 1

MC68705P3 Bootstrap ROM

2. (3) What are the 3 ways we talked about in class to monitor the status of an I/O device?

E3940 Microprocessor Systems Laboratory. Introduction to the Z80

Mark II Aiken Relay Calculator

MC9S12 Assembler Directives A Summary of MC9S12 Instructions Disassembly of MC9S12 op codes. Summary of HCS12 addressing modes ADDRESSING MODES

Practical Course File For

Microprocessor Architecture. mywbut.com 1

Micro-KIM Tutorial. Aart J.C. Bik

6800 Programming - Introduction. This section of our manual has been written to help you begin

melabs Serial LCD Firmware Version 1.0 2/7/07

8086 Interrupts and Interrupt Responses:

User. Application program. Interfaces. Operating system. Hardware

M0100. SOLOS (tm) /CUTER (tm) USER'S MANUAL Hollis Street P. O. Box 5260 Emeryville, CA San Mateo, CA (415) (415)

8051 Microcontrollers

EEL 4744C: Microprocessor Applications. Lecture 7. Part 1. Interrupt. Dr. Tao Li 1

Reading Assignment. Interrupt. Interrupt. Interrupt. EEL 4744C: Microprocessor Applications. Lecture 7. Part 1

HC11 Instruction Set

Small Computer Monitor User Guide

COSC345 Software Engineering. Basic Computer Architecture and The Stack

Module 8: Atmega32 Stack & Subroutine. Stack Pointer Subroutine Call function

Operating Manual Ver 1.1

EXTENDED DDT by Jim Dunion

1. Memory Mapped Systems 2. Adding Unsigned Numbers

Small Computer Monitor User Guide

Instruction : A command to the microprocessor to perform a given task on specified data. Each instruction has two parts

MCS6522 V E R S A T IL E IN T ERFACE A D A PTER

================== CEDRIC VERSION 2.1 By M.J.RANDALL ================== INTRODUCTION

PHUNSY Signetics 2650 Micro Computer

A Technical Overview of Commodore Copy Protection. Glenn Holmer ( ShadowM ) World of Commodore Expo, 12/01/2007

Exam I Review February 2017

Macro Assembler. Defini3on from h6p://

EE2007 Microprocessor systems.

CG2007 Microprocessor systems.

9 or > + [RET] gives error channel of active device. * or * = gives directory, one can follow standard CBM directory

BINARY LOAD AND PUNCH

CodeWarrior. Microcomputer Architecture and Interfacing Colorado School of Mines Professor William Hoff

THE 8051 MICROCONTROLLER

1. Given the binary bit string

SLOGGER' S ELECTRON EXPANSION 2.0. For the Acorn Electron with the ROMBOX PLUS or Acorn PLUS1 USER GUIDE

LECTURE #21: G-CPU & Assembly Code EEL 3701: Digital Logic and Computer Systems Based on lecture notes by Dr. Eric M. Schwartz

MSMF GATE CENTRE. Sub: MICROPROCESSORS. Time: 50min Date: Marks:33

Freescale Semiconductor, I SECTION 6 PROGRAM CONTROL UNIT

Introduction to Microcontrollers

; export symbols XDEF Entry ; export 'Entry' symbol ABSENTRY Entry ; for assembly entry point

An Introduction to Komodo

ET2640 Microprocessors

VARDHAMAN COLLEGE OF ENGINEERING (AUTONOMOUS) Shamshabad, Hyderabad

A3 Computer Architecture

Subroutine. Chapter 8

LAB 1: MC68000 CPU PROGRAMMING DATA TRANSFER INSTRUCTIONS

The ZCPR3 INSTALLATION WORKBOOK. by Richard Conn. First Revision, 8 March 1985 Original Draft, 20 February 1985

Transcription:

www.commodore.ca

www.commodore.ca Commodore Business Machines, Inc. 901 California Avenue Palo Alto, California 94304, USA Commodore/MOS Valley Forge Corporate Center 950 Rittenhouse Road Norristown, Pennsylvania 19401, USA 3370 Pharmacy Avenue Agincourt, Ontario, Canada M1W2K4 Eaglescliffe Industrial Estate Eaglescliffe, Stockton on Tees Teeside TS 160 PN, England 360 Euston Road London NW1 3BL, England Commodore Buromaschinen GmbH Frankfurter Strasse 171-175 6078 Neu Isenburg West Germany Commodore Japan Limited Taisei-Denshi Building 8-14 Ikue 1-Chome Asahi-Ku, Osaka 535, Japan Commodore Electronics (Hong Kong) Ltd. Watsons Estates Block C, 1 1 th floor Hong Kong, Hong Kong Machine language monitor TIM is the Terminal Interface Monitor program for MOS Technology's 65XX microprocessors. It has been expanded and adapted to function on the Commodore PET. Later production models have the TIM in ROM but your early model PET must use a cassette tape version of this monitor. In either case execution is transferred from the PET BASIC interpreter to TIM by the SYS command. To LOAD Your MONITOR, take the cassette with SQUIGGLE, MON- ITOR and BIGTIME, and put it on the tape unit with the MONITOR side up. Then type: LOAD "MONITOR" and when ready, RUN. Commands typed on the PET keyboard can direct TIM to start executing a program, display or later registers and memory locations, set breakpoints, and load or save binary data. Oil modifying memory, TIM performs automatic read after write verification to insure that addressed memory exists, is R/W type, and is responding correctly. TIM also provides several subroutines which may be called by user programs. These include reading and writing characters on the video display, typing a byte in hexadecimal and typing a CRLF sequence. TIM Commands M display memory R display register G begin execution X exit to BASIC L load S save EXAMPLES M DISPLAY MEMORY M C000,C010 C000 1 D C7 48 C6 35 CC E F C7 C008 C5 CA DF CA 70 CF 23 CB CO 10 9C C8 9C C7 74 C7 1 F C8 In a Display Memory command, the start and ending addresses must be completely specified as 4 digit hex numbers. To modify a memory location, move the cursor tip in the display, type the correction and press RETURN to enter the change. When you move the cursor to a line to do a screen edit, and press RETURN, the colon tells the monitor that you are re-entering data. R DISPLAY REGISTERS R PC SR AC XR YR SP C6ED 00 20 00 20 F5 Copyright 1978 by Commodore Business Machines Inc. Part No 323002 1

Registers are saved and restored upon each entry or exit from TIM. They may be modified or preloaded as in the display memory example above. The semicolon tells the monitor you are modifying registers. BEGIN EXECUTION. G C38B The GO command may have an optional address for the target. It none is specified, the PC from the R command is taken as the target. EXIT TO BASIC.X READY Causes a warm start of BASIC. In a warm start memory is not altered in any way and BASIC resumes operation the way it was before a monitor call was made. LOAD. L 01,MONITOR PRESS PLAY ON TAPE : :T1 OK FOUND MONITOR LOADING No defaults on a LOAD command. The device number and the file name must be completely specified. Operating system prompts for operator intervention are the same as for BASIC. Memory addresses are loaded as specified in the file header which is set up by the SAVE command. Machine language subroutines may be loaded from BASIC but care must he taken not to use BASIC variables as the variable pointer is set to the last byte loaded + I. S SAVE. S 01,MONITOR,04000,076D 076 is ending address +1 so that last byte of data is at PRESS PLAY ON TAPE _-1 076C. You must specify I OK greater than last address used. WRITING MONITOR Likewise, no defaults on the SAVE command. Any start and ending address may be specified. To cancel a command either type RETURN or press STOP to cancel a Display Memory, LOAD or SAVE. Interrupt and breakpoint action BRK is a software interrupt instruction which causes the CPU to interrupt execution, save PC and P registers on the stack and then branch through a vector at locations $02113and $021C. TIM initializes this vector to point at itself on entry by CALL. Unless the user modifies this vector, TIM will gain control when a BRK instruction is executed, print B* indicating entry via breakpoint (instead of C * entry via call) and the registers (as in the R command), and wait for user commands. Note that after a BRK which vectors to TIM, the user's PC points to the byte following the BRK; however, users who choose to handle BRK instructions themselves should note that BRK acts as a two-byte instruction, leaving the PC (on return via RTI) two bytes past the BRK instruction IRO is vectored normally in PET to an ISR which updates the clock and scans the keyboard every 60th of a second. If the vector is altered and the machine language subroutine does not restore it, a power-on reset must be performed. NMI is not provided for in PET. The processor line corresponding to this interrupt is permanently pulled UP. RESET vectors to a cold-start of BASIC. Memory is cleared. Reload and re-enter TIM via SYS command. TIM monitor calls and special locations JSR WRT $FFD2 JSR RDT $FFCF JSR GET $FFE4 JSR CRLF S 04F2 JSR SPACE S 063A JSR WROB $0613 JSR RDOB $ 065E JSR HEXIT $0685 Memory usage $0A-S22 zero page $400- $76A absolute RAM type a character input a character Get a character type a CR type a space type a byte read a byte Ascii to hex in A $23-$5A are zero page locations in the BASIC input buffer which may be used when BASIC is not using these locations. The second cassette buffer $33A-$3F F is a well protected location if that device is not used. Other memory locations may be used with considerable risk, depending on which piece of PET software wants to use it also. 2 3

Monitor checkout procedure 1) Power up your PET normally into BASIC command mode. Insert the cassette containing a monitor and use the SHIFT-RUN sequence to initiate a program load. You should see a display something like: C* PC SR AC XR YR SP C6ED 29 00 88 89 FE Exact values may vary, although the first and last values should he as shown. 2) The display of registers is the standard entry display message. It consists of C'* to identify entry by call, followed by the CPU register contents: program counter, processor status, accumulator, X index, Y index, and stack pointer. Note that all TIM inputs and outputs are in base 16 which is referred to as hexadecimal, or just hex. In hexadecimal the digits are 0,1,2,3,4,5,6,7,8.9,A,B,C,D,E,F. After printing the CPU registers, TIM is ready to receive commands from you. TIM indicates this "ready" status by' typing the prompting character "." on a new line. 3) The user's CPU register may also be displayed with the R command. Type an R and press RETURN. The monitor should respond as above, but without the asterisk. 4) Displayed values may be modified by screen edit and re-entry of the line via return. Remember to type spaces to delimit fields and type 4 digit hex numbers for addresses and 2 digits for byte contents. 5) Memory may be displayed and modified using the M command. Type:.M 0100,0107 You will see a display something like: 0 1 3 4 5 6 7 0100 20 00 30 30 30 30 30 Now use screen edit to modify in place on the screen, type RETURN and display again. 6) Use M and : to enter the following test program called CHSET because it prints the ASCII-64 character-set on the terminal. The M command is used to display memory, locations on the PET screen and it is then possible to use screen edit on each line and type RETURN to alter memory. * = $33A CRLF = $4F2 WRT = $ FFD2 33A 20 F2 04 CHSET JSR CRLF 33D A2 20 LDX #$20 33F 8A LOOP TXA 340 20 D2 FF JSR WRT 343 E8 INX 344 E0 60 CPX y$60 346 DO F7 BNE LOOP 348 00 BRK 349 4C 3A 03 JMP CHSET M 033A,034B 033A 20 F2 04 A2 20 8A 20 D2 0342 F F E8 E0 60 DO F7 00 4C 034A 3A 03 7) CHSET was assembled to reside in the 2nd cassette buffer. Type:. G 033A to execute the program. The listing should look like this:! " # $ % ' () *, -. / 0 1 2 3 4 5 6 7 8 9 : ; _?@ A B C D E F G H I J K L M N O P Q R S T U V W X Y Z [I] B* PC SR AC XR YR SP.; 0349 3B 5F 60 8D FE Note the address contained in the PC. It is possible to type G execute the program again without specifying an address. 8) Next we will link CHSET with BASIC. First replace the BRK instruction in location $348 with an RTS (return subroutine) 1 change $348 from 00 to 60). www.commodore.ca 9) ('hinge the USR function vector in locations 1 to point at the subroutine at $33A..: 0000 4C 3A 03 4 5

10) Exit from the monitor and re-enter BASIC..x READY Notes 1 1) Prow that the linkage is established by using both SYSand USR. A = USR (0) SYS (3 * 256 + 3 * 16 + 10) PET MEMORY MAP (IN 4K BLOCKS) (Enter these as direct base commands) F 1/0, Diagnostics, Monitor RUM E D C B A $E80O- $E000-E7FF Basic ROM Expansion ROM I/O Ports and Expansion I/O Screen Editor ROM 9 8 $8000-$83E7 TV display RAM 7 6 5 4 Expansion RAM 3 I Basic Text RAM (8k Version) 6 Page 0 $A-$5A Basic Input Buffer Page I Stack Pages 2-3 S-00 3 byte clock register S-)1() Interrupt vector $2113 Break inst. vector $27A Buffer for cassette = 1 $33A Buffer for cassette = 2 Pages 4-8 $400-$FFF Basic Text RAM www.commodore.ca