Tangerine Microtan 65
Writing Programs

 


Home
Up
About the emulator
Using the Emulator
Writing Programs
Game Pack 1
Game Pack 2
Download

Using TANBUG

TANBUG has several commands which are used to enter programs.  The "M" command is used to view or modify a single byte.  Machine code can be entered in this way.  The "L" command is used to list blocks of memory.  XBUG provides two additional commands, "T" translates assembler into machine code - one line at a time.  "I" interprets machine code into assembler.  The single line assembler provided by XBUG does not allow the use of labels.

Detailed information about the operation of these commands can be found in the Documentation.

Using a Two-Pass assembler

If you want to write programs for the Microtan yourself, it's far easier to use a PC based two-pass assembler than the XBUG single line assembler. If you want to rough it, see the XBUG manual! Any two-pass 6502 assembler will do, as long as it can produce Intel Hex files. A suitable DOS based assembler is available in Software Downloads.

  • You should edit your programs using a text editor (Windows notepad will do).
  • Copy the assembler to the directory where your program is stored, or make sure that it is on the path.
  • Open a DOS window and change to the directory where your program was stored.
  • Type "as6502 [yourprogram].asm" and it will be assembled and a file [yourprogram].hex created.
  • When you load this file into the emulator, it will not automatically run, so you should use the "G" command to start it.

Remember

  • You can only load programs into RAM - from addresses 0000 to afff. Any attempt to write to ROM or IO will be ignored.
  • After a program has been loaded, the emulator automatically performs a reset - TANBUG will overwrite memory locations 0000 to 0040 and the screen will scroll.

Example Program

This program calls TANBUG routines to display the letters "A" through "Z".

 	org	$0400

	jsr	$fe73		;New line
	lda	#$41		;Start with "A"
loop	pha			;Display it
	jsr	$fe75
	pla
	clc			;Increment to next character
	adc	#$1
	cmp	#$5b		;Have we finished?
	bne	loop		;No - loop back
	brk			;Stop

	end
	

Copyright (C) 1999-2002 by Geoff Macdonald

Last updated 03/09/2002