343 lines
6.2 KiB
NASM
Executable File
343 lines
6.2 KiB
NASM
Executable File
;--------------------------------------------------------
|
|
; File Created by SDCC : free open source ISO C Compiler
|
|
; Version 4.5.0 #15242 (Linux)
|
|
;--------------------------------------------------------
|
|
; PIC16 port for the Microchip 16-bit core micros
|
|
;--------------------------------------------------------
|
|
list p=18f4550
|
|
radix dec
|
|
CONFIG XINST=OFF
|
|
CONFIG FOSC=HS
|
|
CONFIG WDT=OFF
|
|
CONFIG LVP=OFF
|
|
|
|
|
|
;--------------------------------------------------------
|
|
; public variables in this module
|
|
;--------------------------------------------------------
|
|
global _sram_end
|
|
global _main
|
|
|
|
;--------------------------------------------------------
|
|
; extern variables in this module
|
|
;--------------------------------------------------------
|
|
extern _SPPCFGbits
|
|
extern _SPPEPSbits
|
|
extern _SPPCONbits
|
|
extern _UFRMLbits
|
|
extern _UFRMHbits
|
|
extern _UIRbits
|
|
extern _UIEbits
|
|
extern _UEIRbits
|
|
extern _UEIEbits
|
|
extern _USTATbits
|
|
extern _UCONbits
|
|
extern _UADDRbits
|
|
extern _UCFGbits
|
|
extern _UEP0bits
|
|
extern _UEP1bits
|
|
extern _UEP2bits
|
|
extern _UEP3bits
|
|
extern _UEP4bits
|
|
extern _UEP5bits
|
|
extern _UEP6bits
|
|
extern _UEP7bits
|
|
extern _UEP8bits
|
|
extern _UEP9bits
|
|
extern _UEP10bits
|
|
extern _UEP11bits
|
|
extern _UEP12bits
|
|
extern _UEP13bits
|
|
extern _UEP14bits
|
|
extern _UEP15bits
|
|
extern _PORTAbits
|
|
extern _PORTBbits
|
|
extern _PORTCbits
|
|
extern _PORTDbits
|
|
extern _PORTEbits
|
|
extern _LATAbits
|
|
extern _LATBbits
|
|
extern _LATCbits
|
|
extern _LATDbits
|
|
extern _LATEbits
|
|
extern _DDRAbits
|
|
extern _TRISAbits
|
|
extern _DDRBbits
|
|
extern _TRISBbits
|
|
extern _DDRCbits
|
|
extern _TRISCbits
|
|
extern _DDRDbits
|
|
extern _TRISDbits
|
|
extern _DDREbits
|
|
extern _TRISEbits
|
|
extern _OSCTUNEbits
|
|
extern _PIE1bits
|
|
extern _PIR1bits
|
|
extern _IPR1bits
|
|
extern _PIE2bits
|
|
extern _PIR2bits
|
|
extern _IPR2bits
|
|
extern _EECON1bits
|
|
extern _RCSTAbits
|
|
extern _TXSTAbits
|
|
extern _T3CONbits
|
|
extern _CMCONbits
|
|
extern _CVRCONbits
|
|
extern _CCP1ASbits
|
|
extern _ECCP1ASbits
|
|
extern _CCP1DELbits
|
|
extern _ECCP1DELbits
|
|
extern _BAUDCONbits
|
|
extern _BAUDCTLbits
|
|
extern _CCP2CONbits
|
|
extern _CCP1CONbits
|
|
extern _ECCP1CONbits
|
|
extern _ADCON2bits
|
|
extern _ADCON1bits
|
|
extern _ADCON0bits
|
|
extern _SSPCON2bits
|
|
extern _SSPCON1bits
|
|
extern _SSPSTATbits
|
|
extern _T2CONbits
|
|
extern _T1CONbits
|
|
extern _RCONbits
|
|
extern _WDTCONbits
|
|
extern _HLVDCONbits
|
|
extern _LVDCONbits
|
|
extern _OSCCONbits
|
|
extern _T0CONbits
|
|
extern _STATUSbits
|
|
extern _INTCON3bits
|
|
extern _INTCON2bits
|
|
extern _INTCONbits
|
|
extern _STKPTRbits
|
|
extern _SPPDATA
|
|
extern _SPPCFG
|
|
extern _SPPEPS
|
|
extern _SPPCON
|
|
extern _UFRM
|
|
extern _UFRML
|
|
extern _UFRMH
|
|
extern _UIR
|
|
extern _UIE
|
|
extern _UEIR
|
|
extern _UEIE
|
|
extern _USTAT
|
|
extern _UCON
|
|
extern _UADDR
|
|
extern _UCFG
|
|
extern _UEP0
|
|
extern _UEP1
|
|
extern _UEP2
|
|
extern _UEP3
|
|
extern _UEP4
|
|
extern _UEP5
|
|
extern _UEP6
|
|
extern _UEP7
|
|
extern _UEP8
|
|
extern _UEP9
|
|
extern _UEP10
|
|
extern _UEP11
|
|
extern _UEP12
|
|
extern _UEP13
|
|
extern _UEP14
|
|
extern _UEP15
|
|
extern _PORTA
|
|
extern _PORTB
|
|
extern _PORTC
|
|
extern _PORTD
|
|
extern _PORTE
|
|
extern _LATA
|
|
extern _LATB
|
|
extern _LATC
|
|
extern _LATD
|
|
extern _LATE
|
|
extern _DDRA
|
|
extern _TRISA
|
|
extern _DDRB
|
|
extern _TRISB
|
|
extern _DDRC
|
|
extern _TRISC
|
|
extern _DDRD
|
|
extern _TRISD
|
|
extern _DDRE
|
|
extern _TRISE
|
|
extern _OSCTUNE
|
|
extern _PIE1
|
|
extern _PIR1
|
|
extern _IPR1
|
|
extern _PIE2
|
|
extern _PIR2
|
|
extern _IPR2
|
|
extern _EECON1
|
|
extern _EECON2
|
|
extern _EEDATA
|
|
extern _EEADR
|
|
extern _RCSTA
|
|
extern _TXSTA
|
|
extern _TXREG
|
|
extern _RCREG
|
|
extern _SPBRG
|
|
extern _SPBRGH
|
|
extern _T3CON
|
|
extern _TMR3
|
|
extern _TMR3L
|
|
extern _TMR3H
|
|
extern _CMCON
|
|
extern _CVRCON
|
|
extern _CCP1AS
|
|
extern _ECCP1AS
|
|
extern _CCP1DEL
|
|
extern _ECCP1DEL
|
|
extern _BAUDCON
|
|
extern _BAUDCTL
|
|
extern _CCP2CON
|
|
extern _CCPR2
|
|
extern _CCPR2L
|
|
extern _CCPR2H
|
|
extern _CCP1CON
|
|
extern _ECCP1CON
|
|
extern _CCPR1
|
|
extern _CCPR1L
|
|
extern _CCPR1H
|
|
extern _ADCON2
|
|
extern _ADCON1
|
|
extern _ADCON0
|
|
extern _ADRES
|
|
extern _ADRESL
|
|
extern _ADRESH
|
|
extern _SSPCON2
|
|
extern _SSPCON1
|
|
extern _SSPSTAT
|
|
extern _SSPADD
|
|
extern _SSPBUF
|
|
extern _T2CON
|
|
extern _PR2
|
|
extern _TMR2
|
|
extern _T1CON
|
|
extern _TMR1
|
|
extern _TMR1L
|
|
extern _TMR1H
|
|
extern _RCON
|
|
extern _WDTCON
|
|
extern _HLVDCON
|
|
extern _LVDCON
|
|
extern _OSCCON
|
|
extern _T0CON
|
|
extern _TMR0
|
|
extern _TMR0L
|
|
extern _TMR0H
|
|
extern _STATUS
|
|
extern _FSR2L
|
|
extern _FSR2H
|
|
extern _PLUSW2
|
|
extern _PREINC2
|
|
extern _POSTDEC2
|
|
extern _POSTINC2
|
|
extern _INDF2
|
|
extern _BSR
|
|
extern _FSR1L
|
|
extern _FSR1H
|
|
extern _PLUSW1
|
|
extern _PREINC1
|
|
extern _POSTDEC1
|
|
extern _POSTINC1
|
|
extern _INDF1
|
|
extern _WREG
|
|
extern _FSR0L
|
|
extern _FSR0H
|
|
extern _PLUSW0
|
|
extern _PREINC0
|
|
extern _POSTDEC0
|
|
extern _POSTINC0
|
|
extern _INDF0
|
|
extern _INTCON3
|
|
extern _INTCON2
|
|
extern _INTCON
|
|
extern _PROD
|
|
extern _PRODL
|
|
extern _PRODH
|
|
extern _TABLAT
|
|
extern _TBLPTR
|
|
extern _TBLPTRL
|
|
extern _TBLPTRH
|
|
extern _TBLPTRU
|
|
extern _PC
|
|
extern _PCL
|
|
extern _PCLATH
|
|
extern _PCLATU
|
|
extern _STKPTR
|
|
extern _TOS
|
|
extern _TOSL
|
|
extern _TOSH
|
|
extern _TOSU
|
|
extern _delay1ktcy
|
|
|
|
;--------------------------------------------------------
|
|
; Equates to used internal registers
|
|
;--------------------------------------------------------
|
|
STATUS equ 0xfd8
|
|
WREG equ 0xfe8
|
|
PRODH equ 0xff4
|
|
|
|
|
|
; Internal registers
|
|
.registers udata_ovr 0x0000
|
|
r0x00 res 1
|
|
|
|
|
|
ustat_main_00 udata 0X07FF
|
|
_sram_end res 0
|
|
|
|
;--------------------------------------------------------
|
|
; interrupt vector
|
|
;--------------------------------------------------------
|
|
|
|
;--------------------------------------------------------
|
|
; global & static initialisations
|
|
;--------------------------------------------------------
|
|
; I code from now on!
|
|
; ; Starting pCode block
|
|
S_main__main code
|
|
_main:
|
|
; .line 16; main.c LED_TRIS = 0; // Pin as output
|
|
BCF _TRISDbits, 1
|
|
; .line 17; main.c LED_LAT = 0; // LED off
|
|
BCF _LATDbits, 1
|
|
_00106_DS_:
|
|
; .line 20; main.c LED_LAT = !LED_LAT; // Toggle LED
|
|
CLRF r0x00
|
|
BTFSC _LATDbits, 1
|
|
INCF r0x00, F
|
|
MOVF r0x00, W
|
|
BSF STATUS, 0
|
|
TSTFSZ WREG
|
|
BCF STATUS, 0
|
|
CLRF r0x00
|
|
RLCF r0x00, F
|
|
MOVF r0x00, W
|
|
ANDLW 0x01
|
|
RLNCF WREG, W
|
|
MOVWF PRODH
|
|
MOVF _LATDbits, W
|
|
ANDLW 0xfd
|
|
IORWF PRODH, W
|
|
MOVWF _LATDbits
|
|
; .line 21; main.c delay1ktcy(500); // 500ms @ 1MHz
|
|
MOVLW 0xf4
|
|
CALL _delay1ktcy
|
|
BRA _00106_DS_
|
|
; .line 23; main.c }
|
|
RETURN
|
|
|
|
|
|
|
|
; Statistics:
|
|
; code size: 48 (0x0030) bytes ( 0.04%)
|
|
; 24 (0x0018) words
|
|
; udata size: 0 (0x0000) bytes ( 0.00%)
|
|
; access size: 1 (0x0001) bytes
|
|
|
|
|
|
end
|