[Coco] Programming help

Robert Gault robert.gault at att.net
Tue Jun 25 11:13:58 EDT 2013


Bill wrote:
> I’m trying to write an assembly language routine, and having what’s probably
> a very simple problem.
>
>
>
> The listing is as follows:
>
>
>
> 10          NAM   B256 ß This is the culprit. Nothing I do will make it
> right.
>
> 70          ORG   $0EOO
>
> 80          ORCC #$50
>
> 90          LDX   #$8000
>
> 100         LDY   #$FFC0      *BANK 0
>
> 110   COPY  STB   $FFDE
>
> 120         LDB   O,Y
>
> 130         LDA   O,X
>
> 140         LDB   $08,Y *BANK 00/00
>
> 150         STB   $FFDF
>
>
>
> Everything else is fine, but I cannot get the first command correct. No
> matter what I do, it comes up with a ‘BAD OPCODE’ error.
>
>
>
> Help??
>
>
>
> Thanks
>

If you are using EDTASM, change NAM to TITLE. However, all that will do is print 
at the top of each page B256 ; assuming you are assembling to a printer.

You say that you did a LOADM and EXEC which crashed your Coco. That is pretty 
simple as you did not specify an EXEC address (nor does the listing.) The 
default for EXEC, when not set manually, is $0000 and as there is no code there, 
you got a crash.

You must change the last line of the listing from

720       END

to

720       END   $E00


If you change the listing so that line 80 reads

80 START  ORCC  #$50

then you could use

720   END  START

EDTASM will accept variables as well as exact addresses for the EXEC address.

All of this and much more is in the EDTASM manual. Since assembly programming is 
more complex than Basic, you really should at least skim through the manual (you 
have been given urls) before walking through the minefield of programming.

:)

Robert



More information about the Coco mailing list