tom-seddon / acorn_mos_disassembly Goto Github PK
View Code? Open in Web Editor NEWWIP disassembly of Acorn MOS, operating system for Acorn's 8-bit Master series
WIP disassembly of Acorn MOS, operating system for Acorn's 8-bit Master series
The MOS 3.50 code at $fc00 looks very similar to the Terminal-based reset code in other versions, of course...
Versions list has it as just 5.11
! Should do a pass and check the names are all correct.
If no Tube relocation bitmap, the tube parasite address isn't reset to $8000: https://github.com/tom-seddon/acorn_mos_disassembly/blob/fa074c9a1426e8e6f861722f48932db02b9a9235/dist/mos350.lst#L32182
I think this might be the only thing that needs fixing?
I initially thought the rtc NVRAM code was separate, but it's all part of the same blob of code!
There's approx $500 bytes free in the utils ROM, and the 3.50 SRAM utils take up something like $3fa+$a7 bytes. It should fit!
Sadly the $a7 bytes need to go in the MOS region, as they deal with accessing sideways ROMs. There is all of 1 easy byte free in that part. So some 3.50-style rearrangement will be required.
Check for Tube hardware. Appears twice.
Would be nice to have a pre-built .lst file in the repo. If you're using the disassembly for its intended purpose, the repo is then ready to go after a git clone.
Should check that the build output matches first.
No need to force people attempting a DIY build to build the code.
These would be perfect for feature flags:
OSBYTE $6b (MOS 3.20 only):
acorn_mos_disassembly/src/mos.s65
Line 9984 in 01d707a
QnD Y2K fix, so it's always 20xx:
acorn_mos_disassembly/src/rtc.s65
Line 467 in ac672c5
lda #$20
)
*MOVE
permissions bug:
acorn_mos_disassembly/src/terminal.s65
Line 1602 in 01d707a
lda #$20
) (see JGH's BuildMOS: https://mdfs.net/Info/Comp/BBC/SROMs/BuildMOS)Actually more like withTST
, I think - it sets TST and then restores it when the caller does an RTS.
Might be a bit nicer. Try it and see.
Workaround for #29 if you really want to use 3.50(NT): BASIC 4r32 with the relocatable bit clear. Then it won't matter if the relocation table is missing.
Do the same for View, ViewSheet and Edit, if necessary.
Some stuff after the default vector table. What is it?
The Welcome disk includes an Acornsoft sprite ROM, some kind of mod of whatever was in the GXR ROM. Could this be squeezed in somehow?
Could at least disassemble it for optional inclusion in some other ROM. The space freed up by the (NT) versions would be one obvious candidate, if putting together an entire MegaROM, but there are also other options.
To go in the readme or something...
The previous version's section from refresh.md should go in the GitHub release comment
The MOS you always wanted. NT = No Terminal. 6 banks of MegaROM free for absolutely whatever.
It should fit: Terminal = 2757 bytes; MOS 3.20 ext code = 1536 bytes, and MOS 3.50 ext code = 2304 bytes.
For MOS 3.20, nothing else to do (I don't think).
For MOS 3.50, does anything need doing with the Tube relocation tables? They look data driven, so hopefully not.
Just tried to link to a line - but the file is too large for GH to render in non-raw mode!
Should split it up.
This setup has served its purpose and is no longer necessary. It would be better to remove the version-specific names and calling code changes that serve only to deal with routines that have moved from one section to another without changing their name.
Copy-pasted notes from discussion elsewhere, that needs some comments adding to the disassembly...
This bit of code here: https://github.com/tom-seddon/acorn_mos_disassembly/blob/e8e54cb2d5a108e2d79fc1734fceaa8b5f199180/src/terminal.s65#L3182C71-L3182C71 - it can actually detect whether the EEPROM read succeeded (the chip puts out an acknowledge signal that you can read), and, if it didn't, it can return a default value from the table L9DE4
.
The Compact MOS can also support either a 128 or 256 byte EEPROM. When resetting the CMOS data, it EORs the value in location 127 and writes that to location 255. So locations 127 and 255 are either different (256 bytes) or the same (128 bytes):
acorn_mos_disassembly/src/reset.s65
Line 690 in e8e54cb
You can query the EEPROM size by reading EEPROM address 255: https://github.com/tom-seddon/acorn_mos_disassembly/blob/e8e54cb2d5a108e2d79fc1734fceaa8b5f199180/src/terminal.s65#L3162C31-L3162C31
I can't quickly find any official docs about this, but BeebWiki mentions it: https://beebwiki.mdfs.net/OSBYTE_%26A1
What it doesn't mention is that you can't write to EEPROM addresses 0, 127, 128 or 255:
acorn_mos_disassembly/src/terminal.s65
Line 3239 in e8e54cb
Still, the only documented CMOS/EEPROM addresses are 30-49, so not really a big issue.
Bit pointless.
The bank switching is done via an EOR, so only the relative positions are important. Provide more pairs of modified ROMs, with different EORs, so that you have more options.
Oops
Should really be called NVRAMContents
or something, as it might be EEPROM!
Squeeze out a bit more speed in the common case. In my quick test of LISTing a 200-odd line BASIC program, the LIST took 0.95 the time. Insert before this line:
acorn_mos_disassembly/src/mos.s65
Line 8371 in 1bcd69d
; Early out when doing VDU output only.
lda characterDestinationStatus
beq LE8A5
Building each ROM takes 4 passes! Does it need that many? Doesn't take too long, but, still...
Tried rearranging the driver files a bit, so version=
comes first and the .dsection
directives are last to reduce the amount of out-of-order stuff. Still 4 passes.
Noticed some more here: https://github.com/stardot/b-em/tree/master/roms/os - anything new there?
Looks like default CMOS RAM contents. So it should be expressed a bit more obviously, rather than just as a list of random hex values.
There's enough free bytes, but those free bytes are not in the right places... yet...
It's from here: http://www.adsb.co.uk/bbc/bbc_master.html
Link is to non-existent https://github.com/tom-seddon/acorn_mos_disassembly/docs/refresh.md
The listing file is workable, but it could be a bit tidier. The format is fairly regular, possibly regular enough to produce a useful HTML file from it, with cross-references and so on.
It probably won't be as nice as https://tobylobster.github.io/mos/ though :(
There's a pic of this on beebmaster's site but I can't find it now I'm looking. Might be an easy fix?
Well, obviously it's utils. But you'd never guess from the code. Or the file names.
Timings taken on Master Turbo.
*BASIC
on MOS 3.20: ~0.22 seconds
*BASIC
(which, for whatever reason, skips the relocation step) on MOS 3.50: ~0.41 seconds
*FX142 12
on MOS 3.50: ~0.60 seconds
Issues with the MOS 3.50 code:
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.