Dan Moos wrote:
I was wondering if there is a loosely agreed upon "best practice" for when to use a particular number base when coding in 6502 (among other) assembly.
I basically ind myself using hex for everything. For instance, I would never use anything but base 10 for loop indexing in C (seems silly to even consider otherwise), yet in assembly I use hex. In fact I never use base ten anywhere. Just sort became a habit that came from who knows where. I do use binary when specific bits are being dealt with (same as I do in C).
Is there a kinda standard that folks use? Mostly just curious.
In most of my programs I use decimal for "values," such as the number of interrupts per second or the X-Y coordinates on the screen. I use binary for anything that involves bitwise manipulation, such as performing a Boolean operation,configuring device registers or extracting a flag from a bit field. I most often use hexadecimal when accessing memory or I/O devices is involved.
As Ed and Garth said, use what is most natural to you. As your 6502 assembly language skills improve you will develop a sixth sense for when each base is appropriate.