Page 1 of 3
Another 65816 STC Forth
Posted: Mon Dec 12, 2016 7:09 am
by leepivonka
At
http://174.31.10.176:81/65816F/
Runs in 65816 (& 65265) native mode.
Definitely a work in progress, but most things work correctly.
Edit: update IP address
Re: Another 65816 STC Forth
Posted: Mon Dec 12, 2016 10:03 am
by scotws
Definitely a work in progress, but most things work correctly.
Ah, thanks. Is that yours? I'm down with a fever and can't be trusted with machinery any more complicated than a fork for the moment, so it will be a few days before I can take a better look...
Re: Another 65816 STC Forth
Posted: Tue Dec 13, 2016 6:22 am
by leepivonka
Yes, it's mine. It tries to put lots of handy things for a 65816 system (EhBasic type functions + assembler + disassembler + debugger + system support + I/O drivers + filesystem handlers + ???) in a big flash ROM available at reset. There are some things that could use more work (like Forth compile peephole optimization) & some things that aren't really started yet (like filesystem handlers), but it generally works well on the simulator.
Reading about your Liara Forth project, some of my goals are similar to yours. You've motivated me to start writing this thing up for presentation!
0265sxb is the port for the '265sxb board. This version uses $2000-$7fff for the ROM code, so it can load & run on an out-of-the-box board. It uses $0300-$1fff as RAM. It has not been tested on real hardware yet, but does run in the generic 65816 simulator using bare-bones Mensch monitor console simulation routines. After it is tested & working, the next step is to move it to $8000-$deff in the boot bank of the flash ROM so it'll start on reset.
Future possible directions:
* Fill in $e000-$ffff in the boot bank of the flash ROM with code & replace the Mensch monitor.
* Set up a flash filesystem in the other banks of the flash ROM, with Forth words to access files there.
* Attach 1 or 2 SD cards, with Forth words to access them.
* Set up a FAT filesystem handler.
Re: Another 65816 STC Forth
Posted: Thu Dec 15, 2016 11:12 am
by scotws
So, first somewhat clear-headed reaction: Wow, great work!
I'm curious about the choice of multi-tasking words. I'm planning to use those from Brad Rodriguez' paper at
http://www.bradrodriguez.com/papers/mtasking.html (MULTI, SINGLE, TASK, ACTIVE, PAUSE, SLEEP, WAKE, STOP, WAIT, SIGNAL), but see you have used others. Any reason not to use Brad's? I know there are no ANSI words, so there is no accepted terminology ...
Can't wait to read the code when I'm completely well again. Uh, what's the license?
Re: Another 65816 STC Forth
Posted: Sat Dec 17, 2016 3:47 am
by leepivonka
Thanks!
On multi-tasking: Some of this is in ANSI & previous usage I've seen, and some I just made up to fill out the set. I'm tempted to adopt Brad's set.
On the license: Does "I assert copyright & give permission for any use" sound reasonable?
Re: Another 65816 STC Forth
Posted: Sat Dec 17, 2016 4:47 am
by GARTHWILSON
We have the "Copyright considerations" topic at
viewtopic.php?f=1&t=3090 , started by Ed. There's some good stuff there.
Re: Another 65816 STC Forth
Posted: Sat Dec 17, 2016 8:46 am
by Tor
On the license: Does "I assert copyright & give permission for any use" sound reasonable?
Nope. Well, it depends.
According to my company's copyright attorney, 'use' (even with 'any') in copyright terms means one thing only: The right to use, i.e. execute/run the software/product. If you want to give the right to modify, you must state so explicitly. If you want to give the right to distribute, you must state so explicitly. Same for just distribute, and for distributing a modified work. (Edit: And to be allowed to copy, of course! That's where the name copyright comes from. If you don't explicitly give the user the right to make a copy, he doesn't have any.)
That's why you will find those terms in various licenses, e.g. the GPL and others. So, decide on exactly what you want to allow the user to do, and state so explicitly. If you only want to give the right to sit at home and run the software, nothing else, then 'use' (with or without 'any') will cover it, but that's all it covers.
There are good historic reasons for why copyright law was written this way. Imagine you were Beethoven, and you sell your composition to a guy with a printer. Fixed, one time price (composers used to do that). Then the printer guy decides to "improve" your composition, and sells the modified score, as a Beethoven piece, or changes some parts and sell it as his own composition. Even if you/Beethoven at that point had no monetary interest in the composition, it would be terrible. Such things used to happen, going all the way back to Bellman's time, and that is why copyright law was written the way it is.
The easiest way is to choose one of the available licenses (BSD, GPL, MIT etc) and attach one of them. All the hard work of getting the wording right, in legal terms, has been done for you.
Re: Another 65816 STC Forth
Posted: Sat Dec 17, 2016 11:13 am
by BigEd
Indeed, in short, writing your own license isn't a wise move - it probably won't accomplish what you intended.
Re: Another 65816 STC Forth
Posted: Sat Dec 17, 2016 6:16 pm
by BigDumbDinosaur
The easiest way is to choose one of the available licenses (BSD, GPL, MIT etc) and attach one of them. All the hard work of getting the wording right, in legal terms, has been done for you.
I would not use GPL for anything. It doesn't protect the rights of the copyright holder at all and in fact, was not written with that in mind. Geoff Graham explains why in
this essay.
The license and copyright notice I use in software I have released for general usage is as follows:
- Copyright ©1994-2016 by BCS Technology Limited
All Rights Reserved
──────────────────────────────────────────────────────────────────────────────────────────────
Permission is hereby granted to use, copy, modify and distribute this software, either in stand-alone form or as part of a complete package. BCS Technology Limited requires that a copyright acknowledgment worded as follows must be present in any documentation provided with the package of which this software is a component:
- Portions of this software copyright ©1994-2016 by BCS Technology Limited. All rights reserved.
The above copyright acknowledgment must also appear at least once in the source code of the package into which this software has been integrated.
Redistribution of this software in any form must be at no charge to the end user. This code or any part thereof, including but not limited to any derivation, MAY NOT be incorporated into any package intended for sale, unless written permission to do so has been granted by BCS Technology Limited. Please visit http://bcstechnology.net for information on how to contact us to obtain such permission.
THERE IS NO WARRANTY OF ANY KIND WITH THIS SOFTWARE. While it is believed that this software will perform as described, the user assumes all risk in connection with the incorporation of this software into any system. If this provision is not acceptable to you do not use this software and immediately delete it from your system.
The above was reviewed by our company attorney and suitably edited. It is enforceable in any country that is a signatory to the Berne Convention.
Re: Another 65816 STC Forth
Posted: Sat Dec 17, 2016 6:22 pm
by BigEd
The GPL does exactly what it intends to do, and protects the rights of both the originator and the end-user. It isn't appropriate for everyone, and the link you share illustrates that. Perhaps it's reasonable advice to anyone not to use a license if you don't understand the purpose of it. But it's certainly reasonable advice not to roll your own - in your case, you had a lawyer, you preferred to do it that way, and that's fine for you. Most likely it constrains people who use your software, possibly in ways you didn't intend. But I'm glad you do at least offer a license!
Re: Another 65816 STC Forth
Posted: Sat Dec 17, 2016 6:33 pm
by BigDumbDinosaur
The GPL does exactly what it intends to do, and protects the rights of both the originator and the end-user.
.
The origins of the GPL are rooted in Stallman's desire to be able to use and tinker with software without having to actually pay for it. Our company attorney, who is quite familiar with the history of the GPL, is of the opinion that the copyright holder is not protected at all by the GPL, and that anything more than trivial modifications to "protected" software would open the door to the modified software legally being considered a separate work. He also had pointed out at one time that there wasn't any U.S. case law in which the GPL was enforced to the benefit of the copyright holder. I don't know if any such enforcement has occurred in other countries.
I'm not a lawyer, of course, so I'm relying on the words and knowledge of someone who did graduate law school and passed the bar examination.
But it's certainly reasonable advice not to roll your own - in your case, you had a lawyer, you preferred to do it that way, and that's fine for you. Most likely it constrains people who use your software, possibly in ways you didn't intend. But I'm glad you do at least offer a license!
The only constraints are unambiguously spelled out in the license. Of course, legal decisions handed down in courts sometimes defy logic.

Re: Another 65816 STC Forth
Posted: Tue Dec 20, 2016 6:07 am
by whartung
As Tor said, license your code. Don't make one up, and don't leave it unlicensed, don't use a license for written works, use a software license. The
BSD and
Apache licenses are about as close to the intent of public domain as you can get.
Re: Another 65816 STC Forth
Posted: Tue Dec 20, 2016 9:14 am
by BigEd
I recently saw a mention of the Unlicense, but for me it looks inferior to the CC0 license.
Re: Another 65816 STC Forth
Posted: Thu Jan 05, 2017 3:53 am
by leepivonka
Apache 2.0 license applied.
Modifications continue.
Since it seems the Mensch monitor likes S28 but not S19, I've changed the hex file to S28.
Re: Another 65816 STC Forth
Posted: Thu Jan 05, 2017 7:36 am
by scotws
Great! Just out of curiosity, any special reason you're not hosting this on GitHub? Again, just curious.
One heads up - I've found that all the subroutine jumps in my STC Forth model tend to confuse the assembler when trying to figure out which width A and XY have, to the point where I am going to go back and put asserts (stuff like
.!a16 in TinkAsm) at the beginning of every word definition as a new rule of Best Practice (this in fact was the source of my vexing Backspace bug). I'll also be isolating all put_chr/get_chr accesses in EMIT/KEY earlier than planned because of this - I had wanted to wait so they can be more easily vectored with DEFERs in high-level code and access PAUSE, but I should get to the point where all 8-bit A code lives in very exactly defined areas.
This, I guess, is how projects get delayed

.