; export symbols
            XDEF Entry        ; export 'Entry' symbol
            ABSENTRY Entry    ; for absolute assembly: mark this as application entry point

; include derivative specific macros
            INCLUDE 'mc9s12c32.inc'

; variable/data section
            ORG RAMStart
; Insert here your data definition. For demonstration, temp_byte is used.
temp_byte   ds.b 1

; code section
            ORG ROMStart
Entry:
           LDAA #4
           LDAB #6
           MUL		  ;D = A*B = 24
           LDX #10
           IDIV     ;D = Rmdr(D/X) = 4
                    ;X = D/X = 2    ;
           		      ;Note dividing by 10
           		      ;breaks an 8-bit binary
           		      ;number up into its two 
           		      ;decimal digits!
           LDD #4
           LDX #10
           FDIV     ;X extracts first 16 bits
									  ;of FRACTIONAL part of D/X
		                ;Note 4/10 = %010.0110011001100110......
                    ;(0.4 = 1/4+1/8+1/64+1/128 = 0.3987)
									  ;Result of FDIV is X = 0110011001100110
					 LDD #$FFFF
					 LDY #4
					 EMUL     ;Y*D-> Y:D	 (unsigned numbers)
					          ;65535*4 = 262140 =>Y = $3, D = $FFFC
					 LDD #$FFFF
					 LDY #4
					 EMULS    ;Y*D -> Y:D (signed numbers)
					          ;-1 * 4 = -4 => Y = $FFFF, D = $FFFC
done:      BRA done         
;**************************************************************
;*                 Interrupt Vectors                          *
;**************************************************************
  ORG $FFFE

  fdb     Entry      ; Reset