scarabaeus Creative Commons License 2024.09.13 0 0 10164

Kellett viszonylag gyors nibble swap. Gondoltam lookup táblára, annál nincs gyorsabb, de negyed KB erre... Persze megcsináltam a bittologatással is, de kíváncsiságból rákerestem, van-e ebben valami találmány, és igen:

http://6502.org/source/general/SWN.html

 

"It takes only 8 bytes and 12 clock cycles, and no variables, no stack usage, no look-up table, no X or Y usage. It uses only the accumulator and status register."

 

ASL

ADC #$80

ROL

ASL

ADC #$80

ROL

 

Elnézegettem azért egy ideig ezt a pár sort. :-)