embedded - C code to manipulate AVR processor registries and stack -


is possible, using following c code, modify stack pointer, processor registers etc. in avr microcontroller (like atmega88 etc.)

#define load_sp(sph, spl) (sp = (sph<<8)|spl)  #define load_pc(pc_h, pc_l) { sp_ = sp \     *sp_ = pc_l; \     sp_ = sp_-1; \     *sp_ = pc_h; \     sp_ = sp_-1; \     sp = sp_;    \ } 

where sp_ global variable ... unsigned int *sp use these macros original preemptive scheduler, want code. mention overall program builds without errors or warnings, want ask professional advice before uploading on actual hardware.


Comments

Popular posts from this blog

python - Operations inside variables -

Generic Map Parameter java -

arrays - What causes a java.lang.ArrayIndexOutOfBoundsException and how do I prevent it? -