Created
November 2, 2017 12:38
-
-
Save Jacajack/1474013ca012becd8c68d4f42a543a01 to your computer and use it in GitHub Desktop.
AVR inline assembly 8bit multiplication upper half
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#define HMUL( ans, b1, b2 ) \ | |
asm volatile( \ | |
"mul %1, %2\n\t" \ | |
"mov %0, r1\n\t" \ | |
: "=l"(ans) \ | |
: "d"(b1), "d"(b2) \ | |
); | |
#define HMULS( ans, b1, b2 ) \ | |
asm volatile( \ | |
"muls %1, %2\n\t" \ | |
"mov %0, r1\n\t" \ | |
: "=l"(ans) \ | |
: "d"(b1), "d"(b2) \ | |
); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment