I got the following routine for 16-bit x 8-bit multiplication. But something is missing. I think 'hl' needs to be rotated at some points.

sla   h      ; optimised 1st iteration
   jr   nc,$+3
   ld   l,e

   add   hl,hl      ; unroll 7 times
   jr   nc,$+3      ; ...
   add   hl,de   

Edit: I decided to use the routine Kerm recommended to me a while back. 8-bit x 8-bit into a 16-bit. Is this the routine, or do I need to add a loop, because it doesn't seem to loop.
Yes, that is what I used, but I feel like these 3 lines should be looped 8 times.

add   hl,hl      ; unroll 7 times
   jr   nc,$+3      ; ...
   add   hl,de
Register to Join the Conversation
Have your own thoughts to add to this or any other topic? Want to ask a question, offer a suggestion, share your own programs and projects, upload a file to the file archives, get help with calculator and computer programming, or simply chat with like-minded coders and tech and calculator enthusiasts via the site-wide AJAX SAX widget? Registration for a free Cemetech account only takes a minute.

» Go to Registration page
Page 1 of 1
» All times are UTC - 5 Hours
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum