boolean - Can I use OR instruction between A and B registers in HC12 (Assembly) -
i give me guidance on how make program takes 2 8 data bits stored in memory, take significant part of 1 them , least significant of other , save result.
example: data 1: 19 data 2: 3a result: 1a
for moment i've done this.
-step 1. registers , b used store data of 8 bits.
-step 2. use instruction anda first 8-bit value in register a.
-step 3. use andb instruction second 8-bit value in register b.
but don't know how use or concatenate or b.
thanks in advance!!
if in step 2, , mask extract msb, , in step 3 , b mask lsb, can "or" , b using "aba" instruction.
while aba technically add, when "add" bit x 0 bit, x. since corresponding bits in , b zeroed, aba acts or.
alternatively, can store b register page 0 cell, , or cell register. clumsy clear. if aren't conscious code space or time, might choose solution clarity; aba solution isn't obvious unless think it. (most people doing serious coding machine architecture know these tricks heart might not matter).
Comments
Post a Comment