Sir, I would "AND" the number '54' with 0x0F. This will give you '4'. Store it in it's destination register, whatever tht may be. Then do a SWPAF and "AND" it again with 0x0F. This will give you the '5'. Store it In it's destination register. Now you're done. Regards, Jim -----Original Message----- From: piclist-bounces@mit.edu [mailto:piclist-bounces@mit.edu] On Behalf Of picnoob Sent: Tuesday, March 06, 2007 12:02 PM To: piclist@mit.edu Subject: [PIC] seperate num into tens+units hi, i need a way to seperate a number, say 54. and put 5 in a register called tens, and 4 in another called units. is there some binary operation to do this, or will it have to be a custom subroutine? i need this kinda fast, can someone help? -- View this message in context: http://www.nabble.com/seperate-num-into-tens%2Bunits-tf3356654.html#a933 5697 Sent from the PIC - [PIC] mailing list archive at Nabble.com. -- http://www.piclist.com PIC/SX FAQ & list archive View/change your membership options at http://mailman.mit.edu/mailman/listinfo/piclist -- http://www.piclist.com PIC/SX FAQ & list archive View/change your membership options at http://mailman.mit.edu/mailman/listinfo/piclist