[Coco] How to determine if an OS-9 or NitrOS-09 program is a 6809 or a 6309 binary program
Gene Heskett
gheskett at wdtv.com
Sun Nov 1 03:43:26 EST 2015
On Sunday 01 November 2015 00:42:03 Kip Koon wrote:
> Hi Guys,
>
> As I'm thinking about what needs to be done to adapt NitrOS-9 6809 L1
> modules to the Multicomp09, I have been wondering if there is a way to
> determine whether a binary program was written for a 6809 cpu or 6309
> cpu. If not, can we update NitrOS-9 to include this ability in the
> module header? There are loads of programs in the VHD files that Bill
> Pierce has shared with us and I can't determine what I can run on the
> 6809 Multicomp and what I can't without blindly running the programs
> in question. Anyone know the answer to this one? Thank you all in
> advance.
The module definitions have been expanded to allow the marking of modules
built with 6309 code. This was done at least 2 decades ago, but some
folks never got the memo. So I get up on my soapbox and try to explain.
Again...
Unfortunately, the NIH syndrome is alive and well in the 6809 world, and
this marking convention has for some reason, not been commonly adapted.
So there there is probably more code out there with 6309 only code in it
but marked in the header as 6809+Objct than you could shake a stick at.
As you find such code that will not run correctly on a 6809, that is one
of the things you can fix using vfy. I wrote it to be the swiss army
knife of such utilities.
But before dragging out that knife, study the module definitions in
the /defs tree of any nitros9 distribution newer than about 1.16. Its
all there, folks just have to use it. A snip from my os9.d:
*
* Module Language Values
*
Objct EQU 1 6809 Object Code Module
ICode EQU 2 Basic09 I-code
PCode EQU 3 Pascal P-code
CCode EQU 4 C I-code
CblCode EQU 5 Cobol I-code
FrtnCode EQU 6 Fortran I-code
Obj6309 EQU 7 6309 object code
*
* Module Attributes / Revision byte
*
* Field Masks
*
AttrMask EQU %11110000 Attributes Field
RevsMask EQU %00001111 Revision Level Field
*
* Attribute Flags
*
ReEnt EQU %10000000 Re-Entrant Module
ModProt EQU %01000000 Gimix Module protect bit
(0=protected, 1=write enable)
ModNat EQU %00100000 6309 native mode attribute
So your assembly source should set the attr field to ModNat+ReEnt, and
the language nibble to Obj6309 if you are using ANY 6309 only codes in
it.
> Kip Koon
>
> <mailto:computerdoc at sc.rr.com> computerdoc at sc.rr.com
>
> <http://www.cocopedia.com/wiki/index.php/Kip_Koon>
> http://www.cocopedia.com/wiki/index.php/Kip_Koon
Cheers, Gene Heskett
--
"There are four boxes to be used in defense of liberty:
soap, ballot, jury, and ammo. Please use in that order."
-Ed Howdershelt (Author)
Genes Web page <http://geneslinuxbox.net:6309/gene>
More information about the Coco
mailing list