Anyone has any insight into how pic deals with storage of registers when entering a subroutine? There doesn't seem to be a designated stack pointer. Maybe use indirect addressing, and use the SFR as a stack pointer? Things would really get ugly when you have nested subroutines if we don't have a stack
Tags:
actually, there probably is a stack, where the pic puts the return address when a subroutine is called, just no idea where it is
Storage of registers inst a problem. Theres only really one register (which is the working register) everything else is RAM/data memory. There probably is a stack for return addresses. No idea where that's located though
yea so I've ask this question below, how do we make a temp. variable that can store things?
use res to reserve 1 byte of memory, that's what would do
test 0x70
udata_shr
test res 1
and then when I want to store something in W into test:
movewf test
is this correct?
I don't know what test 0x70 does, I think udata_shr automatically puts the register at the shared address located at the bottom of every bank. but yeah, movwf moves w into test
© 2024 Created by PML. Powered by