[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: 6502 flag behaviour
David Schmidt (anonymous@fight.spam) wrote:
: This is actually pretty common in 6502 assembly--I did it all the time. If you
: need to jump to somewhere within +/- 127 bytes, look above and find some
: condition that is always true, and branch on it. Compared to a regular JMP,
: saves 1 byte and several machine cycles.
Not to mention that conditional branches are relocatable. Granted, that
isn't a problem if you are writing linked modules for GS/OS, but if you
are doing classic 6502 code, fully relocatable code can be really useful.
For example, if you want to have a code library floating above the end of
an Applesoft program, it had better be relocatable...which means no
internal ($4C) JMPs or ($20) JSRs...
*AD AD C4 E1 F6 E5 A0 C1 EC F4 E8 EF E6 E6 AC A0 DD DB 8D
--
/-\ _ _ *** New season begins May 9! ***
/XXX\ /X\ /X\_ _ /XX\_ _ _ _____
/XXXXX\ /XXX\ _/XXXX\_ /X\ /XXXXX\ /X\ /X\ /XXXXX
_/XXXXXXX\__/XXXXX\/XXXXXXXX\_/XXX\_/XXXXXXX\__/XXX\_/XXX\_/\_/XXXXXX