I'm new to the world of C and try to start walking. I have below code in assemble language and would like to compile it in C. Can someone let me know how to and/ or do it?
Thanks for all your help in advance,
T
Code:
; set processor option .......................... Processor 16F84 ; Register Label Equates.......................... PCL EQU 02 ; Program counter PORTA EQU 05 ; Port A PORTB EQU 06 ; Port B Count EQU 0C ; Counter (1-6) ; Register Bit Label Equates...................... Roll EQU 4 ; Push Button Input ; Start Program................................... ;Initialize (Default = Input) MOVLW b'00000001' ; Define RB1-7 outputs TRIS PORTB ; and set bit GOTO reload ; jump to main program ; Table subroutine................................ table MOVF Count,W ; Put count in W ADDWF PCL ; Add to Programm Counter NOP RETLW 00C ; Display 1 RETLW 0B6 ; Display 2 RETLW 09E ; Display 3 RETLW 0CC ; Display 4 RETLW 0DA ; Display 5 RETLW 0FA ; Display 6 ; Main Loop....................................... reload MOVLW 06 ; Reset counter MOVF Count ; to 6 start BTFSC PORTA,Roll ;Test button GOTO nexnum ; Jump if not presseed CALL table ; get display code MOVWF PORTB ; Output isplay Code GOTO start ; start again nexnum DECFSZ Count ; Dec & Tets Count = 0? GOTO start ; start again GOTO reload ; restart count if zero END
T
Comment