So, I've fixed SYS to work better. I've also made a tweak involving program line zero.
I didn't even realise that you could have a program line zero, but you can. Program line zero has one huge advantage, it is always in the same place.
So this is now hidden (lines 32768-65535 are also hidden). The idea behind this is if I ever get round to writing programming tutorials for it, support routines can be placed in higher line numbers (Basic) or line 0 (Machine code) and effectively hidden. This allows effective libraries, or code to be written that allows a tutorial to experiment with simple programs without having to have all the confusing visible boilerplate.
Line zero was prompted because I'm planning a compiler. A fairly simple one, called ECPL (not like BCPL). I'm a great believer in that you should tailor your compiler to your hardware, where possible - (so running C on a 6502 isn't a good idea for example) and it will pinch some ideas from a Z80 compiler I wrote called SCPL. But I had to find somewhere to put the code. Basically there are three options. One is to move PAGE up (so that BASIC runs up at &5000 and &4300-&4FFF is code, say). Another is to move Himem down, which is messier, but could be done as part of CLEAR perhaps, though there are processor stack issues. Relocatable code isn't practical, so that leaves loading it in as line zero. Because it's a 16 bit machine, the offset to next line is 16 bits, so you can have one line with 10k of code in it. It should work. (I haven't actually tried this). The only problem with entering a 10 line BASIC competition is that PROCedures have to be at the start of the line. It won't do anything except occupy space, editing/running won't be affected at all. It's not listed so it really is almost irrelevant what's there. The only problem with it might be OLD. OLD recovers a program that's been NEWed but it does so by scanning forward, so this may well involve the creation of a new token type which allocates data randomly. I'll have to think about it a bit.
Tuesday, 28 April 2020
Subscribe to:
Post Comments (Atom)
Breaking change
We all make mistakes. One early mistake I made was copying (partly) the old thing in Microsoft BASIC where you didn't have to declare ...
-
I'm quite surprised. I actually am finding doing this rather, well, boring. It's a bit like manually translating a foreign langu...
-
This game is not slightly based on "Sabre Wulf" So this is coming along okay though I haven't done a huge amount on it yet...
-
So the completely original arcade adventure is now working except for sound effects. I think the next thing I'll do is this sort of ...
No comments:
Post a Comment