Hey Everyone,
I've just started learning assembly and have, of course, encountered some problems. I believe the code isn't really a problem, but rather the adequate directories in my build options? Although I'm not sure what settings are necessary in order to vindicate a successful build.
The PIC I'm using is irrelevant at this point, as I am just trying to get a successful build in sequence. Does anybody know what's wrong?
I would appreciate your assistance!
Thanks,
Austin
I've just started learning assembly and have, of course, encountered some problems. I believe the code isn't really a problem, but rather the adequate directories in my build options? Although I'm not sure what settings are necessary in order to vindicate a successful build.
Rich (BB code):
;**************************************************
; Author: Austin Schaller
; Program: Blinking_LED_ASM.ASM
; Date January 8th, 2011
;**************************************************
LIST p=16F648A ; Define Processor
#include <p16F648a.inc>
CONFIG _CP_OFF & _DATA_CP_OFF & _LVP_OFF & _BOREN_OFF & _MCLRE_OFF & _WDT_OFF & _PWRTE_OFF & _INTOSC_OSC_NOCLKOUT
RADIX DEC ; Define RADIX as a decimal unless otherwise noted
ERRORLEVEL -302 ; Supress bank switching messages
;Define RAM Location
CBLOCK 0x20
Delay1
Delay2
Delay3
ENDC
ORG 0
START
BANKSEL TRISA
MOVLW 0xFF ; Arrange PORTA bit 0 as output
MOVWF TRISA
MOVLW 0xFF ; Arrange PORTB as output
MOVWF TRISB
MOVLW 0x07 ; Disable comparator
MOVWF CMCON
BLINK
BANKSEL PCON ; Switch to bank 1
BSF PCON, 3 ; Set internal oscillator to 4MHz
BANKSEL PORTA
BSF PORTA, 1 ; Turn on output to LED
CALL Delay_1s ; Wait
BCF PORTA, 1 ; Turn off output to LED
CALL Delay_1s ; Wait
GOTO BLINK
; Subroutines
Delay_1s
MOVLW 255 ; This is 1 second
MOVWF Delay1
MOVWF Delay2
MOVLW 0x05
MOVWF Delay3
Wait
DECFSZ Delay, F
GOTO Wait
DECFSZ Delay2, F
GOTO Wait
DECFSZ Delay3, F
RETURN
END
I would appreciate your assistance!
Thanks,
Austin