Hint for using avr200.asm code in my C program for 8 by 8 bit unsingned/signed multiplication

Thread Starter

Tanushree Banerjee

Joined Dec 9, 2015

I have learned that fast and optimised 8 by 8 bit multiplication code is available for AVR 8 bit microcontrollers from the below link :


The code was found over here :

And also here:


The 'mpy8u' subroutine is for unsigned 8X8 bit multiplication, which I'm interested in.

But however I'm not very sure how to integrate it with my normal C code for building on Atmel Studio 7.

I'm not very used to assembly language coding. Sorry :(
Say I have ,

void main()


uint8_t a = 23;
uint8_t b = 46;
//multiply a * b using ASM code


Now how to use the above assembly code for that, I couldn't figure out.

Any help will be appreciated very much. Thanks in advance!


Joined Oct 2, 2009
Atmel AVR has a MUL instruction.
You can multiply the contents of any two registers (8 bit each). The result is left in R1,R0.

You can add inline asm code, e.g.

asm ("mul R4,R5");

although it would be better to create a multiply function in asm and then call it from C.