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:
- Create a disk image with MAME imgtool
imgtool create coco_jvc_rsdos hello.dsk
- Cross compile with lwasm
lwasm -9bl -p cd -oHELLO.BIN hello.asm
- Put the BIN file output on the disk image with imgtool
imgtool put coco_jvc_rsdos hello.dsk HELLO.BIN HELLO.BIN
- 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.
* 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