6502 with a serial port - a minimal monitor?
Re: 6502 with a serial port - a minimal monitor?
Here's the package. Assembles into $F700-$FFFF (2303 bytes).
There's a readme file included. Just fix the ACIA1.asm code for your terminal, and assemble.
Daryl
There's a readme file included. Just fix the ACIA1.asm code for your terminal, and assemble.
Daryl
- Attachments
-
- SBC2OSLite.zip
- (61.71 KiB) Downloaded 120 times
Please visit my website -> https://sbc.rictor.org/
Re: 6502 with a serial port - a minimal monitor?
I just realized that I had the CRC tables in the upload.asm files. I can save another 512 bytes of ROM by generating the tables in RAM, as long as there's enough RAM in the target. The new code is < 2k (1792 bytes). The tables need to be placed in RAM where they won't get overwritten by the files being downloaded.
The new file is attached with added directions in the readme.
Daryl
The new file is attached with added directions in the readme.
Daryl
- Attachments
-
- SBC2OSLiter.zip
- This version generates the CRC tables in RAM - saves 512 bytes of ROM
- (59.72 KiB) Downloaded 114 times
Please visit my website -> https://sbc.rictor.org/
Re: 6502 with a serial port - a minimal monitor?
8BIT wrote:
...I can save another 512 bytes of ROM by generating the tables in RAM, as long as there's enough RAM in the target. The new code is < 2k (1792 bytes)...
Thanks again! I will try to integrate your code today.
In theory, there is no difference between theory and practice. In practice, there is. ...Jan van de Snepscheut
Re: 6502 with a serial port - a minimal monitor?
Instead of using CRC tables, you could also update the CRC by code. It'll be slower, but with a 50/100MHz core, it's probably fast enough for practical purposes.
Re: 6502 with a serial port - a minimal monitor?
I presume CRC is for XModem... personally I haven't had any issues just sending binaries across the serial port, assuming the handshaking works...
In theory, there is no difference between theory and practice. In practice, there is. ...Jan van de Snepscheut
Re: 6502 with a serial port - a minimal monitor?
Oy! I didn't realize the monitor is full of 65C02 instructions... Arlet's core does 6502 only. Why isn't anything easy?
In theory, there is no difference between theory and practice. In practice, there is. ...Jan van de Snepscheut
Re: 6502 with a serial port - a minimal monitor?
enso wrote:
I presume CRC is for XModem... personally I haven't had any issues just sending binaries across the serial port, assuming the handshaking works...
Daryl
Please visit my website -> https://sbc.rictor.org/
Re: 6502 with a serial port - a minimal monitor?
enso wrote:
Oy! I didn't realize the monitor is full of 65C02 instructions... Arlet's core does 6502 only. Why isn't anything easy?
Daryl
Please visit my website -> https://sbc.rictor.org/
- GARTHWILSON
- Forum Moderator
- Posts: 8774
- Joined: 30 Aug 2002
- Location: Southern California
- Contact:
Re: 6502 with a serial port - a minimal monitor?
8BIT wrote:
enso wrote:
I presume CRC is for XModem... personally I haven't had any issues just sending binaries across the serial port, assuming the handshaking works...
http://WilsonMinesCo.com/ lots of 6502 resources
The "second front page" is http://wilsonminesco.com/links.html .
What's an additional VIA among friends, anyhow?
The "second front page" is http://wilsonminesco.com/links.html .
What's an additional VIA among friends, anyhow?
- BigDumbDinosaur
- Posts: 9428
- Joined: 28 May 2009
- Location: Midwestern USA (JB Pritzker’s dystopia)
- Contact:
Re: 6502 with a serial port - a minimal monitor?
8BIT wrote:
enso wrote:
I presume CRC is for XModem... personally I haven't had any issues just sending binaries across the serial port, assuming the handshaking works...
Daryl
I use Motorola S-records for transmitting code to POC. No need for something as convoluted as Xmodem on a short-range (under 50 meters) serial link, as long as a reliable form of handshaking is in place. Motorola S-record (or Intel hex) has a built-in error checking regime that is adequate for such usage, and is faster.
Xmodem and its progeny are primarily of value when data goes through modems. Even then, Xmodem is of questionable value, since all modern modems are capable of error checking in hardware.
x86? We ain't got no x86. We don't NEED no stinking x86!
Re: 6502 with a serial port - a minimal monitor?
8BIT wrote:
Also, from the terminal side, how do you send a raw binary file?
Re: 6502 with a serial port - a minimal monitor?
8BIT wrote:
... I can take a look and fix the code - should not be too hard...
I've been using GtkTerm - it lets you send a binary. It doesn't have scripting, but allows you to see and send hex bytes and twiddle handshaking lines, which is nice for debugging the serial port.
EDIT: in Linux you can also
Code: Select all
cp <file> /dev/ttyUSB0In theory, there is no difference between theory and practice. In practice, there is. ...Jan van de Snepscheut
Re: 6502 with a serial port - a minimal monitor?
If the consensus is that xmodem is of no value, then it can be removed - reducing the Monitor to <1k. It would be about 1.5k with the Intel-hex downloader still on board. Those two are combined in one file but could be split apart if desired. It's pretty easy to modify the Monitor code to support more or less commands.
Enso, you can remove the xmodem code and replace with your own binary file transfer code if that is your preference. I can show you how to integrate it into the Monitor.
Will try to work on the 65C02-> 6502 code tonight.
Daryl
Enso, you can remove the xmodem code and replace with your own binary file transfer code if that is your preference. I can show you how to integrate it into the Monitor.
Will try to work on the 65C02-> 6502 code tonight.
Daryl
Please visit my website -> https://sbc.rictor.org/
Re: 6502 with a serial port - a minimal monitor?
8BIT wrote:
...I can show you how to integrate it into the Monitor....
BTW, having the monitor well under 2K is great as it allows us to use the same 2K BRAM for both hight ROM/vector/monitor ROM and page 0 and 1 RAM.
Thank you again for all the help
In theory, there is no difference between theory and practice. In practice, there is. ...Jan van de Snepscheut
Re: 6502 with a serial port - a minimal monitor?
I wrote a little parser that reads tass files and with the intention of writing out Kingswood-compatible files. Right now it just dumps the lines to the output file, fields separated by |
It splits each assembly line into 4 fields (label,opcode,operand,comment) and gives you a chance to process it and write it out. It is very easy to adapt to output any kind of code (and possibly turn into an assembler...)
I wrote it in python as I always wanted to learn it, and it seems like a pretty good language for text manipulation. Until today I haven't written a line of python - it is pretty easy (I am sure my code is terrible for those who know the language - suggestions welcome)
EDIT: fixed errors.
Strategy:
It splits each assembly line into 4 fields (label,opcode,operand,comment) and gives you a chance to process it and write it out. It is very easy to adapt to output any kind of code (and possibly turn into an assembler...)
I wrote it in python as I always wanted to learn it, and it seems like a pretty good language for text manipulation. Until today I haven't written a line of python - it is pretty easy (I am sure my code is terrible for those who know the language - suggestions welcome)
Code: Select all
#!/usr/bin/env python3
import sys
fileIn = open(sys.argv[1], "r")
fileOut = open("out.txt","w")
line = fileIn.readline()
lineno=0
while line:
label=''
opcode=''
operand=''
comment=''
lineno=lineno+1
#Comment lines must be skipped
if not line.strip().startswith(';'): #first character is ;
#split off the label
x = line.partition(' ')
if x[1]==' ': #split successful
label=x[0].strip()
l=x[2].strip()
#now split off the comment
x = l.partition(';')
if x[1]==';':
comment=';'+x[2].strip()
l=x[0].strip()
#now separate opcode and operand
x=l.partition(' ')
opcode=x[0].strip()
if x[1]==' ':
operand=x[2].strip()
#unchanged line write on empty (which happens for comment-only lines too)
if not label and not opcode and not comment:
fileOut.write(line)
line = fileIn.readline()
continue
# pad the columns
label = label.ljust(16,' ') #pad label column
opcode = opcode.ljust(6,' ')
operand = operand.ljust(18,' ')
#-----------------------------------------------
# write line
fileOut.write ('%s\n' % '|'.join(map(str, [label,opcode,operand,comment]) ))
line = fileIn.readline()
Strategy:
- -skip lines containing only comments
-separate the label (must begin in first column and end with whitespace)
-separate the comment (anything after ; )
-split the remaining part into opcode and operand at the first whitespace
Code: Select all
|bne |Asm_txt9 ; no, closing, so done
|bra |Asm_txt1 ; yes, get first text chr
Asm_txt3 |cpy |#$ff ; already found opening "?
|beq |Asm_txt4
|sta |(AddrPtr),y ; yes, save chr
In theory, there is no difference between theory and practice. In practice, there is. ...Jan van de Snepscheut