[Coco] Error in coco basic?

Mathew Boytim maboytim at yahoo.com
Thu Jan 10 22:23:05 EST 2013


I am not familiar with the coco ROM code, but the Model 1/3 ROM code did that sort of thing to save space.
 
The Z80 can do 8 bit loads for example to register A, and 16 bit loads for example to the register pair BC.  An 8-bit load-immediate is a two byte opcode, and a 16-bit load-immediate is a three byte opcode.  So they would make the immediate value of a 16-bit load-immediate the opcode for an 8 bit load-immediate to a different register.  They would branch seemingly to the middle of an instruction to the data field of the 16-bit load instruction which would load the 8-bit register, if they didn't branch into it then it would load the 16-bit regster pair.  They didn't care about the value of the 16-bit register pair, they cared only about the 8-bit register.  This saved them from having to branch which is a two byte opcode compared to a single byte for the benign load opcode.
 
I don't know if this sort of thing was done in the coco ROM code but it was done in several places in the 1/3 ROMs.  I can't remember specific cases but if anyone is interested I can dig out a few examples.
 
I think they were trying to cram as much into the ROMs as possible and did whatever they could.
 
Matt

--- On Thu, 1/10/13, Luis Fernández <luis46coco at hotmail.com> wrote:


From: Luis Fernández <luis46coco at hotmail.com>
Subject: Re: [Coco] Error in coco basic?
To: "COCO" <coco at maltedmedia.com>
Date: Thursday, January 10, 2013, 7:31 PM


L for labels
is A7AB BRA  A7B1
in Color-basic- unravelled.pdf pag 37

Google Translate invert order





> Date: Thu, 10 Jan 2013 19:54:02 -0500
> From: robert.gault at att.net
> To: coco at maltedmedia.com
> Subject: Re: [Coco] Error in coco basic?
> 
> Luis Fernández wrote:
> > Coming beareth a new breakthrough cocodskutilbut I have proglemas with reading wav
> > Some time ago check toolshed and other
> > I just started to understand basic color
> > but ran into something strange
> > Color-basic-pag 36-37 unravelled.pdf
> > on Page 37 Address A7AB LA7B1 BRA, this address there, jump to the middle of another instruction
> > Like no other event but now can not find it
> > this routine is certainly complex, is a challenge to analyze it, I understand completely the bases, but making it work in all cases and damage signal is complicated
> 
> Luis,
> 
> That is not what I see in the source code nor is it what I find in the bas10.rom.
> 
> LA7AB  BRA  LA7B1
> 
> ....
> 
> LA7B1  LDB  V83
> 
> 
> --
> Coco mailing list
> Coco at maltedmedia.com
> http://five.pairlist.net/mailman/listinfo/coco
                          

--
Coco mailing list
Coco at maltedmedia.com
http://five.pairlist.net/mailman/listinfo/coco



More information about the Coco mailing list