6502.org Forum  Projects  Code  Documents  Tools  Forum
It is currently Fri Nov 15, 2024 11:58 pm

All times are UTC




Post new topic Reply to topic  [ 9 posts ] 
Author Message
 Post subject: I need help with...
PostPosted: Sat May 08, 2004 6:47 pm 
Offline

Joined: Sat May 08, 2004 6:42 pm
Posts: 3
Does anyone know how I can learn 6502 Assembly language? I want to program my own games with this language, but its a real pain to learn. Anyone know a site where there are teachers that teach this, or can anyone recommend any good books for newbies. I am a fan of the 8 bit NES Megaman games, and I want to program my own, but I need to learn 6502 in order to do that. Anything would be appreciated. I am willing to learn. Thanks!


Top
 Profile  
Reply with quote  
 Post subject:
PostPosted: Sun May 09, 2004 8:46 am 
Offline
User avatar

Joined: Tue Mar 02, 2004 8:55 am
Posts: 996
Location: Berkshire, UK
Try searching e-bay or second hand book dealers. The online book service at http://www.abebooks.co.uk is showing several 6502 programming books for £3 to £20 + postage.

And there is also my online reference at http://www.obelisk.demon.co.uk/6502/ and http://www.obelisk.demon.co.uk/65C02/

_________________
Andrew Jacobs
6502 & PIC Stuff - http://www.obelisk.me.uk/
Cross-Platform 6502/65C02/65816 Macro Assembler - http://www.obelisk.me.uk/dev65/
Open Source Projects - https://github.com/andrew-jacobs


Top
 Profile  
Reply with quote  
 Post subject:
PostPosted: Sun May 09, 2004 11:19 am 
Offline
User avatar

Joined: Fri Aug 30, 2002 1:09 am
Posts: 8541
Location: Southern California
You can also look on this website at http://www.6502.org/booklist.php . The fourth item, Eyes' and Lichty's book, is the one Western Design Center sells. To say that I recommend it highly would be a gross understatement. It's expensive, but worth every penny for anyone who's serious about programming the 65-family processors.


Top
 Profile  
Reply with quote  
 Post subject:
PostPosted: Sun May 09, 2004 6:34 pm 
Offline

Joined: Sat May 08, 2004 6:42 pm
Posts: 3
Thanks guys for the help. I have actually read that Obelisk one though. I even printed the whole thing out! It didn't help me very much. There is still a lof of stuff I don't understand. Like, I don't know what a "Stack" is. I don't know what a "buffer" is. All of these complex terms, and no one really ever tells you in what program do you put the code. I understand the 6502 has 3 registers, X, Y, and A. I understand that they perform calculations and stuff. But, my main concern is videogames. I want to program my own ROMs to run on an emulator. The NES uses a 6502 microprocessor. I need to learn it. However, not much has helped me. Aren't there professionals out there that know this stuff?


Top
 Profile  
Reply with quote  
 Post subject:
PostPosted: Mon May 10, 2004 6:04 am 
Offline
User avatar

Joined: Thu Mar 11, 2004 7:42 am
Posts: 362
You might have more luck with a introductory 6502 assembly language book if you look for something Apple or Commodore oriented. Back in their heyday, there were a lot of beginners who were learning to program and there were many 6502 assembly books written along those lines. I realize that this isn't exactly what you're looking for, but NES information (books or whatever you find online) may be more reference than tutorial. You'll need some sort of NES reference material anyway so that you can adapt the 6502 knowledge to that system.

You might also want to look for a book about writing games, since very few 6502 assembly books cover that topic. Examining existing games (and other programs) to see how they work is a great way to learn. It may even help you pick up some good NES-specific techniques.

The good news is that the 6502 is a relatively simple processor as processors go, and is easier to learn than most. You might want to try experimenting with a couple of the various 6502 emulators out there. There is no substitute for just pressing keys and seeing what happens. Many programmers are self-taught to a degree.

Good luck.


Top
 Profile  
Reply with quote  
 Post subject:
PostPosted: Mon May 10, 2004 2:04 pm 
Offline

Joined: Fri Jun 27, 2003 8:12 am
Posts: 618
Location: Meadowbrook
The Jeffrey Stanton book on arcade games may be a plus, it is mainly on the Apple ][ and on the graphics techniques in there.

In order to really get any form of a game going, you need to know 6502 like a second language. While there are C compilers for the 6502, I do NOT recommend them because of the speed of the NES and the capabilities. I always considered C to be the lazy programmer's language anyways. It has helped contribute to the decline of Western civilization.

Programming a game is a ***LONG*** process of at least a year's work. The fastest programming cycle I know of for an arcade game is Clay Pigeon, which took 6 weeks. But it helped in that the programmer used a lot of his older gun game library and had helped design the hardware.

My main off project is the programming of a pinball machine right now. I am using the same basic conceptual loop that I used for programming video games. It goes:

POST
init system variables
init game variables

LOOP
for Matrix = 1 to 8
Calculate temop registers
push temp registers (displays lights)
read switch returns)
input processing (debouncing)
Next Matrix
Game mode switchboard
Do game processing
Goto LOOP


That is the conceptuals loop to it. Instead of each area being seperate, I am forced by the hardware to create the ligght matrix and read the switch variables simultaneously because both matrixes are strobed by a single matrix.


Pr4ogramming the NES is quite involved, but at least you are not attempting the grand wizard's code of trying to do the 2600. That is the true Zen master's goal. If you can make a game on the 2600, you ARE a master hacker, plain and simple.

_________________
"My biggest dream in life? Building black plywood Habitrails"


Top
 Profile  
Reply with quote  
 Post subject:
PostPosted: Tue May 11, 2004 8:22 am 
Offline
User avatar

Joined: Fri Dec 12, 2003 7:22 am
Posts: 259
Location: Heerlen, NL
Hallo Rockman,

> I have actually read that Obelisk one though.

The problem is that reading alone is not good enough. You have to DO it. And unfortunately the NES is one of the worst system to start with. Get your hands on a C64 and preferably a drive. Then get a good monitor and start rereading the book. But now start coding things. Don't worry, you cannot mess up or fry the C64 if you make a mistake.
What is a good monitor: one with trace abilities. Trace enables you to go through a program instruction by instruction.

On second thought: use VICE, an excellent C64-emulator. I use it to test the binaries my Pascal-compiler generates.


> I understand the 6502 has 3 registers, X, Y, and A.

Then you haven't read the book good enough or it simply is a bad book. What about the Stackpointer, Programcounter and Flagregister?

_________________
Code:
    ___
   / __|__
  / /  |_/     Groetjes, Ruud
  \ \__|_\
   \___|       URL: www.baltissen.org



Top
 Profile  
Reply with quote  
 Post subject:
PostPosted: Tue May 11, 2004 8:57 pm 
Offline

Joined: Sat May 08, 2004 6:42 pm
Posts: 3
GARTHWILSON wrote:
Rockman, check your private messages here on this forum. (You'll have to log in first.)

I'll delete this message when I see you've picked up the PM.


I got the PMs. Thanks. I still have to read them though. I had to work the past couple of days. I will PM or email you soon.

And thanks for the info guys. I will reply back soon when I have some free time.


Top
 Profile  
Reply with quote  
 Post subject:
PostPosted: Thu May 13, 2004 10:11 am 
Offline

Joined: Thu Jan 16, 2003 12:55 pm
Posts: 64
Location: Indianapolis
I've learned 6502 (and programming in general) with the NES. It's pretty simple when you break it down to individual steps, but yeah, it does become very involving when you write a full-blown game (with scrolling, collision detection, and everything). I'm working on an NES game also. :)

Emulators like FCE Ultra, NESten, and Nintendulator have debuggers for single-stepping through code and viewing memory, which can be pretty helpful.

The downside with NES development is that it takes lots of effort and/or somewhat expensive equipment to run your program on the actual system. This shouldn't stop anybody though, at the worst you'll just have to use emulators exclusively (and they can be unreliable in certain ways).

Once you get something running, if you want it tested on the real thing let me know, I'd be happy to help.

And check out my site, you've probably seen it by now, but if not here's the address: http://nesdev.parodius.com/


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

All times are UTC


Who is online

Users browsing this forum: Google [Bot] and 5 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: