S
S
synapse_people2018-07-30 13:46:01
Atmel AVR
synapse_people, 2018-07-30 13:46:01

What is the size of an int in an 8-bit AVR processor?

Perhaps the question has already been asked ... but this moment annoys me ..
There is an 8-bit atmega 164 processor, its registers are 8-bit, memory addressing is 16 ..
Will it be possible to write C code for it, in which to use 32-bit integer or not? those. wouldn't it be necessary to store them as 2 by 16 bits?

Answer the question

In order to leave comments, you need to log in

2 answer(s)
N
n12eq3, 2018-07-30
@synapse_people

in C, the compiler itself breaks after declaring a variable. physically there will be 4 bytes.

F
Forget, 2018-09-04
@Forget

You can also use int32_t, it will take 4 bytes on any platform. The description for stdint.h has more details about such types.

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question