Page 279 - Programming Microcontrollers in C
P. 279

264    Chapter 5  Programming Large 8-Bit Systems

                   #include “hc11e9.h”


                   WORD count(WORD RPM)
                   {
                       return 30000000lu/RPM;
                   }
                              The compiled version of this program is

                   1 ; Compilateur C pour MC68HC11 (COSMIC-France)
                   2          .include”macro.h11"
                   3      .list +
                   4      .psect _text
                   5 ; 1 #include “hc11e9.h”
                   6      .psect  _data
                   7 _Register_Set:
                   8 0000 1000           .word 4096
                   9;2
                   10 ; 3 WORD count(WORD RPM)
                   11 ; 4 {
                   12         .psect  _text
                   13     _count:
                   14 0000 BD0000               jsr  c_kents
                   15 0003 08  .byte 8
                   16         .set OFST=8
                   17 ; 5  return  120000000lu/RPM;
                   18 0004 EC08          ldd OFST+0,x
                   19 0006 6F02          clr 2,x
                   20 0008 6F03          clr 3,x
                   21 000A ED06          std OFST-2,x
                   22 000C EC02          ldd 2,x
                   23 000E ED04          std OFST-4,x
                   24 0010 CC0727          ldd         #1831
                   25 0013 ED02          std 2,x
                   26 0015 EC00          ldd 0,x
                   27 0017 C3FFFB               addd #-5
                   28 001A 188F          xgdy
                   29 001C CC0E00               ldd  #3584
                   30 001F BD0000               jsr  c_ludv
   274   275   276   277   278   279   280   281   282   283   284