Before getting too involved in trying to develop in assembly or for the HCS12 it might be a good idea to review addressing methods.
When enabled, your program must write a particular sequence of code to a specific address in order to keep the watch dog timer from timing out. This is used to help detect errors and when properly configured will allow the system to perform a reset in an attempt to rectify the issue.
When using BSET we can selectively set bits instead of writing to all 8-bits or however many bits there are in the register. This prevents inadvertent changes to the register.
Be kind to other sub routines when manipulating the stack, first pull the values from the stack and restore those values before returning to sub routine!
**************************************************************** * Be a courteous programmer, be kind by restoring values before returning * **************************************************************** PSHX PSHY PULY PULX RTS
Comments
Post new comment