;******************************************************* ; Example of using "AsmTidy" to tidy-up some untidy code ; This is not a 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