Jump to content
IGNORED

Starting with straight 6502 or BatariBasic?


endrien

Recommended Posts

I don't comment in code because I'm lazy/sloppy. Descriptive variable and constant names are a must though.

 

Batari BASIC kernel features are pretty much what the 2600 can do. However, assembly lets you make sacrifices for better features in another aspects of your game. Disclaimer: Born and raised BASIC/4GL programmer.

 

It's your programming background that determines whether BASIC first or assembly first is better. Most people I know were raised on farm fresh MS Basic and worked "down" to assembly routines.

Edited by theloon
Link to comment
Share on other sites

I don't comment in code because I'm lazy/sloppy. Descriptive variable and constant names are a must though.

 

Batari BASIC kernel features are pretty much what the 2600 can do. However, assembly lets you make sacrifices for better features in another aspects of your game. Disclaimer: Born and raised BASIC/4GL programmer.

 

It's your programming background that determines whether BASIC first or assembly first is better. Most people I know were raised on farm fresh MS Basic and worked "down" to assembly routines.

I've never done too well with assembly, though I did do pretty well with visual basic(derived from basic)

Link to comment
Share on other sites

Not to put anybody on the spot or anything...but I'm reminded by a recent example where the idea was to check a bunch of variables and set a value if all cases were true (which was to be checked for a few different starting variables). It quickly became a problem just to try to figure out how to compose the lines...when in assembly it could be accomplished in a handful of bytes. That's an example of the language having a negative effect on a programmer's creativity.

I agree with this, as bB's simple conditions made it harder for beginners and experienced programmers alike. I spent the last few evenings working on this. It can generate efficient code, such as converting this (compiled with -O)

 if !u{0} then skip_the_rest
 if v<>1 then skip_the_rest
 if (a&3)=0 then set_x
 if (e&3)=0 then set_x
 if (i&3)=0 then set_x
 if (m&3)<>0 then skip_the_rest
set_x
 x=2
skip_the_rest

To this:

LDA u
LSR
bcc .skip_the_rest
    
LDA v
CMP #1
bne .skip_the_rest

LDA a
AND #3

beq .set_x
LDA e
AND #3

beq .set_x
LDA i
AND #3

beq .set_x
LDA m
AND #3

bne .skip_the_rest
.set_x

LDA #2
STA x
.skip_the_rest

Furthermore, the code suggestions that failed before will now work.

Link to comment
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...