6502.org Forum  Projects  Code  Documents  Tools  Forum
It is currently Sat May 04, 2024 7:45 am

All times are UTC




Post new topic Reply to topic  [ 8 posts ] 
Author Message
PostPosted: Mon Apr 03, 2017 1:27 am 
Offline

Joined: Mon Apr 03, 2017 1:19 am
Posts: 1
I am a 12-year-old learning to program! I know STA, LDA, and ADC. I am also interested in the Xbox 360 Motherboard :mrgreen: When i boot up whats the first address the 6502 goes to?


Top
 Profile  
Reply with quote  
PostPosted: Mon Apr 03, 2017 1:56 am 
Offline
User avatar

Joined: Thu May 28, 2009 9:46 pm
Posts: 8173
Location: Midwestern USA
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 :mrgreen: When i boot up whats the first address the 6502 goes to?

Following reset, the 6502 will load a start address from $FFFC and $FFFD, those two addresses being collectively referred to as the reset vector. The address at the reset vector, which is stored least significant byte first, will contain the first instruction in the reset code.

_________________
x86?  We ain't got no x86.  We don't NEED no stinking x86!


Top
 Profile  
Reply with quote  
PostPosted: Mon Apr 03, 2017 2:01 am 
Offline
User avatar

Joined: Fri Aug 30, 2002 1:09 am
Posts: 8430
Location: Southern California
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.)

_________________
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?


Top
 Profile  
Reply with quote  
PostPosted: Mon Apr 03, 2017 2:55 am 
Offline
User avatar

Joined: Sun Jun 30, 2013 10:26 pm
Posts: 1928
Location: Sacramento, CA, USA
Plectic Produx wrote:
I am a 12-year-old learning to program! I know STA, LDA, and ADC ...

Welcome! I believe you have come to the right place to increase your 6502 vocabulary. I knew that machine language existed when I was twelve years old, but it remained a mystery for a few more years ... "Dancing Demon" and "Invasion Force" on the TRS-80 Model 1 in junior high-school gave me a glimpse at the lightning quickness, but the built-in TRS-80 ML monitor was pitiful, so I didn't pursue the Z-80 path. Two years later, my parents helped me buy an 8-bit Apple, and it had a great built-in ML monitor, thanks to Woz. I bought it for the hi-res graphics and quality keyboard, and kept it for the 6502 inside, because I became hopelessly fascinated with 6502 assembly, as I explained in an old thread here:

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.


I was 15 at the time, and learning (advanced) English, Spanish, French, Trigonometry ... my IQ had probably just about peaked then, and my brain was gobbling up knowledge like a giant alien sponge ... so much so that by the time I reached age 19 I thought I knew everything! Boy, was I wrong ...

Mike B.


Top
 Profile  
Reply with quote  
PostPosted: Mon Apr 03, 2017 6:41 am 
Offline
User avatar

Joined: Fri Nov 09, 2012 5:54 pm
Posts: 1392
Plectic Produx wrote:
I am a 12-year-old learning to program!

Welcome to the forum.

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/eljunior/juniorbooks/ukjunior1.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. ;)


Top
 Profile  
Reply with quote  
PostPosted: Mon Apr 03, 2017 8:29 am 
Offline

Joined: Sat May 02, 2015 6:59 pm
Posts: 134
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.


Top
 Profile  
Reply with quote  
PostPosted: Mon Apr 03, 2017 3:59 pm 
Offline

Joined: Tue Jul 24, 2012 2:27 am
Posts: 672
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!

_________________
WFDis Interactive 6502 Disassembler
AcheronVM: A Reconfigurable 16-bit Virtual CPU for the 6502 Microprocessor


Top
 Profile  
Reply with quote  
PostPosted: Wed Apr 05, 2017 3:21 pm 
Offline
User avatar

Joined: Wed Aug 17, 2005 12:07 am
Posts: 1207
Location: Soddy-Daisy, TN USA
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. :-D

_________________
Cat; the other white meat.


Top
 Profile  
Reply with quote  
Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 8 posts ] 

All times are UTC


Who is online

Users browsing this forum: No registered users and 6 guests


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot post attachments in this forum

Search for:
Jump to: