;
;
; ===========================================================
;
;     C32_Hel.asm:       CML-12C32 Flash Hello 
;                        Axm-0324           
;         Version:       1.0   Released 5/24/2004
;          Author:       Gary Karnes , Axiom Manufacturing
;        Compiler:       Asm12
;
; ===================================================+=======
;
;
RamStart:    equ    $0800         ;first RAM location
RamLast:     equ    $0FFF         ;last RAM location 

SCIBDH:      equ    $00C8         ; baud high
SCIBDL:      equ    $00C9         ; baud low
SCICR1:      equ    $00CA         ; Control reg 1
SCICR2:      equ    $00CB         ; Control reg 2
SCISR1:      equ    $00CC         ; Status Register
SCIDRL:      equ    $00CF         ; Data Register

Baud9600:    equ    $34           ; value for 9600 baud
;************************************************************
;* Start of code 
;************************************************************
             org    $8000      ;beginning of protected flash

Hello_Demo:  
             


;*************************************************************
;  Fomal start of Monitor code
;*************************************************************
Monitor:
;
; Set stack pointer to last (highest) RAM location
;
;             lds    #RamLast+1    ;point one past RAM
             jsr    ONSCI0     ; Initilize Com port
;
; set baud rate to 115.2 kbaud and turn on Rx and Tx
;
;            movb  #baud115200,SCI0BDL  ;..BDH=0 so baud = 115.2 K
;            movb  #initSCI0CR2,SCI0CR2 ;Rx and Tx on
                                  ;(SP will dec before store)
;
; Setup LEDS Drivers
;              bclr  PTS,#$0c
;              bset  DDRS,#$0c
;
; Send a warm start prompt and wait for new commands
;
             ldaa   #$0d          ; car return
             jsr    Output        ;send error code (1st prompt char)
             ldaa   #$0a          ; car return
             jsr    Output        ;send error code (1st prompt char)
             ldaa   #'H'          ; Hello
             jsr    Output        ;
             ldaa   #'e'          ; 
             jsr    Output        ;
             ldaa   #'l'          ; 
             jsr    Output        ;
             ldaa   #'l'          ; 
             jsr    Output        ;
             ldaa   #'o'          ; 
             jsr    Output        ;

Stop:        bra    Stop
;
**********
*   OUTPUT() - Output character in A.
* chrcnt indicates the current column on the
*output display.  It is incremented every time
*a character is outputted, and cleared whenever
*the subroutine outcrlf is called.
**********

Output:
        TST     SCISR1          ; read status
        BPL     Output         ; loop until tdre=1
        STAA    SCIDRL          ; send character
        RTS                     
;
**********
*   ONSCI() - Initialize the SCI for 9600
*                 baud at 16 MHz Extal.
**********

ONSCI0:
        ldaa    #Baud9600      ; set baud rate
        staa    SCIBDL         ; BAUD register
        ldaa    #$0c           ; transmit and receive on
        staa    SCICR2         ;
        rts                    ;






;
;
