Search found 8 matches

by echidna
Tue Mar 22, 2022 11:02 pm
Forum: General Discussions
Topic: JSON document with the 65C02 opcodes
Replies: 0
Views: 30180

JSON document with the 65C02 opcodes

I put together a JSON document with the 65C02 opcodes.
The "Illegal" instructions are lumped together under "Undocumented NOP".
Please suggest edits and/or point out mistakes.
https://github.com/ericTheEchidna/65C02-JSON
by echidna
Tue Mar 08, 2022 5:38 pm
Forum: Newbies
Topic: cc65 confusion...
Replies: 18
Views: 3608

Re: cc65 confusion...

Thank you. This makes tons of sense.

Hello!
#include "ek6502.h"

unsigned char *command = ",,,,,,,,";
int main() {
unsigned char *c = "!!!!!!!!";

lcdInit();

lcdPrint(command);

lcdPrint(c);

return (0);
}

void handleInterrupt(void) {
}


Your C code has some issues. The biggest ...
by echidna
Mon Mar 07, 2022 5:37 pm
Forum: Newbies
Topic: cc65 confusion...
Replies: 18
Views: 3608

Re: cc65 confusion...

handyandy wrote:
What’s the handleinterrupt function doing?

Normally, an irq or brk would return with an rti not rts.

Cheers,
Andy
It's cruft, I was lazy, but thanks for the rti vs rts.
by echidna
Mon Mar 07, 2022 5:53 am
Forum: Newbies
Topic: cc65 confusion...
Replies: 18
Views: 3608

Re: cc65 confusion...

What happens when main returns? Just to be sure nothing weird is happening after that, you could try putting while(1); before return (0); . Also, no need to put parentheses around the value in a return statement.

same results with or without an infinite loop.
Please forgive my C styling, 20 years ...
by echidna
Mon Mar 07, 2022 5:49 am
Forum: Newbies
Topic: cc65 confusion...
Replies: 18
Views: 3608

Re: cc65 confusion...

Well, the nice thing about having the generated assembly is that you can play with it to see if it does what you expect.

You can change this:

; ---------------------------------------------------------------
; int __near__ main (void ...
by echidna
Mon Mar 07, 2022 5:48 am
Forum: Newbies
Topic: cc65 confusion...
Replies: 18
Views: 3608

Re: cc65 confusion...

Is the CC65 environment configuration appropriate for your system?
Are you running the CC65 environment initialization routine before calling main?

The global string pointer is defined globally. It doesn't use the CC65 local stack.
The local string pointer is defined on the CC65 local stack.

The ...
by echidna
Mon Mar 07, 2022 5:45 am
Forum: Newbies
Topic: cc65 confusion...
Replies: 18
Views: 3608

Re: cc65 confusion...

BigEd wrote:
Welcome!

What happens if you print from c first and then from command?
Oh man, I've tried so many combinations that I honestly can't be sure, but I *think* it prints garbage then the good stuff
by echidna
Sun Mar 06, 2022 2:18 am
Forum: Newbies
Topic: cc65 confusion...
Replies: 18
Views: 3608

cc65 confusion...

Hello!
First post here so I hope I'm doing things correctly..
I have the Ben Eater 6502 project done... mostly.
I'm using the cc65 tools and have managed to get printing to my LCD working.. sort of.
It handles printing a globally declared char string, but gets super weird printing a locally declared ...