sometimes99er Posted March 30, 2011 Share Posted March 30, 2011 Since the numbers are decimal, you're multiplying by 10 to build the number up. I ended up using the old 8x+2x trick, too lazy to use DIV So, to multiply r0 by 10: MOV R0,R1 ; COPY R0 SLA R0,3 ; MULTIPLY R0 BY 8 A R1,R1 ; MULTIPLY R1 BY 2 A R1,R0 ; R0=R0*10 Not sure if that would be faster than DIV - probably not, since the code is in 8-bit memory, however, it wasn't time-critical code, and it makes register planning a lot easier I'm too lazy too. Would love to see you try multiplying using DIV though. Quote Link to comment Share on other sites More sharing options...
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.