문제

Serious help needed here. I love programming. I've been reading bunch of books(such as K&R) and articles/forums online for C language lately. Even tried looking into Linux code(although, i was lost where to start but peeking into small libraries helped?).

I started as a Java programmer and in Java it's pretty cut and dry; If programs gets too big, slice it in classes then further into functions. Guidelines like, keep the code readable and add comments. Use information hiding and OOP techniques. Some of which still applies for C.

I've been coding in C now and so far i get programs to work one way or the other. A lot of people talk about performance/efficiency, algorithm/design, optimization, and maintainability. Some people stress one more then the other but for non-professional software engineers you often hear something like e.g: Linux kernel dev won't just take any code.

My question is this: I plan on writing a code for 8-bit microcontroller without wasting any resources. Know that i'm coming from java background so things are not the same anymore... resources/books/links/tips will be much appreciated. Performance and size now matters. Resources/Tricks on efficient(within best practices) C code for 8-bit micro-controllers?

Also, inline assembly plays a vital role as well sticking close to micro-controllers standard. But are there general rule of thumb to efficiency that applies to all?

For example: register unsigned int variable_name; is preferred over char anytime. Or using uint8_t if you don't need big numbers.

EDIT: Thank you so much for all the answers and suggestions. I appreciate everyone's effort for sharing knowledge.

올바른 솔루션이 없습니다

라이센스 : CC-BY-SA ~와 함께 속성
제휴하지 않습니다 softwareengineering.stackexchange
scroll top