Table of Contents        Previous topic       Next topic       

C COMPILER->In Line Assembler Code->Accessing Local Variables and Function Parameters->Non-Reentrant Functions Mini and Tiny Memory Models

Non-Reentrant Functions, Mini and Tiny Memory Models

The local variables and function parameters are in data and can be accessed by R0 or R1 as for the small memory model but they can also be accessed directly. _bit variables are located in bit addressable data space.

void func(unsigned char Var1, unsigned char Var2)
    _bit BitVar;
    unsigned char Var3, Var4;
    _asm(     mov a,{Var1});
    _asm(     mov a,{Var2});
    _asm(     mov a,{Var3});
    _asm(     mov a,{Var4});
    _asm(    mov c,{BitVar});

compiles to:

    mov a,__frame_func-1
    mov a,__frame_func-2
    mov a,__frame_func
    mov a,__frame_func+1
    mov c,__bit_frame_func

;   Function 'func' Internal Objects
;   unsigned char _data Var1       __frame_func-1
;   unsigned char _data Var2       __frame_func-2
;   _bit BitVar                              __bit__frame_func+0
;   unsigned char _data Var3       __frame_func+0
;   unsigned char _data Var4       __frame_func+1