[Coco] is this a bug?
Bill Pierce
ooogalapasooo at aol.com
Thu Apr 20 01:50:19 EDT 2017
Dave, in assembling a bootloader, you may be better off using edtasm or any rsdos assembler. The bootloader is run from rsdos (or autoloaded or rom) and doesn't need the os9 assembler... anything from that point on will. The os9 assembler can only use jmp as in "jmp [label]". Also, you can't specify "org" as that applies differently in os9 assembly since it's PIC. Org becomes a offset for data from DP or the Global data area...
org $80
lab1 rmb 2 [$80]
lab2 rmb 1 [$82]
lab3 rmb 3 [$83]
lab4 rmb 2 [$85]
etc
Bill Pierce
"Charlie stole the handle, and the train it won't stop going, no way to slow down!" - Ian Anderson - Jethro Tull
My Music from the Tandy/Radio Shack Color Computer 2 & 3
https://sites.google.com/site/dabarnstudio/
Co-Contributor, Co-Editor for CocoPedia
http://www.cocopedia.com/wiki/index.php/Main_Page
E-Mail: ooogalapasooo at aol.com
-----Original Message-----
From: Dave Philipsen <dave at davebiz.com>
To: CoCoList for Color Computer Enthusiasts <coco at maltedmedia.com>
Sent: Thu, Apr 20, 2017 12:59 am
Subject: Re: [Coco] is this a bug?
> On Apr 19, 2017, at 9:45 PM, Robert Gault <robert.gault at att.net> wrote:> > > A phasing error normally means that the location of code changed during the first and second passes of the assembler. Typically this happens with forward addressing when the assembler can't decide whether long or short branches or direct or extended addressing is needed.> > However, in your example there is another problem. :) Remove the opt M and try assembling this small amount of code. I think you will find that it compiles without any errors.> Now with the opt M present, remove the org $2000 and it will compile without error.> > Opt M turns on Motorola-compatible mode which is the default state and not needed. It should not confuse the address counter during assembly.Ok, well actually I believe OPT -M is the default behavior for assembling OS9 program. And, normally, one would not use ORG. However, I am assembling a program for an OS9 bootloader which will reside at a specific location in memory so ORG is needed.> > So there is probably is a bug in ASM. Your code generates extended addressing for Entry. Without the opt instruction, the code becomes $E $06, direct addressing. If you reverse the first two lines> org $2000> opt M> you get more phasing errors. None of this should happen.> > The only way to get this code to compile with direct addressing while including the opt M is as follows> opt M> org $2000> start jmp <entry> fcc /TEST/> entry nop> end> > Clearly it should not be necessary to include the <. An assembler should optimize code on its own.> Yes, I believe you are right. The OS9 assembler has a SETDP directive that could be used to force direct/extended addressing in some cases but it doesn't seem to work either. So I guess if someone is keeping track of these sorts of things for the NitrOS9 repository it could be noted as a bug. Don't know if anyone would ever get around to correcting it though. This is the first time I have used the assembler to generate a non-OS9 object file so I'd never noticed the behavior before. Fortunately I can just force the extended addressing for now.Dave> Robert> > > -- > Coco mailing list> Coco at maltedmedia.com> https://pairlist5.pair.net/mailman/listinfo/coco-- Coco mailing listCoco at maltedmedia.comhttps://pairlist5.pair.net/mailman/listinfo/coco
More information about the Coco
mailing list