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

ubuntu - PHP script to find files of certain extensions in a directory, returns populated array when run in browser, but empty array when run from terminal -

php - How can i create a user dashboard -

javascript - How to detect toggling of the fullscreen-toolbar in jQuery Mobile? -