If you assume that A * 10 isn't going to overflow, so that ASL A moves 0 into the carry flag (so no need for CLC), then instead of using the undocumented RRA opcode, you can just do:<p>sta $00<p>asl a<p>asl a<p>adc $00<p>asl a<p>This is also 7 bytes, but is faster since adc $00 is 3 cycles, vs rra $00 being 5 cycles.<p>The A = max(A, X) example is certainly interesting, but not very useful since it loops through the code twice (very slow) and assumes that $8a is available. The much faster obvious version only adds one byte:<p>stx $00<p>cmp $00<p>bcs done<p>txa<p>done: