The only changes I had to make were to fix the illegal bit instructions by subtracting 8 from the operand. For example, btst #x,DmaConR(a6) would be changed to btst #x-8,DmaConR(a6). It seems that the illegal instructions aren't flagged in some versions of Devpac (or is there an error override option somewhere?), which would explain how this rather sloppy code managed to slip through the net.
The earlier versions of Genam will let this slip through without complaint. If you use the version included in the source distribution, it will assemble without complaint. You can just substitute that Genam executable into your Devpac3 installation (back up the original of course!) and you've virtually got the environment they used.
This btst, bclr, bset problem is mostly self-correcting. See this post earlier in this thread for the gory details:
http://www.ultimateamiga.co.uk/index.php/topic,9600.msg45034.html#msg45034However, I did notice one case in +w.s where it
does matter. I haven't got the details handy as I'm up to my ears in something else at the moment. It's where the hardware registers are tested to see if a blit is completed. The wrong bit is tested due to the Genam bug, so partial blits are the result. I can see the effect in the AMOS Read Text instruction where the title bar for the window is missing chunks from some bit planes. It also crops up occasionally when using Unpack to paste Resource Bank Images onto a screen - missing chunks. Not easy to repeat as timing will vary and most of the time the missed 'wait for blit to complete has no effect.
My output files are not byte-exact copies of the originals but they seem to work fine as 1:1 replacements in my WinUAE AmosPro 2.0 installation. AmosPro.lib is 101500 bytes vs 98184 bytes original. AmosPro is 71652 bytes vs 22624 bytes original.
I got the same results. It's mostly caused by the assembler not optimising bcc branches so it's defaulting to the word or long offset format. Byte-by-byte comparisons of the original executable and the assembled one for amos.library shows all the differences to be bcc branches in the long offset format.
That explains your AMOSPro,Lib difference, but the AMOSPro difference is a bit too big for that explanation! (as HungryHorace just pointed out
)
Work in progressDBL EditorStill have the DBL Editor and assorted AMOS tools to release on an unsuspecting public. I've had some serious delays in this due to ill-health and an unexpected bereavement in my wife's family. The app itself is finished and the AmigaGuide docs that go with it are just about complete. All the other bits in the package listed below are complete excepting the AMOS Program Detokeniser which I'm releasing as 'work in progress'.
Why all this concentration on DBL? Well, the entire Editor, Monitor and most of the Accessories use it. So I thought we'd better get an understanding of it
. And I needed to get my hands nice and dirty in AMOS and Assembler.
This is a package of bits and pieces:
DBL Editor | large AMOS program |
DBL Editor.guide | extensive guide to the above |
DBL Editor Menu Maker | AMOS program for an SDK for DBL Editor |
DBL Editor Data Maker | AMOS program for an SDK for DBL Editor |
DBL Editor Tutorials and files | these go with the AmigaGuide docs |
DBL Editor asm source | used as an embedded proc in DBL Editor |
*Comment Stripper Accessory | AMOS Accessory to strip comments |
**AMOS Program Detokeniser | lists the AMOS tokens and parameters alongside the original source for an AMOS program |
Resource Bank Message Lister | AMOS program |
AMOS Editor Message Lister | AMOS program |
Assorted commented DBL sources | includes the Default Resource Bank progs |
* This just reduces the size of an AMOS program. If a program won't compile, it can save a lot of space (around 64k for the DBL Editor) for systems tight on memory.
** This is very much a work in progress for an AMOS Variable, Label and Proc Xref Accessory. In its current format, it just lists the tokens, parameters and texts along with the original source text. But all the definitions are in there ready for the XRef Accessory to follow. May be useful for anyone investigating tokenisation and the AMOS program file format.
I'm not giving a release date for the above as it was supposed to have happened last Xmas! But too many things in my private life have buggered that all up. Let's just say 'real soon now' and leave it at that.
Source InvestigationsI've printed out the sources and been browsing them for a while now. It's time I corrected one of the pre-source-availability assumptions that I'd made about the way AMOS Pro works:
The way that relocatable calls within and between libraries uses the AFLINE 680xx instructions followed by one or two words of data. I'd assumed that this was implemented as an interrupt vector. Wrong, wrong, wrong! If you browse +b.s (the loader) and its included file, +verif.s, you'll see that it does a full relocation of these instructions as it loads the libraries. So the AFLINE instruction and its following one or two words of data are completely replaced by relocated jumps. There's also a note in the source that proudly proclaims that these are replaced by bcc instructions in the compiler. But I haven't looked at the compiler yet so I can't confirm that.
Currently I'm working on a full understanding of the tokenisation used by AMOS Pro. The file +verif.s gives most of the detail.
I suggest we start to collate what we're each discovering. Anyone got any ideas as to how we're going to accomplish that? I can start a personal repository for info but one in the forum would be much better.
The following tables are very much work-in-progress so take it as unverified until I've completed them. A bit long-winded, but the sort of stuff we need to do to understand how the jigsaw pieces fit together.
Source to Executable Xref:Directory | File | Source |
AMOS Pro | AMOSPro | +b.s, +verif.s, +Internal_Jumps.s |
AMOS Pro | Compiler_Shell | Compiler_Shell.AMOS (compiled) |
AMOS Pro\APSystem | AMOSPro.Lib | +lib.s, +Toktab_Verif.Bin, +Dialog_Funcs.Bin |
AMOS Pro\APSystem | AMOSPro_Compact.Lib | +compact.s |
AMOS Pro\APSystem | AMOSPro_Compiler.Lib | +compext.s |
AMOS Pro\APSystem | AMOSPro_Editor | +edit.s |
AMOS Pro\APSystem | AMOSPro_IOPorts.Lib | +io_ports.s |
AMOS Pro\APSystem | AMOSPro_Monitor | +monitor.s |
AMOS Pro\APSystem | AMOSPro_Music.Lib | +music.s |
AMOS Pro\APSystem | AMOSPro_Request.Lib | +request.s |
AMOS Pro\APSystem | APCmp | +apcomp.s ? (not verified) |
AMOS Pro\APSystem | Compiler.Lib | +clib.s |
AMOS Pro\APSystem | Header_Backstart.Lib | +header_backstart.s |
AMOS Pro\APSystem | Header_CLI.Lib | +header.s |
Libs: | amos.library | +w.s, +WFont.Bin, ReqPic.Bin, +AMOSPro_Mouse.Abk |
Source cross-reference (*.s files only, i.e. no incbin files listed yet):This is a bit too large to comfortably fit in the post. So it's attached as a *.csv file.