How to convert int8 to int16 in avr

296 views Asked by At

In my computer science class, we just started working in AVR this week. I am having trouble with the bit manipulation required to convert an 8-bit int to a 16-bit int. For context, I am running the program off an arduino.

This is what I have so far:

.global int8ToInt
int8ToInt:
sbrc r24,7
ldi r25,127
cp r25,r24
sbi r25,r25
ret

This is just what I have from looking a bit at docs and similar problems on this website, but I do not know where to go from here, or even if this is quite right. Any help would be greatly appreciated!

0

There are 0 answers