This shows you the differences between two versions of the page.
| Both sides previous revisionPrevious revisionNext revision | Previous revision | ||
| en:multiasm:piot:chapter_4_7 [2024/09/27 23:56] – pczekalski | en: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/ | ||
| + | |||
| + | =====Basic instructions===== | ||
| + | |||
| + | <table tab_avr_dt> | ||
| + | < | ||
| + | ^ Data Transfer | ||
| + | | ldi | load immediate | ||
| + | | mov | copy register | ||
| + | | movw | ||
| + | </ | ||
| + | |||
| + | <table tab_avr_li> | ||
| + | < | ||
| + | ^ Logical Instructions | ||
| + | | and | ||
| + | | andi | logical AND with immediate | ||
| + | | or | logical OR | | ||
| + | | ori | ||
| + | | eor | ||
| + | | com | ||
| + | | neg | ||
| + | </ | ||
| + | |||
| + | <table tab_avr_ai> | ||
| + | < | ||
| + | ^ 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// | ||
| + | |muls | multiply signed// | ||
| + | |mulsu | ||
| + | |fmul | fractional multiply unsigned// | ||
| + | |fmuls | ||
| + | |fmulsu | ||
| + | //(1) Not all processors support commands// | ||
| + | </ | ||
| + | |||
| + | <table tab_avr_bs> | ||
| + | < | ||
| + | ^ 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 tab_avr_bm> | ||
| + | < | ||
| + | ^ Bit Manipulation | ||
| + | |sbr | set bit(s) in register| | ||
| + | |cbr | clear bit(s) in register| | ||
| + | |ser | set register| | ||
| + | |clr | clear register| | ||
| + | |swap | swap nibbles| | ||
| + | </ | ||