[Coco] Re: Newbie syntax?

Rodney V Hamilton Rodney_Hamilton at GBRonline.com
Mon Jan 26 03:38:43 EST 2004


In article <web-53742418 at forest.net>, 
jimcox at miba51.com says...
>
>Any of you experts out there seen anything wrong with my 
>syntax here:
>
>00100 * BUBBLE SORT
>00110 BUBSRT CLR PASSNO SET PASS # TO 0
>00120 BUB010 LDX #$400 POINT TO SCREEN
>00130 LDY #0 SET CHANGEFLAG TO 0
>00140 BUB020 LDA ,X+ GET FIRST ENTRY
>00150 CMPA ,X TEST NEXT
>00160 BLS BUB030 GO IF A<=B
>00170 LDB ,X GET SECOND ENTRY
>00180 STB -1,X SWAP B TO A
>00190 STA ,X SWAP A TO B
>00200 LDY #1 SET "CHANGE"
>00210 BUB030 CMPX #$400+511 TEST FOR SCREEN END
>00220 BNE BUB020 GO IF NOT ONE PASS
>00230 INC PASSNO INCREMENT PASS #
>00240 CMPY #0 TEST CHANGE FLAG
>00250 BNE BUB010 GO IF CHANGE OCCURRED
>00260 LOOP JMP LOOP LOOP HERE
>00270 PASSNO FCB 0 PASS #
>00280 END
>
>Jim

Yes, all source code lines must start with a leading space
or a label, unless they are comments or blank.  For example,
your line 130 needs at least one space before the "LDY".
Try it with leading spaces in the lines without labels.

The number of spaces used is a matter of aesthetics - extra
spaces will make the source much easier to read.  I don't
know if CCASM will accept tabs as leading whitespace, but
they are commonly used in C/C++ sources.  I hope this helps.

Rodney Hamilton





More information about the Coco mailing list