Southwest Specialty Products 6800 manual General Rules for Program Writing, Memory Diagnostics

Page 14

GENERAL RULES FOR PROGRAM WRITING

Although for a user program to be functional it need only work with the exact system it was written for, following a few simple rules reduces program modifications for 6800 systems using other monitors. Following these rules will make your programs more professional and versatile. Some general guidelines are as follows:

1.) Minimize the number of references made to the ROM.

2.) Do not use strange, in-between SWTBUG® addresses. Generally only the routines BADDR, BYTE, PDATA1, INHEX, OUT4HS, OUT2HS, CONTRL, INEEE and OUTEEE should be used.

3.) For large programs, vector I/O through a jump instruction for ease of change to match other I/O packages. Example:

DON’T

DO

à

JSR INEEE

JSR INPUT

JSR INEEE

JSR INPUT

à INPUT: JMP INEEE

JSR INEEE

JSR INPUT

à

4.) Try not to use the SWTBUG® RAM any more than necessary. With the exception of using it as stack storage and memory diagnostics, there is no real reason to use the SWTBUG® RAM area.

5.) Define the stack area at the beginning of the program. Example: Start LDS #$ A042. Relocating the stack location to A042 at the beginning of each of your programs will prevent you from having to reload the program counter addresses A048 and A049 each time you RESET and restart your program.

6.) Most programs should have a provision for exiting them without hitting the RESET button. A jump to CONTRL (7E E0E3) instruction in your program will cause SWTBUG® control to resume when executed.

MEMORY DIAGNOSTICS

The earlier memory diagnostics ROBIT, MEMCON and CDAT supplied by SWTPC were compatible only with MIKBUG®. The new versions ROBIT 2, MEMCON 3 and CDAT 2 are compatible with both MIKBUG® and SWTBUG®.

PROGRAM DESCRIPTION

Although the source listing of SWTBUG® is well commented, the following subroutine by subroutine description should be of use to those who wish to gain the maximum advantage of its routines.

TEMPORARY STORAGE LOCATIONS

IRQ (A000)

This location is used by the standard IRQ interrupt request feature. When an

 

interrupt is generated, processor control will jump to the location stored in

 

IRQ.

BEGA (A002)

This location is where the beginning address is stored for the punch and end

 

of tape routines.

ENDA (A004)

This location is where the ending address is stored for the punch and end of

 

tape routines. It is also used by the byte search routine.

NMI (A006)

NMI is used by the non-maskable interrupt (NMI) function. When an NMI is

 

generated, processor control will jump to the location stored in NMI.

13

Image 14
Contents ROM Monitor Verson Users Guide Swtpc Swtbug Swatbug Monitor ROM Swtbug Operation Swtbug InstallationReset Memory Examine and Change M addr Register Dump Function RBIT no Label Condition Code BITGO to USER’S Program Function G CT-1024 Clear Screen Command CAscii Tape Punch Command P Jump to USER’S Program JaddrLeast Significant Byte of Lower Address END of Tape Command EMost Significant Byte of Lower Address Most Significant Byte of Upper AddressSoftware Breakpoints Baddr Optional Port Command O not zeroTape Loader Function L Jump to Prom Program Z Disk Boot DDo not This is OK Byte Search F high address low address byteVectored Software Interrupts Using NON-MASKABLE InterruptsUsing Maskable IRQ Interrupts Vectored INPUT/OUTPUTBaud Rate PIA StrobingUse of the Control Interface for Read/Punch-On/Off Decoding Compatibility Loading Binary Tapes Thru SwtbugCO-RES Ver .0 and 1.01 Acia Modifications Special Notes on Using AN Acia and Program ModificationsBlkjak Swtpc 6800 Black Jack Program Program Description Memory DiagnosticsGeneral Rules for Program Writing Temporary Storage LocationsSwtbug Subroutine and Text String Description Outee ACC a ACC B Cksm IXR UnchangedOuthr E06B LDA aFCB Start LDX #TEXT JSR PDATA1 JMP Contrl TextFCC /HELLO ENDSearch E1AE Contrl E0E3Nmiv E1A7 Goto E1D0PNCHS9 E31E Clear E2CCBreak E2D9 Pnchon E34D