6502.org Forum  Projects  Code  Documents  Tools  Forum
It is currently Fri Nov 22, 2024 11:51 pm

All times are UTC




Post new topic Reply to topic  [ 23 posts ]  Go to page 1, 2  Next
Author Message
PostPosted: Tue Feb 16, 2016 1:10 pm 
Offline

Joined: Mon Jan 07, 2013 2:42 pm
Posts: 576
Location: Just outside Berlin, Germany
After some experimenting, I figured out how to upload S28 files to the 265SXB with Linux, necessary because the WDC Tools are Windows-only and closed-source. There is a longer version of this with examples at https://github.com/scotws/265SXB-Guide/ ... ng_code.md as part of the 265SXB Guide.

First, you need to install the srec_cat tools (Ubuntu 14.04):
Code:
sudo apt-get install srecord
This gives you (among other things) the srec_cat tool itself and srec_info to inspect the finished S28 file. For a binary machine code file (mensch.bin) and the output S28 file (mensch.s28) that is to be installed at 00:2000, we need
Code:
srec_cat mensch.bin -binary -offset 0x2000 -o mensch.s28 -address-length=3 -execution-start-address=0x2000
The double "0x2000" looks strange, but the record file isn't complete otherwise (or I'm doing something wrong). More generally, we have
Code:
srec_cat <BIN-FILE> -binary -offset <ADDRESS> -o <S28-FILE> -address-length=3 -execution-start-address=<ADDRESS>
(This just begs to be put in a script, obviously, but that's all I have time for today.)

To transfer the resulting file to the 265SXB, press "s" in the Mensch Monitor, and then with (say) minicom, start the transfer as pure ASCII (CTRL-A Z, s, pick "ascii"). Then use "j" to start the program.


Top
 Profile  
Reply with quote  
PostPosted: Tue Feb 16, 2016 3:35 pm 
Offline
User avatar

Joined: Tue Mar 02, 2004 8:55 am
Posts: 996
Location: Berkshire, UK
Which assembler are you using? Many assembler generate S28 directly so you just need to send the file from your terminal software. Each of the lines in the S28 file starts with an 'S' and triggers the Mensch Monitor to read the rest of the line as an S-record.

_________________
Andrew Jacobs
6502 & PIC Stuff - http://www.obelisk.me.uk/
Cross-Platform 6502/65C02/65816 Macro Assembler - http://www.obelisk.me.uk/dev65/
Open Source Projects - https://github.com/andrew-jacobs


Top
 Profile  
Reply with quote  
PostPosted: Tue Feb 16, 2016 4:38 pm 
Offline
User avatar

Joined: Thu May 28, 2009 9:46 pm
Posts: 8507
Location: Midwestern USA
scotws wrote:
After some experimenting, I figured out how to upload S28 files

What's an S28 file? I know all about Motorola S-record files, unofficially referred to at times as S19, but not S28. :) From where did all these weird extensions emanate? :lol:

Incidentally, it should be apparent that the S19 moniker comes from the fact that there are 9 record types, not 8.

_________________
x86?  We ain't got no x86.  We don't NEED no stinking x86!


Top
 Profile  
Reply with quote  
PostPosted: Tue Feb 16, 2016 5:16 pm 
Offline
User avatar

Joined: Thu Dec 11, 2008 1:28 pm
Posts: 10986
Location: England
> What's S28?
According to Scot's repo:
Quote:
...the Monitor will accept programs sent to it in a special file format called SREC, the Motorola S-record format. Because of its 65816 MPU core with a 24-bit address space, we need "S28"-style formats.
...
We need S2 fields for the data because of 24 bit addresses, and in the last line S8 for the 24-bit terminating address.


Top
 Profile  
Reply with quote  
PostPosted: Tue Feb 16, 2016 5:19 pm 
Offline
User avatar

Joined: Tue Mar 02, 2004 8:55 am
Posts: 996
Location: Berkshire, UK
S19 only supports a 16-bit address. S28 extends it to 24. There is a family of S format records for different size memory buses.

Google is your friend

_________________
Andrew Jacobs
6502 & PIC Stuff - http://www.obelisk.me.uk/
Cross-Platform 6502/65C02/65816 Macro Assembler - http://www.obelisk.me.uk/dev65/
Open Source Projects - https://github.com/andrew-jacobs


Top
 Profile  
Reply with quote  
PostPosted: Tue Feb 16, 2016 6:45 pm 
Offline

Joined: Mon Jan 07, 2013 2:42 pm
Posts: 576
Location: Just outside Berlin, Germany
BitWise wrote:
Which assembler are you using?
My "Tinkerer's Assembler" for now -- one reason I bought the 265SXB is to have actual hardware to validate both that assembler and the Crude Emulator for the 65816 on. The current steps are to figure out how to load programs on the 265SXB from Linux (check), figure out how PUT_CHR and its most important friends function (work in progress), emulate those on the Crude Emulator (to do), and then run more tests comparing the output of the assembler and what the emulator does to what really happens on the 265SXB (lots and lots to do).

Long-term, though, I will probably switch to a more powerful assembler (I think I remember that yours is in Java, which should run on Linux, and includes S28 output) and just write a small tool to convert my beloved Typists's Assembler Notation to whatever that format is. The Tinkerer's Assembler was a fun project and I am very glad I wrote it as a proof-of-concept, but there is no reason to re-invent the wheel, and the mature assemblers out there have all kinds of features it would take months and months to add. I don't really have that time -- there are Forths to code, after all!


Top
 Profile  
Reply with quote  
PostPosted: Wed Feb 17, 2016 3:04 am 
Offline
User avatar

Joined: Sun Jun 30, 2013 10:26 pm
Posts: 1949
Location: Sacramento, CA, USA
BigDumbDinosaur wrote:
What's an S28 file?

Keep settin' us up, big guy, and we'll keep knockin' em down!

http://lmgtfy.com/?q=S28+file

:wink:

Mike B.


Top
 Profile  
Reply with quote  
PostPosted: Wed Feb 17, 2016 5:35 am 
Offline
User avatar

Joined: Tue Mar 05, 2013 4:31 am
Posts: 1385
I used this for a reference when I wrote the S19 record support for my Xmodem loader:

http://www.amelek.gda.pl/avr/uisp/srecord.htm

_________________
Regards, KM
https://github.com/floobydust


Top
 Profile  
Reply with quote  
PostPosted: Wed Feb 17, 2016 6:34 am 
Offline
User avatar

Joined: Thu May 28, 2009 9:46 pm
Posts: 8507
Location: Midwestern USA
Ahem...the S-record (aka S19) standard includes 24 and 32 bit addressing. The S19 moniker has to do with the 9 possible records types recognized. It's up to the programmer to decide which ones to use. :)

_________________
x86?  We ain't got no x86.  We don't NEED no stinking x86!


Top
 Profile  
Reply with quote  
PostPosted: Wed Feb 17, 2016 9:24 am 
Offline
User avatar

Joined: Thu Dec 11, 2008 1:28 pm
Posts: 10986
Location: England
I count 10 records. Did you check Wikipedia?


Top
 Profile  
Reply with quote  
PostPosted: Wed Feb 17, 2016 9:32 am 
Offline

Joined: Thu Mar 03, 2011 5:56 pm
Posts: 284
BigDumbDinosaur wrote:
Ahem...the S-record (aka S19) standard includes 24 and 32 bit addressing. The S19 moniker has to do with the 9 possible records types recognized. It's up to the programmer to decide which ones to use. :)


According to wikipedia, S19 is one possible combination of SRecord records. S19 specifically uses 16-bit addresses, while S28 uses 24-bit addresses (and S37, 32-bit addresses). So, S19 is a subset of the SRecord format, and supports only 16-bit addresses.

https://en.wikipedia.org/wiki/SREC_%28file_format%29#Record_types


Top
 Profile  
Reply with quote  
PostPosted: Wed Feb 17, 2016 9:33 am 
Offline

Joined: Sun Apr 10, 2011 8:29 am
Posts: 597
Location: Norway/Japan
Quote:
I count 10 records. [..]

Well.. one (S4) is reserved, so there are only 9 to use. But in any case it seems that the general format is really just S-record (and that's how I remember it from the past), and S19/S28/S37 are mostly used to indicate which combination of records are used (well, according to WP - that's new to me).

Edit: quote inserted due to another post arriving in between

Update: So finally I got it.. S19, S28, S37 all need S0 (the header record), but then we have:
S19: Needs records S1 and S9.
S28: Needs records S2 and S8.
S37: Needs records S3 and S7.
All of them: S5 may optionally be used.
Explains the numbering scheme at least. As I said, this is probably not news to many of you.


Top
 Profile  
Reply with quote  
PostPosted: Wed Feb 17, 2016 9:54 am 
Offline
User avatar

Joined: Thu Dec 11, 2008 1:28 pm
Posts: 10986
Location: England
Thanks for the correction! It seems that BDD has taken the name of a specific flavour to be as good as the name of the format itself. No doubt S19 is the flavour most commonly encountered. "It ain't what you know..."


Top
 Profile  
Reply with quote  
PostPosted: Wed Feb 17, 2016 7:25 pm 
Offline
User avatar

Joined: Thu May 28, 2009 9:46 pm
Posts: 8507
Location: Midwestern USA
BigEd wrote:
I count 10 records. Did you check Wikipedia?

I skipped S4 because it is reserved.

Also note that S0 is seldom implemented.

_________________
x86?  We ain't got no x86.  We don't NEED no stinking x86!


Top
 Profile  
Reply with quote  
PostPosted: Wed Feb 17, 2016 7:38 pm 
Offline
User avatar

Joined: Thu May 28, 2009 9:46 pm
Posts: 8507
Location: Midwestern USA
rwiker wrote:
BigDumbDinosaur wrote:
Ahem...the S-record (aka S19) standard includes 24 and 32 bit addressing. The S19 moniker has to do with the 9 possible records types recognized. It's up to the programmer to decide which ones to use. :)


According to wikipedia, S19 is one possible combination of SRecord records. S19 specifically uses 16-bit addresses, while S28 uses 24-bit addresses (and S37, 32-bit addresses). So, S19 is a subset of the SRecord format, and supports only 16-bit addresses.

https://en.wikipedia.org/wiki/SREC_%28file_format%29#Record_types

Wikipedia's S-record article is in error—S19, S28 and S37 are made-up terms that have never been used by Motorola in the published S-record standard (but have been seen in engineering bulletins, as noted in a following post).

For the definitive description of the S-record format (and terms) please refer to Appendix C (page 640) of the attached manual, which is an official Motorola publication.

Incidentally, the UNIX man page for the S-record format is not entirely correct. Only the Motorola definition should be taken as gospel.


Attachments:
File comment: M68000 Family Programmer's Reference Manual
mc68000_prog_ref.pdf [1.74 MiB]
Downloaded 154 times

_________________
x86?  We ain't got no x86.  We don't NEED no stinking x86!


Last edited by BigDumbDinosaur on Wed Feb 17, 2016 9:10 pm, edited 2 times in total.
Top
 Profile  
Reply with quote  
Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 23 posts ]  Go to page 1, 2  Next

All times are UTC


Who is online

Users browsing this forum: No registered users and 18 guests


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot post attachments in this forum

Search for:
Jump to: