-
Recent Posts
Recent Comments
Archives
- May 2022
- December 2021
- September 2021
- July 2021
- May 2021
- April 2021
- October 2019
- August 2019
- April 2019
- February 2019
- January 2019
- May 2018
- January 2018
- November 2017
- May 2017
- January 2017
- December 2016
- November 2016
- May 2016
- April 2016
- March 2016
- February 2016
- January 2016
- December 2015
- November 2015
- October 2015
- September 2015
- August 2015
- July 2015
- June 2015
- April 2015
- March 2015
- February 2015
- January 2015
- December 2014
- July 2014
- June 2014
- May 2014
- April 2014
- November 2013
- October 2013
- September 2013
- July 2013
- June 2013
- May 2013
- April 2013
- March 2013
- February 2013
- December 2012
- November 2012
- October 2012
- August 2012
- June 2012
- May 2012
- April 2012
- March 2012
- February 2012
Categories
Meta
Monthly Archives: March 2016
Arduino Inline Assembly Tutorial (Tables)
Often, the fastest way to compute something on an arduino is to not compute it all. Huh? For example, trigonometric functions are costly operations and can abruptly slow your application to the pace of a crawl. And many times, the … Continue reading
Arduino Inline Assembly Tutorial (Strings)
Addressing Modes When loading and storing data, there are several addressing methods available for use. The arduino’s AVR microcontroller supports 13 address modes for accessing the Program memory (Flash) and Data memory (SRAM, Register file, I/O Memory, and Extended I/O … Continue reading
Arduino Inline Assembly Tutorial (Branching)
Loop and Branch Branching is a fundamental feature of computers. For example, branching allows a computer to repeat instruction sequences. One of the most basic forms of repetition is a “loop”, and the loop is probably the most widely used … Continue reading
Towards a More General digitalRead
The arduino digitalRead function is a nice bit of code. However, it takes more than a cursory glance to determine exactly how it performs (see Yak Shaving). It also compiles into approximately 222 bytes of code, and its slow in … Continue reading
Posted in Uncategorized
Tagged arduino, asm, assembler, assembly, avr, digitlaRead, inline
Leave a comment
Arduino Inline Assembly Tutorial (Math)
Increment, Decrement, Add and Subtract INC is a mnemonic for INCrement. INC adds one to the contents of the register placing the result back into the register. The C flag in the Status Register (SREG) is not affected by the … Continue reading
Arduino Inline Assembly Tutorial (Bit Shifts)
Introduction In this tutorial we continue our examination of bit operations. Specifically we discuss left and right shifts. We’ll end this tutorial with an assortment of short C language MACRO code segments that demonstrate checking bits. Shift to Multiply The … Continue reading
Arduino Inline Assembly Tutorial (Bit Ops)
Introduction Bit operations are the foundation upon which all microcontroller programming builds. A good understanding of bit functions is essential for efficient arduino programming in general, and specifically for inline assembly programming. Its that simple. It really is simple too. … Continue reading
Arduino µC Status Register (SREG)
Like all microcontrollers the arduino’s AVR µC has a flag register to indicate various conditions. The Status Register is referred to in short as the “SREG”, and can be directly referenced inline using __SREG__. It is an 8-bit wide register, … Continue reading
Arduino Inline Assembly Tutorial (Ports & Pins)
Mapping Memory The 3 basic types of memory in the arduino were discussed in tutorial #1. Again, here we are interested in SRAM data memory, which the arduino uses as memory-mapped IO. MMIO means that a part of the SRAM … Continue reading
Arduino Inline Assembly Tutorial #4 (Constraints)
Introduction I have a confession to make. My previous examples were not very efficient assembly code. That might seem like an odd comment, especially since my typical example used just 2-4 lines of code. But, these examples were coded as … Continue reading