The first thing we need to do is get our software environment set up. We'll be using EasySXB to talk to the 134 over a USB port. EasySXB isn't available in the repositories, so we'll need to get it from Sourceforge.
https://sourceforge.net/projects/easysxb/files/
Other than EasySXB, we'll need CC65 which contains our assembler and linker and SRecord which will allow us to convert the binaries produced by CC65 to something we can send over the USB cable. This software can be installed with the command
Code: Select all
sudo apt install cc65 srecordCode: Select all
dmesg |grep FTDICode: Select all
[ 335.907678] usb 2-1.2: Manufacturer: FTDI
[ 335.944133] usbserial: USB Serial support registered for FTDI USB Serial Device
[ 335.944230] ftdi_sio 2-1.2:1.0: FTDI USB Serial Device converter detected
[ 335.946246] usb 2-1.2: FTDI USB Serial Device converter now attached to ttyUSB0Now, we're ready to fire up EasySXB and start talking to the 134. Start EasySXB. From the Options menu, chose Board Model and then select the 134. Now, from the File menu, choose Connect to SXB. You will be prompted to enter a device. Enter the port that we found in the previous step. Connect, then press the reset button on the 134. You should see something that looks like this
Code: Select all
134 ROM Version 1.07
(C) Copyright 1995
Western Design Center
01 07/04/1993 12:47:03
ADDR F A X Y SP
F1BC 30 0D 30 3F FF
.Now, we need to write some code and get it over to the 134. Here's a simple Hello World(ish) program
Code: Select all
;;Code start location. Be sure to set this when converting
;;to .srec with the --offset option
.org $0800
;;turn off the interupt routines
sei
;;set the number of times to print the string (10)
ldx #$0a
;;give us a little whitespace
jsr $f012
jsr $f012
main:
lda #'H' ;;put the first char in A
jsr $f00f ;;call the outch routine to print A to tty
lda #'i'
jsr $f00f
lda #'!'
jsr $f00f
lda #' '
jsr $f00f
dex ;;decrement counter
cpx $00 ;;is it zero?
beq done
jmp main
;;clean up and return to the monitor
done:
;;print cr/lf
jsr $f012
brk
This uses two routines from the monitor rom on the 134. JSR $F00F prints the contents of A as an ASCII character to the tty. And, JSR $F012 prints a CR/LF to the tty. The code is located at 0x0800. WDC suggests that this is a good part of RAM for messing around. Save this as hi.asm and we'll get it over to the 134. Assemble and link the code with the commands
Code: Select all
ca65 --cpu 65c02 hi.asm
ld65 -t none -o hi.bin hi.oNow, we need to convert the binary into a Motorola SRecord file so we can upload it to the 134. The following command will do the conversion as well as letting the 134 know where to load it into memory so that our jumps will match up with reality.
Code: Select all
srec_cat hi.bin -binary --offset 0x0800 -o hi.srecFinally, we can upload our code and run it. Switch back to EasySXB. If you've been messing around with the monitor, go ahead and reset the 134. Now, type e into the monitor. This will display and clear the error log. From the File menu, choose Upload Program. Browse to the folder that has hi.srec. You'll need to change the file type from hex to srec in the bottom. Once the file has uploaded, you will see several lines beginning with S then you should see the . prompt. Type g 0800. This will transfer control to the memory address containing the start of our program. If everything went according plan you should see something like this
Code: Select all
Uploading Program, ESC to cancel.
S
.S
.S
.g 0800
Hi! Hi! Hi! Hi! Hi! Hi! Hi! Hi! Hi! Hi!
ADDR F A X Y SP
0829 30 0D 00 3F FF
.
http://www.westerndesigncenter.com/wdc/ ... monrom.pdf
I'm a total beginner at this, so i'd love to hear any suggestions.
Hope this helps someone!