12 year old Learning to program 6502
-
Plectic Produx
- Posts: 1
- Joined: 03 Apr 2017
12 year old Learning to program 6502
I am a 12-year-old learning to program! I know STA, LDA, and ADC. I am also interested in the Xbox 360 Motherboard
When i boot up whats the first address the 6502 goes to?
- BigDumbDinosaur
- Posts: 9425
- Joined: 28 May 2009
- Location: Midwestern USA (JB Pritzker’s dystopia)
- Contact:
Re: 12 year old Learning to program 6502
Plectic Produx wrote:
I am a 12-year-old learning to program! I know STA, LDA, and ADC. I am also interested in the Xbox 360 Motherboard
When i boot up whats the first address the 6502 goes to?
x86? We ain't got no x86. We don't NEED no stinking x86!
- GARTHWILSON
- Forum Moderator
- Posts: 8773
- Joined: 30 Aug 2002
- Location: Southern California
- Contact:
Re: 12 year old Learning to program 6502
I see BDD posted while I was writing. I'll post this anyway, even though he answered the question.
Welcome! I wish I had had this opportunity when I was 12, but common folk back then never saw a computer. Computers were few, far away, and ominous, and the few people who worked on them seemed next to God or something.
When the processor comes out of reset, it reads the reset vector at addresses $FFFC-FFFD to find out where to start executing. You will put the beginning address of your reset routine there. The reset routine does basic stuff to get the computer going, like set up the I/O and initialize the stack and various variables and then launch into your monitor or OS or even an application in ROM. So for example, if your reset routine starts at $814E, you would put $4E in address $FFFC, and $81 in address $FFFD—yes, low byte first, which you'll find out later has a good reason, to enable faster execution in many situations. (You probably wouldn't start out at $814E without a good reason; but suppose, again in our hypothetical situation, that your ROM started at $8000 and you had some data and subroutines laid down before getting to the reset routine.)
Welcome! I wish I had had this opportunity when I was 12, but common folk back then never saw a computer. Computers were few, far away, and ominous, and the few people who worked on them seemed next to God or something.
When the processor comes out of reset, it reads the reset vector at addresses $FFFC-FFFD to find out where to start executing. You will put the beginning address of your reset routine there. The reset routine does basic stuff to get the computer going, like set up the I/O and initialize the stack and various variables and then launch into your monitor or OS or even an application in ROM. So for example, if your reset routine starts at $814E, you would put $4E in address $FFFC, and $81 in address $FFFD—yes, low byte first, which you'll find out later has a good reason, to enable faster execution in many situations. (You probably wouldn't start out at $814E without a good reason; but suppose, again in our hypothetical situation, that your ROM started at $8000 and you had some data and subroutines laid down before getting to the reset routine.)
http://WilsonMinesCo.com/ lots of 6502 resources
The "second front page" is http://wilsonminesco.com/links.html .
What's an additional VIA among friends, anyhow?
The "second front page" is http://wilsonminesco.com/links.html .
What's an additional VIA among friends, anyhow?
- barrym95838
- Posts: 2056
- Joined: 30 Jun 2013
- Location: Sacramento, CA, USA
Re: 12 year old Learning to program 6502
Plectic Produx wrote:
I am a 12-year-old learning to program! I know STA, LDA, and ADC ...
Quote:
I have been fascinated with 6502 assembly language since 1981, when I mis-typed a DATA statement for a ML sound routine in an Applesoft moon landing program in Softside Magazine, and my Apple ][+ dropped me into the monitor. 6502 assembly is so brilliantly amazing to me. Like Icy said in an old thread which Garth likes to quote, programming the 6502 makes my brain feel good, and it's more of a treat than a chore for me.
Mike B.
Re: 12 year old Learning to program 6502
Plectic Produx wrote:
I am a 12-year-old learning to program!
My first computer was the Elektor Junior computer,
had to learn "how to code" after soldering this 6502 hobby kit at age 13...
In my opinion the first Book about the Junior computer is nice reading material for a beginner:
http://retro.hansotten.nl/uploads/eljun ... unior1.pdf
BTW: there is a nice description of the 6502 instruction set starting at page 138 of this book.
Hmm... realizing that I had soldered a computer before the IBM PC was invented suddenly makes me feel a little bit old.
Re: 12 year old Learning to program 6502
I was doing the same thing at the same age, I think one thing to try and get a grasp on early is the use of zeropage and the address indexing modes associated with the X and Y registers. Looking at other people's code and trying to understand what it's doing will increase your own skill level too.
-
White Flame
- Posts: 704
- Joined: 24 Jul 2012
Re: 12 year old Learning to program 6502
Which 6502 computer are you using to learn?
Thinking back to my time learning this, I've always had a lack of access to tools & information. I was struggling about with my C64 User's Guide, which didn't get into ML at all, and eventually got a Programmer's Reference Guide from a bargain bin, but still no assembler; the ROM in my machine had a simple memory monitor (no asm/disasm), and I was trying to build an assembler in BASIC but usually ended up with hand-assembled DATA bytes. Oh to have internet access with other computer enthusiasts at the time!
Thinking back to my time learning this, I've always had a lack of access to tools & information. I was struggling about with my C64 User's Guide, which didn't get into ML at all, and eventually got a Programmer's Reference Guide from a bargain bin, but still no assembler; the ROM in my machine had a simple memory monitor (no asm/disasm), and I was trying to build an assembler in BASIC but usually ended up with hand-assembled DATA bytes. Oh to have internet access with other computer enthusiasts at the time!
Re: 12 year old Learning to program 6502
Welcome!
I also started assembly language programming when I was 12 (43 now...ugh). You're very lucky in that you have a swarm of friendly, knowledgeable people on here that can help you out.
One suggestion I have (if you really want to learn the 6502) is to program one directly. Maybe find an old Commodore 64 or use an emulator such as VICE.
I programmed on real hardware back then with only magazines to help me out. Times have changed.
I also started assembly language programming when I was 12 (43 now...ugh). You're very lucky in that you have a swarm of friendly, knowledgeable people on here that can help you out.
One suggestion I have (if you really want to learn the 6502) is to program one directly. Maybe find an old Commodore 64 or use an emulator such as VICE.
I programmed on real hardware back then with only magazines to help me out. Times have changed.
Cat; the other white meat.