Table of Contents

Mixing C and Assembly Languages

Syntax Differences with GCC

Common Code in .s Files

Every .s file should contain the following GCC directives:

#define _SFR_ASM_COMPAT 1  /* Not sure when/if this is needed */
#define __SFR_OFFSET 0

C Compiler's Register Usage

Passing Parameters between C and Assembly

uint8_t function(uint8_t i, uint8_t j);

Example Code

Consider the following function prototype:

void function(uint8_t);
     lds   r24, value
     call  function