;******************************************************* ; Example of using "AsmTidy" to tidy-up some untidy code ; This is not an actual working program! ;******************************************************* ; LIST P=18F1320 ;directive to define processor #include ;processor specific variable definitions errorlevel -302 ; suppress message 302 from list file __CONFIG _CP_OFF & _WDT_OFF & _MCLRE_OFF & _PWRTE_ON & _INTRC_OSC_NOCLKOUT ; ;start of variables definitions ; Flag equ 0x12 ;general purpose flag reg TEMPA equ 0x22 ; tempa reg TEMPB equ 0x23 ;tempb reg COUNT equ 0x24 CBLOCK 0x080 ;test WREG_TEMP ;variable used for context saving STATUS_TEMP ;COMMENT THAT WAS IN UPPER CASE BSR_TEMP ;variable used for context saving ENDC ;end of variables STARTUP org 0x00 goto MAIN ;Reset Vector address clrf PORTB ;Clear PORTB clrf TRISB ; PORTB all outputs movlw B'01000001' ;LOAD A BYTE Main: bcf INTCON,TMR0IF Wait goto wait ; this program does not work andlw 0x0f ;Mask off lower 4 bits movwf PORTB ;write to PORTB goto Wait ;GOTO loop END ;end of program