This discussion has been locked.
You can no longer post new replies to this discussion. If you have a question you can start a new discussion

shared variable slots

The feature of shared variables in C is a wonderful saver of DATA space. Can the same be implemented in assembler ?

Erik

Parents
  • One comment that Sven made about using registers as variables. In Keil, you can equate variable names with registers so that you can, within a local program segment, have meaningful names for variables stored in registers.

    testvar  equ  R5
    testvar2 equ  R6
    
    tp1:
        mov  A,testvar
        mov  B,testvar2
        add  A,B
    
        ret
    

    This is a nice feature as it makes reading the code more straitforward.

Reply
  • One comment that Sven made about using registers as variables. In Keil, you can equate variable names with registers so that you can, within a local program segment, have meaningful names for variables stored in registers.

    testvar  equ  R5
    testvar2 equ  R6
    
    tp1:
        mov  A,testvar
        mov  B,testvar2
        add  A,B
    
        ret
    

    This is a nice feature as it makes reading the code more straitforward.

Children