[Coco] Still having problems with Assembler

Robert Gault robert.gault at worldnet.att.net
Sun Feb 3 22:12:11 EST 2008


Charles Shrader wrote:
> Can anyone see what is wrong with this assembler program?
> 
> 000050                     ORG     16384
> 000100         START       JSR     43304
> 000110         BK1         NOP
> 000120                     END     START
> 
> It assembles with zero errors; when I try to do a GSTART in the
> Zdebugger, the application just hangs.  Shouldn't I at least get a
> cleared screen?
> 
> I've even tried to set a breakpoint at BK1 with:
> 
> X BK1 at the # prompt.
> 
> I'm starting to wonder if trying to write assembler code in an emulator
> is not a very good idea?
> 
> Chuck
> 

Well, so far you have not been given the needed answer. :)

There are several things to consider. Will the program be run from 
EDTASM or Basic? Is it for a Coco3 or Coco1 or2? In either case, what is 
the state of the Coco regards reserved memory and High Res versus 32 
character width screen.

The most grievous error, whether run from Basic or EDTASM, is there is 
no exit to the program.

000110         BK1         NOP
000120                     END     START

What do you expect the program will do when it finishes line 110? You 
are missing an SWI for ZBUG or an RTS for BASIC. There is no endless 
loop to halt the program. The program will try to execute an opcode at 
$4004 but there is no code present at that location. Very Big Crash!

To run this from Basic, at least add
000112           RTS

To run this from EDTASM you need to determine where your buffer starts 
with the command O [ENTER]. That's a letter not a number. You can check 
where the code would go with the command A/NO  which means assemble 
without creating an object file. If you want to actually test the code 
from EDTASM, you might have a crash but will need to make line 000112 
        SWI            and do an in-memory assembly.
A/IM
The code will not start at 16384 and may trash EDTASM, but that's the 
only way to get it to work. Much safer and better to run this type of 
code from Basic.



More information about the Coco mailing list