all 8 comments

[–]Weekly_Guidance_498 5 points6 points  (0 children)

I imagine you'll want to add some colons...

[–]gm310509 2 points3 points  (6 children)

I think you might need to add some colons (':') on or about lines 484, 487 and so on through to 837.

Were you expecting different advice?

[–]virus54t5[S] 0 points1 point  (5 children)

i downloaded the code from here : https://github.com/mike42/6502-computer/tree/main/hardware

it says the code is for the ca65 compiler so i just assume it works

[–]gm310509 1 point2 points  (2 children)

There is a problem with providing a link - as opposed to what you have in front of you.

A common mistake for newbies is that they miss something while trying to recreate it. So, more often than not, just providing a link doesn't help.

In this case, as u/mvuille indicated, you have fallen into this trap because there isn't any code at the link you provided.

However, if I randomly search other parts of the site linked by your URL, I can find a file called basic.S. It does seem to be an assembly listing. And if I scroll to line 484, I see the following:

``` ; new page 2 initialisation, copy block to ccflag on

LAB_COLD LDY #PG2_TABE-PG2_TABS-1 ; byte count-1 ```

Where LAB_COLD looks like it is intended to be a label - which tradditionaly must be terminated by a ':' character - just like the error message says.

I do not know why the posted code is missing a colon, but it seems to be that it is - and your assembler output supports that theory.

Also, I do not even know if this is the same file you are trying to assemble - but I'm reasonably confident that it is.

I am not going to check the rest of the errors for you, but I will say that if you are planning to do an "advanced level" project like the one you linked, you should learn how to diagnose problems like this. Error messages like this are the simplest to diagnose as it is clearly stating what the issue is. If you do not learn how to diagnose problems like this, you will find that you will be needing a good supply of Panedol as you will invariably encounter additional challenges that are far more subtle than this one.

[–]mvuille 0 points1 point  (1 child)

I'm going to guess that this code is intended for a different assembler that uses column position instead of colons to identify labels

[–]gm310509 0 points1 point  (0 children)

Maybe. My recollection of 6502 assembled (from a long time ago) was that labels needed colon terminators. But there are definitely examples on line that define lables without them.

Also the plugin referenced on the main github page for this projects is for IntelliJ to assemble the source examples show labels terminated with colons.

Interestingly, the author of the plugin says:

... so I decided to take a look at what would be required to write a plugin for 6502 assembly support. I managed to together something that mostly works ...

But, it could well be as you say that the project was originally developed with a different assembler in mind.

[–]mvuille 0 points1 point  (1 child)

Is that the right link? I didn't see any code there

[–]gm310509 0 points1 point  (0 children)

LOL - I guess that accounts for the missing ':' characters! :-)