cse325_S12_set_7_C

cse325_S12_set_7_C - C Programming in Embedded Systems...

Info iconThis preview shows pages 1–6. Sign up to view the full content.

View Full Document Right Arrow Icon
7/23 C Programming in Embedded Systems Arizona State University Tempe, AZ 85287 Dr. Yann-Hang Lee yhlee@asu.edu (480) 727-7507
Background image of page 1

Info iconThis preview has intentionally blurred sections. Sign up to view the full version.

View Full DocumentRight Arrow Icon
C Programming in Embedded Systems q Assembly language v dependent of processor architecture v cache control, registers, program status, interrupt q High-level language v memory model Ø access memory-mapped IO – pointers v independent of processor architecture (partially true) q Advantages and disadvantages v performance v code size v software development and life cycle set 7 -- 2
Background image of page 2
Bit Manipulation q Boolean operation v operate on 1 (true) and 0 (false) v q Bitwise operation v operate on individual bit positions within the operands v bits |= (1 <<7) Operation Boolean op. Bitwise op. AND OR || | XOR unsupported ^ NOT ! ~ set 7 -- 3
Background image of page 3

Info iconThis preview has intentionally blurred sections. Sign up to view the full version.

View Full DocumentRight Arrow Icon
Interface C and Assembly Language q Why combine C and assembly language v performance v C doesn’t handle most architecture features, such as registers, program status, etc. q Develop C and assembly programs and then link them together v at source level – in-line assembly code in C program v at object level – procedure call mwccmcf mwasmcf mwldmcf set 7 -- 4
Background image of page 4
Calling Convention q GCC calling convention v arguments passed in registers and in stack v registers saved by caller and callee (including frame pointer and returning PC) v frame pointer points just below the last argument passed on the stack (the bottom of the frame) v stack pointer points to the first word after the frame saved registers (by callee) dynamic area local variables argument x argument y frame pointer stack pointer saved registers (by caller) set 7 -- 5
Background image of page 5

Info iconThis preview has intentionally blurred sections. Sign up to view the full version.

View Full DocumentRight Arrow Icon
Image of page 6
This is the end of the preview. Sign up to access the rest of the document.

Page1 / 16

cse325_S12_set_7_C - C Programming in Embedded Systems...

This preview shows document pages 1 - 6. Sign up to view the full document.

View Full Document Right Arrow Icon
Ask a homework question - tutors are online