S Simple1 New Member Sep 9, 2009 #1 Hi, I'm supposed to do the following: Load hex 96 into C100, swap the nibbles, and store that into location C200. So far I figured out how to load the hex 96 into C100 but have no idea how to "Swap the nibbles." Any help would be great! So far i have: LDAA #$96 STAA $C100
Hi, I'm supposed to do the following: Load hex 96 into C100, swap the nibbles, and store that into location C200. So far I figured out how to load the hex 96 into C100 but have no idea how to "Swap the nibbles." Any help would be great! So far i have: LDAA #$96 STAA $C100
P Pommie Well-Known Member Most Helpful Member Sep 9, 2009 #2 It will be something like the Rotate Right instructions. At a guess, RORA repeated four times. Edit, Just checked and RORA is a 9 bit rotation. So you need to use a second register. Mike. Last edited: Sep 9, 2009
It will be something like the Rotate Right instructions. At a guess, RORA repeated four times. Edit, Just checked and RORA is a 9 bit rotation. So you need to use a second register. Mike.
S stugray New Member Sep 12, 2009 #3 Try this: LDAA #$96 LDAB #$96 ASLA ASLA ASLA ASLA ASRB ASRB ASRB ASRB Now you have a 6 In the left most nibble of ACCUM A and a 9 in the rightmost bits of ACCUM B STAA $C100 ORAB $C100 Now you should have 69 in $C100 There is probably a more efficient way, this is all I could think of quick Stu
Try this: LDAA #$96 LDAB #$96 ASLA ASLA ASLA ASLA ASRB ASRB ASRB ASRB Now you have a 6 In the left most nibble of ACCUM A and a 9 in the rightmost bits of ACCUM B STAA $C100 ORAB $C100 Now you should have 69 in $C100 There is probably a more efficient way, this is all I could think of quick Stu
AtomSoft Well-Known Member Sep 13, 2009 #4 Try ROL Using ROL should make bit 7 go into carry and then carry into it 0. http://www.hc11.demon.nl/thrsim11/68hc11/app_notes.htm Last edited: Sep 13, 2009
Try ROL Using ROL should make bit 7 go into carry and then carry into it 0. http://www.hc11.demon.nl/thrsim11/68hc11/app_notes.htm
S Simple1 New Member Sep 14, 2009 #5 stugray said: Try this: LDAA #$96 LDAB #$96 ASLA ASLA ASLA ASLA ASRB ASRB ASRB ASRB Stu Click to expand... This actually worked out, Thx a bunch!
stugray said: Try this: LDAA #$96 LDAB #$96 ASLA ASLA ASLA ASLA ASRB ASRB ASRB ASRB Stu Click to expand... This actually worked out, Thx a bunch!