Differences

This shows you the differences between two versions of the page.

Link to this comparison view

Both sides previous revisionPrevious revision
Next revision
Previous revision
en:multiasm:piot:chapter_4_7 [2024/09/27 23:56] pczekalskien:multiasm:piot:chapter_4_7 [2026/03/01 19:57] (current) ktokarz
Line 1: Line 1:
 ====== Instruction Set ====== ====== Instruction Set ======
 +
 +The assembler instruction set includes arithmetic, logical, control, and input/output operations. Arithmetic instructions include addition, subtraction, multiplication, and division. Logical instructions include operations such as AND, OR, XOR, and NOT. Control instructions include jumps, loops, and conditions. Input/output instructions include operations on ports and registers. Understanding the instruction set is crucial for effective programming in assembler. This course will discuss the most commonly used instructions and their application in assembly code. Practical examples will show how to use instructions in AVR programming. The instruction set allows full control over the processor and its functions.
 +
 +=====Basic instructions=====
 +
 +<table tab_avr_dt>
 +<caption>Data Transfer Instructions</caption>
 +^  Data Transfer                        ||
 +|  ldi            |  load immediate      |
 +|  mov            |  copy register       |
 +|  movw            copy register pair  |
 +</table>
 +
 +<table tab_avr_li>
 +<caption>Logical Instructions</caption>
 +^  Logical Instructions                                ||
 +|  and                    logical AND                 |
 +|  andi                  |  logical AND with immediate  |
 +|  or                    |  logical OR                  |
 +|  ori                    logical OR with immediate   |
 +|  eor                    exclusive OR                |
 +|  com                    one's complement            |
 +|  neg                    two's complement            |
 +</table>
 +
 +<table tab_avr_ai>
 +<caption>Arithmetic Instructions</caption>
 +^  Arithmetic Instructions  ^^
 +|add  |  add without carry|
 +|adc  |  add with carry|
 +|adiw  |  add immediate to word|
 +|sub  |  subtract without carry|
 +|subi  |  subtract immediate|
 +|sbc  |  subtract with carry|
 +|sbci  |  subtract immediate with carry|
 +|sbiw  |  subtract immediate from word|
 +|inc  |  increment|
 +|dec  |  decrement|
 +|mul  |  multiply unsigned//(1)//|
 +|muls  |  multiply signed//(1)//|
 +|mulsu  |  multiply signed with unsigned//(1)//|
 +|fmul  |  fractional multiply unsigned//(1)//|
 +|fmuls  |  fractional multiply signed//(1)//|
 +|fmulsu  |  fractional multiply signed with unsigned//(1)//|
 +//(1) Not all processors support commands//
 +</table>
 +
 +<table tab_avr_bs>
 +<caption>Bit Shift Instructions</caption>
 +^  Bit Shifts  ^^ 
 +|lsl  |  logical shift left|
 +|lsr  |  logical shift Right|
 +|rol  |  rotate left through carry|
 +|ror  |  rotate right through carry|
 +|asr  |  arithmetic shift right|
 +</table>
 +
 +<table tab_avr_bm>
 +<caption>Bit Manipulation Instructions</caption>
 +^   Bit Manipulation  ^^ 
 +|sbr  |  set bit(s) in register|
 +|cbr  |  clear bit(s) in register|
 +|ser  |  set register|
 +|clr  |  clear register|
 +|swap  |  swap nibbles|
 +</table>
en/multiasm/piot/chapter_4_7.1727470570.txt.gz · Last modified: by pczekalski
CC Attribution-Share Alike 4.0 International
www.chimeric.de Valid CSS Driven by DokuWiki do yourself a favour and use a real browser - get firefox!! Recent changes RSS feed Valid XHTML 1.0