Up one 6502 Shorts. By Lee Davison. Up to top

Short code bits Introduction.
This section is for those short bits of code that are just what you need every now and then.

Anything longer than $20 bytes should probably be elsewhere.

The code.

Toggle carry - Change the sense of the carry bit. BCD to binary - Convert a BCD byte to binary.
Range test - Test a byte is in the range n to m. Binary to BCD - Convert a binary byte to BCD.
Check CMOS - Test if code is running on a 65C02. Hex to ASCII - Another way to convert a hex nibble.
Save XY - Push/pull X & Y without using A. Eight bit rotates - One bit less in ROL or ROR.
ASL & ASR - A true arithmetic shift left and right. Sign extend - Extending a less than 8 bit value to 8 bits.


Last page update: 23rd April, 2006. e-mail me e-mail