0

Does anyone know what it means by the Atmega 328p has 131 instructions? And could you give an example of how any one of these 131 instructions look like? Thanks in advance!!

2

A CPU or MCU uses very basic instructions which are executed.

If you write code in a program language (like in Arduino IDE), the sketch is converted into many instructions (by the compiler and linker).

The instruction set can be found here.

An example is:

ADC Rd, Rr: Adds two registers and the contents of the C flag and places the result in the destination register Rd.

A CPU/MCU uses registers, which can be seen as very fast 'variables', mostly there are quite few of them, and all operators (like +, -, *, /) are carried out using these registers.

If you are just starting Arduino, it's not so useful to dive into this, the compiler/linker will take care of these 'details'; just be glad you don't have to write in assembly (anymore).

| improve this answer | |
  • Thanks so much for your explanation!!👍 It's very clear and just what I was looking for! – Zephyrus Xanthar Nov 19 '19 at 23:55
  • You're welcome! – Michel Keijzers Nov 20 '19 at 0:03

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.