[Color Computer] [Coco] ASM Coders - Round two!

Charles Richmond richmond at plano.net
Wed Aug 30 19:24:06 EDT 2006


On Aug 30, 2006, at 4:35 PM, James Diffendaffer wrote:

>> In addition, there is *no* instruction to push X and Y on the
>> stack...you must transfer them to A (the accumulator) and push
>> the A register on the stack.
>
> Oh yeah... forgot about that one.  All things go through A.
>
>> The relative branches can branch something over 120 bytes forward
>> or backward. In my experience, that has been adequate for most
>> loops.
>
> Wasn't there something about jumping across page boundaries too?

The thing about branches crossing page boundaries had to do with
the indirect jump instruction. This was three bytes:  an opcode
byte and a two byte address. The memory locatin holding the
destination address was pointed to by the two byte address that
followed the opcode. If the address following the opcode straddled
a page boundary, then the second byte of the address will be
taken from the *beginning* of the original page.

I also seem to remember some instructions taking an extra cycle
if the destination address crossed a page boundary on the 6502.

>
>> In defense of the 6502, all of the instructions take very few
>> clock cycles to execute. So you may do *more* instructions and
>> take *less* time to accomplish something.
>
> I can't believe I forgot one of it's biggest problems.  No position
> independant code.
>
The 6502 *does* support position independent code. It just has to
be written using PC relative branching. Commodore distributed something
they called a wedge. It was a debugger written in position independent
code so you could locate it in a convenient memory location in
relation to the program that you are debugging.

--
+----------------------------------------------------------------+
|   Charles and Francis Richmond     richmond at plano dot net   |
+----------------------------------------------------------------+





Brought to you by the 6809, the 6803 and their cousins! 
Yahoo! Groups Links

<*> To visit your group on the web, go to:
    http://groups.yahoo.com/group/ColorComputer/

<*> To unsubscribe from this group, send an email to:
    ColorComputer-unsubscribe at yahoogroups.com

<*> Your use of Yahoo! Groups is subject to:
    http://docs.yahoo.com/info/terms/
 





More information about the Coco mailing list