Inline ASM - Advanced AVR 3.0 Core - Finalizing

Channel:
Subscribers:
580
Published on ● Video Link: https://www.youtube.com/watch?v=A00sveU1JoQ



Duration: 2:20
9 views
0


Inline ASM - Advanced AVR 3.0 Core - Finalizing

Just formatting the code into the page took 6 minutes....If Juno Inline ASM 2.0 is a knife, it's more than sharp enough to cut through steel. It has 15 completely rewritten examples demonstrating almost every aspect of inline asm in c. Yet a knife is useless regardless how sharp it is on a clumsy hand. Instruction is not included in this knife. Even though it's dumb to ask for instruction for a knife, it's not an unreasonable request. One can't really use inline asm in c, unless one is efficient in asm already. A knife is all about cutting, although no one is stopping you from using it as self-defence or mortal combat again your wife. asm in c is about about moving data that normally can't be accessed by c. It would be dumb to use it as self-defence again your wife or any other reason.

PS. Not that I am an expert in mortal kombat or anything, if you feel like your life is threaten, call 911 and run. Domestic violence should not be tolerated in any way, unless your wife is very fat (very rich) and is the owner of an expensive spot car (hard to run away from or out-run).

===================================================
Here is the explanation text for this example shown in the video:
lds and sts instructions requiring a constant input address don't work unless its address is known, so using indirect addressing is probably the only way to address the sRAM via inline asm, so ld and st are the instructions of choice.

This function returns a value, and this is the only example that returns a value because there are better ways to return a value without using return, including this one. The returned value has actually been returned back to sram prior it being returned upon exiting the function, since this function takes a pointer as input.

It may not be obvious, but temp or r24 has been returned to the main function. Defining a local variable for the return is one of the easiest ways. The registers inside the clobber list definitely can't be return, since its values are destroyed upon exiting the function. Likewise, input should not be returned, since by definition, input value are read-only, so the function by definition should not be changing its values, so returning a variable that is read-only and not modified doesn't make any sense.




Other Videos By Flyandance


2023-03-19Bootloader self-program - AVR109 speed test avrdude - Advanced AVR 3.0 Core - 1Mbps with 8MHz CPU
2023-03-18Bootloader self-program - AVR109 w/ AVROSP and avrdude - Advanced AVR 3.0 Core
2023-03-17SPM 3.0 writes to self - Advanced AVR 3.0 Core Bootloader
2023-03-16SPM 2.0 writes to self - Advanced AVR 3.0 Core Bootloader
2023-03-14You jump, ijmp - Inline asm Indirect Jump - Advanced AVR 3.0 Core Bootloader
2023-03-05yt-dlp - A ultimate guide (The result of 2 weeks of hard work)
2023-03-03True bare Minimal code - Advanced AVR 3.0 Core Bootloader Pro Part 4 Size does matters getting naked
2023-02-28Bootloader-less Pro - Advanced AVR 3.0 Core - Part 3 - SPM - App Writes to App section - programmer
2023-02-27Bootloader-less Pro - Advanced AVR 3.0 Core - Part 2 - SPM erase self destruction code
2023-02-26Inline ASM - Advanced AVR 3.0 Core - LMP read from flash Load Program Memory
2023-02-25Inline ASM - Advanced AVR 3.0 Core - Finalizing
2023-02-22Inline ASM - Advanced AVR 3.0 Core
2023-02-19Bootloader-less Pro - Advanced AVR 3.0 Core - Part 1 - GCC Sections functions attribute
2023-02-17Script cowboy - the power of one line of code
2023-02-15Bootloader Pro - Advanced AVR 3.0 Core - AVR-C 2.0 sucks BBC
2023-02-11Juno ABC - Advanced Button Core 4.0 - Sleep mode ultra low power
2023-02-07My Coffee ritual 2.0 - Simple Minimalistic - Dry milk + sugar
2023-02-03Sleep mode - Advanced AVR 3.0 - Atiny13 watchdog less than 100nA - Peripheral leakage current Button
2023-02-02Definition of good soup - Chicken Turmeric
2023-02-01Sleep mode - Advanced AVR 3.0 - 32kHz Timer2 Asynchronous mode - Atmega8 low power 8-12uA
2023-01-31Sleep mode - Advanced AVR 3.0 - 1 second timer - Atmega8 low power down + watchdog + eeprom MCU