General Notes On Developing in Assembly For the 68HCS12

Addressing Modes

Before getting too involved in trying to develop in assembly or for the HCS12 it might be a good idea to review addressing methods.

General Terms and Definitions (may contain commands)

  • RMB: Reserve Multiple Bytes
  • COP: Computer Operating Properly
    • 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.

  • :
  • :
  • :

Good Techniques and Style

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!

  1. ****************************************************************
  2. * Be a courteous programmer, be kind by restoring values before returning *
  3. ****************************************************************
  4. PSHX
  5. PSHY
  6.  
  7. PULY
  8. PULX
  9. RTS

Comments

Post new comment

The content of this field is kept private and will not be shown publicly.
  • Web page addresses and e-mail addresses turn into links automatically.
  • Allowed HTML tags: <a> <em> <strong> <cite> <code> <ul> <ol> <li> <dl> <dt> <dd>
  • Lines and paragraphs break automatically.

More information about formatting options

CAPTCHA
Either you're a spam bot or your not, now prove it!
Image CAPTCHA
Enter the characters shown in the image without spaces.