Jump to content
piders7

Trouble with Assembly

Recommended Posts

I'm having a lot of trouble getting started with assembly. Any tips? Example programs? Anything of the sort would be nice.

Share this post


Link to post
Share on other sites

Sorry about that. Lemme put it this way: if you know Assembly, where or how did you first learn it?

 

Wow - didn't think I'd be able to find this: https://drive.google.com/file/d/0Bxv0SsvibDMTcHNXalEtYkVtU00/view- learnt as a child from books from the library - seems like Usborne's released pdf's of all there cool computer books from the 80s: https://usborne.com/browse-books/features/computer-and-coding-books/

Share this post


Link to post
Share on other sites

Sorry about that. Lemme put it this way: if you know Assembly, where or how did you first learn it?

 

Nobody really "knows assembly" in the general sense. Different types of processors have completely different assembly languages, although learning one does go a long way toward learning others.

 

I first learned x86 assembly in college, as well as PIC assembly, but I've forgotten all the PIC stuff. I learned 6502 assembly a few years ago just by reading various online articles and browsing the books at http://www.atariarchives.org/

Share this post


Link to post
Share on other sites

1. get dasm, learn how to use it to assemble code into a binary.. for VCS programming, you need to use -f3 (to do raw output)

2. use Darrell Spice's Collect tutorial (google for it)

3. get any book on 6502 assembly that you can. Lawrence Leventhal's book is particularly excellent for algorithms

4. get a quick reference sheet for 6502 instructions. Learn and memorize the instructions AND THEIR CYCLE COUNTS.

5. experiment, experiment, experiment.

6. repeat step 5 endlessly.

 

-Thom

 

Addendum: you also need the Stella Programmer's Guide. This is a hardware manual for the system, and it is required so that you know the registers of the machine.

Share this post


Link to post
Share on other sites

Don't forget to read the Stella programming guide a few times.

 

I second this, I love the guide!

 

Without knowing the ins and the outs of the hardware I'd never have been able to make my scrolling kernel.

Share this post


Link to post
Share on other sites

Sorry about that. Lemme put it this way: if you know Assembly, where or how did you first learn it?

 

Bit of background: I had immense problems learning Assembly back in the 80s...my younger brother was writing programs with ease and I couldn't even figure out a single instruction. It was very intimidating for me.

 

I eventually learned it from hacking. I wanted to customize games so I would open them up in Stella and start by tweaking graphics code. Then I would study some disassemblies and eventually learn how the program was calling that code. Started with Combat, Air Sea Battle, moved to Superman and other games, and started to see patterns. I'd come on this forum and ask question--how do you bankswitch, is my problem here too many cycles, etc? The hacking projects got progressively more complicated until I got to the point where I could blank out code I didn't need and write whole new routines from scratch.

 

If you're having trouble with abstract code instruction, try messing around in some games that have a good disassembly. Combat's great to start.

Share this post


Link to post
Share on other sites

Sorry about that. Lemme put it this way: if you know Assembly, where or how did you first learn it?

I learned x86 assembly in high school using a Peter Norton book from the library. Like most good tutorials, it started out assuming you know nothing and built onto a project piece by piece. It also got you familiar with using a debugger, which is just as important as being able to write and build code. I learned Motorola 6800 assembly from college classes, and various other instruction sets from work and side projects.

 

The suggestions above are spot-on - find a good book or online tutorial, get a simple program building, and start experimenting and stepping through your code with a debugger.

Share this post


Link to post
Share on other sites

Sorry about that. Lemme put it this way: if you know Assembly, where or how did you first learn it?

Great question - most of us who know Assembly did not learn it starting with the VCS because the architecture is not predisposed to learning Assembly unless you use a Framework like bB or vwB which offer phantom hardware for a framebuffer and x,y addressable sprites.

 

Otherwise you have to create your own video driver and graphics card in software (kernel) for your Assembly program to use which is very advanced difficulty level; starting with Assembly 500 instead of Assembly 100 can make it a lot harder.

Share this post


Link to post
Share on other sites

I eventually learned it from hacking. I wanted to customize games so I would open them up in Stella and start by tweaking graphics code. Then I would study some disassemblies and eventually learn how the program was calling that code. Started with Combat, Air Sea Battle, moved to Superman and other games, and started to see patterns. I'd come on this forum and ask question--how do you bankswitch, is my problem here too many cycles, etc? The hacking projects got progressively more complicated until I got to the point where I could blank out code I didn't need and write whole new routines from scratch.

That about how I started learning assembly back in the 80ies. icon_smile.gif

Share this post


Link to post
Share on other sites

Any kinda example, novice program?

 

 

My Collect series has lots of comments in the code, should be fairly easy to follow. The blog lists newest entry first, so go to the bottom of the last page to start from the beginning.

Share this post


Link to post
Share on other sites

Random Terrain converted my Collect series to a set of web pages, which you may find to be easier to follow. If you have questions about a particular entry use the link at the top-right of each page to get back to the original blog post, then post your questions there.

Share this post


Link to post
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Loading...

  • Recently Browsing   0 members

    No registered users viewing this page.

×
×
  • Create New...