TRS-80 Coco 6809 ASM Hello World


The Tandy Color Computer from the 1980’s uses a Motorola 6809 microprocessor.

If you want to get started with assembly language on the Tandy Coco this is a small program to get started with.

You can use the EDATASM program cartridge to enter and assemble the executable program on a physical Coco machine or you can use an emulator with the following steps:

  1. Create a disk image with MAME imgtool
    imgtool create coco_jvc_rsdos hello.dsk
  2. Cross compile with lwasm
    lwasm -9bl -p cd -oHELLO.BIN hello.asm
  3. Put the BIN file output on the disk image with imgtool
    imgtool put coco_jvc_rsdos hello.dsk HELLO.BIN HELLO.BIN
  4. Run on the VCC Tandy Coco emulator.

Once assembled the program can be run from BASIC with the following command if you have saved the BIN file to disk.

LOADM"HELLO"
EXEC
* FILENAME: HELLO.ASM
* CLEARS SCREEN, PRINTS "HELLO WORLD" AND
* WAITS FOR KEYPRESS

	ORG	$2A00
	
START
* CREATE NEW STACK
	STS	OLDS
	LDS	#24+STK

* CLEAR THE SCREEN
	JSR	$A928
	
* PRINT THE MESSAGE		
	LDX	#MESG
LOOP    LDA	,X+
        BEQ	KEY

* CALL CHROUT
	JSR	[$A002]
	BRA	LOOP
        
* WAIT FOR KEYPRESS        
KEY	JSR	[$A000]
	BEQ	KEY

* RESTORE STACK
	LDS OLDS
     
* RETURN TO BASIC
DONE	RTS

* DATA
MESG	FCC /HELLO WORLD/
	FCB 13
	FCB 0
OLDS	RMB 2
STK	RMW 12
	END	START

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out /  Change )

Google photo

You are commenting using your Google account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s