Search found 4 matches

by DougBrunelle
Mon Jun 12, 2017 3:33 am
Forum: Programming
Topic: Structure: Best Practices? Subroutines vs. Main Program
Replies: 19
Views: 5413

Re: Structure: Best Practices? Subroutines vs. Main Program

Thank you all for your comments and suggestions! Thought-provoking and excellent info. Btw I'm reading through Jim Butterfield's "Machine Language Programming for the Commodore 64 and Other Commodore Computers". Jim was "The Man" back in the '80s, as I recall. RIP, he passed on in 2007..

--db
by DougBrunelle
Sun May 28, 2017 10:46 pm
Forum: Programming
Topic: Structure: Best Practices? Subroutines vs. Main Program
Replies: 19
Views: 5413

Re: Structure: Best Practices? Subroutines vs. Main Program

Yes, I think the challenge is to find a balance between extreme modularity and extreme monolithic code. For my subroutines, I think what I'll do for now is to have them only save registers that they modify- if only .X is changed, then why save .Y and the Accumulator on the stack? That way, my code ...
by DougBrunelle
Sun May 28, 2017 10:04 pm
Forum: Programming
Topic: Structure: Best Practices? Subroutines vs. Main Program
Replies: 19
Views: 5413

Structure: Best Practices? Subroutines vs. Main Program

I'm getting back into 6502 assembly programming, and I have been wondering about a couple of things. I'm using Relaunch64 for my IDE, Kick Assembler, and VICE to emulate a C64 (I don't currently have any 6502 hardware).

1. If we want to keep the .A, .X, and .Y registers in the main program safe ...
by DougBrunelle
Tue May 26, 2015 10:48 am
Forum: General Discussions
Topic: Why do we do this?
Replies: 21
Views: 7359

Re: Why do we do this?

I'm new to the group, and I found this thread and topic fascinating, so I thought I'd chime in.

Jac touched upon something above, when he said that learning the 6502 and computer system built from it was "... an oasis of logic in a world that was going insane around me". Yes. And the world ...