Page 1 of 1

Video: Lesson 2 - Addressing modes on the 6502

Posted: Tue Apr 23, 2019 12:58 pm
by akuyou
https://youtu.be/nOPI0Xbj_Yc

www.chibiakumas.com/6502/#Lesson2

The 6502 has very few registers - but it makes up for this with a mind boggling number of addressing modes!

You won't need them all at first, but you should at least understand what they all do - lets see some examples of how they work!

Lets try them all out with some simple examples!

Re: Video: Lesson 2 - Addressing modes on the 6502

Posted: Thu May 23, 2019 5:18 am
by Super_Maryo_53
Hey @Akuyou, i commented on this lessons video today, about having problems running the program through the BBC emulator and i was thinking asking here would be better.
so when i try to run the lesson prog (the test data,the chunk code and example 8), it loads up correctly for a split second then goes to this: https://imgur.com/gallery/7KPvm5F
i haven't changed any of the code and i have re-downloaded the devtools; so i think it might be because i am using win 10. But i don't really know. :|
Anyway, any help would be amazing.

Re: Video: Lesson 2 - Addressing modes on the 6502

Posted: Thu May 23, 2019 8:54 am
by akuyou
Yes, the same problem is happening my end too... it looks like a bug has crept in somewhere in the 'Monitor' code...

This should only take an hour or two to figure out... give me a moment!

Re: Video: Lesson 2 - Addressing modes on the 6502

Posted: Thu May 23, 2019 9:46 am
by akuyou
Ok, I think I got it sorted... please re-download the sources file:
http://www.chibiakumas.com/6502/sources.7z

Technical bit - no need to worry about this!

I've added some more code to the common functions, and it meant the code of the example was using the areas as the 'test writes'... so the test code was corrupting the functions of the code!

I've changed the start address from $1000 to $0200, which makes enough space for the problem no longer occur

Re: Video: Lesson 2 - Addressing modes on the 6502

Posted: Fri May 24, 2019 6:47 am
by Super_Maryo_53
Hey Akuyou, i just got a chance to try out the new source and i'm still having the same problem :cry:
Although it's now lasting a few more seconds before going into the black screen, so now i can actually see the code in action .
I have moved on to the other lessons, since this one is more about the theory and i haven't come across any problems yet :)
Thanks again for your help and hard work! It has helped a lot.

Re: Video: Lesson 2 - Addressing modes on the 6502

Posted: Tue May 19, 2020 3:20 am
by rumothy
Akuyou, thanks a lot for doing this! This a really good tutorial and you are a really good teacher.

After copying the sources from the newest link, I cannot change the accumulator with an lda instruction.
Using the tools from https://www.chibiakumas.com/6502/6502DevTools.php and running Vasm SNS instead of Vasm BBC (still crashes) does work though.

Re: Video: Lesson 2 - Addressing modes on the 6502

Posted: Tue May 19, 2020 3:28 pm
by Voyager_sput
Hi rumothy,

Did you also download the latest sources.7z to go along with the devtools? I just tried running example 2 from the Lesson2_AddressingTest.asm file in my version of the devtools/sources and it ran just fine:

it loaded $08 into the assembler, printed the values with the monitor function, then it did a LSR (logical shift right), bit shifting the bits to the right, effectively deviding 8 by 2, with another monitor printing the number 4 as expected:

Re: Video: Lesson 2 - Addressing modes on the 6502

Posted: Tue May 19, 2020 3:32 pm
by Voyager_sput
Oh, and the SNES version doesn't crash for me. Sure it complains about a bad checksum in the ROM file, but Snes9X loads just fine for me, with the same results.

Re: Video: Lesson 2 - Addressing modes on the 6502

Posted: Thu May 21, 2020 11:33 am
by rumothy
Yep, I downloaded the latest devtools and sources from the first two links on the devtools page and I get the same result.
a: 1A

devtools page: https://www.chibiakumas.com/6502/6502DevTools.php
link1: https://www.chibiakumas.com/6502/6502DevTools.7z
link2: https://www.chibiakumas.com/6502/sources.7z

Re: Video: Lesson 2 - Addressing modes on the 6502

Posted: Sun May 24, 2020 9:59 am
by akuyou
The problem with the monitor not showing the correct value of A was a bug in the monitor asm file... I've fixed it in the latest sources.7z - please re-download and give it another go.

I'm not sure why the SNES emulator is crashing - it's working OK here, I wonder if it's an issue with the emulator on your machine.