Search found 5 matches

by rdb9879
Sun Jun 10, 2018 5:31 pm
Forum: Newbies
Topic: Extremely simple 6502 C program
Replies: 15
Views: 7642

Re: Extremely simple 6502 C program

The off by one error was simply related to the argument I passed into the dissassembler: I needed -S 0x1FF instead of -S 0x200 . Putting -S 0x200 shifted all the op codes by 1 address, so when the program counter reached the jsr L0283 op-code, this was jumping to one address off from the intended op ...
by rdb9879
Sun Jun 10, 2018 1:06 pm
Forum: Newbies
Topic: Extremely simple 6502 C program
Replies: 15
Views: 7642

Re: Extremely simple 6502 C program

You were right. Everything was shifted in addresses by 1. If I load the code into $01FF, everything works fine.

Cheers
by rdb9879
Sun Jun 10, 2018 1:36 am
Forum: Newbies
Topic: Extremely simple 6502 C program
Replies: 15
Views: 7642

Re: Extremely simple 6502 C program

Well actually, the disassembly code that I posted in my previous post was incomplete. It was only the portion that I had questions about...I do, in fact, see my C code behavior later in the disassembly file:

;
; ----------------------------------------------------------------------------
ldx ...
by rdb9879
Sat Jun 09, 2018 10:21 pm
Forum: Newbies
Topic: Extremely simple 6502 C program
Replies: 15
Views: 7642

Re: Extremely simple 6502 C program

Ah okay. Those are good points. I can always force the reset vectors to whatever I want, so no worries.

So I found the "sim6502.cfg" file and it indicates that the main start = $0200. I disassembled the binary file using the "-S 0x200" command (this may be the incorrect thing to do).

Here's what i ...
by rdb9879
Sat Jun 09, 2018 4:49 pm
Forum: Newbies
Topic: Extremely simple 6502 C program
Replies: 15
Views: 7642

Extremely simple 6502 C program

Greetings. I am getting my feet wet with programming a 6502 in C. I have looked at some of the sample programs, but most of the resources online are trying to target an NES (including its GPU and "mappers"). I would like to break it down even more simply, just a simple bare bones 6502 processor with ...