Need Help..How to convert asm file to Hex

Started by ashan_abeysekara January 14, 2004
Dear Friend,

I am new to PIC Micro and I have selected 16F84 to start my testing.
I have created an ASM program now how do I convert in to HEX file to
program in to 16F84.

My program using port A and A1(2nd ping)and I try to
turned on and off LED.

Here is my program and please advice me any thing to be add.
--------------------------------
;Project Name LED1.asm
;Project Using PICMicro 16F84 to set PortA as out put
;and selective output and terned LED ON & OFF STATSU equ 0x03h
TRISA equ 0x85h
PORTA equ 0x05h
COUNT1 equ 0x08h
COUNT2 equ 0x09h

bsf STATUS,5 ;switch to bank1
movlw 0x00h ;set port A as out put
movwf TRISA ;put TRISA reg a out put
bcf STATUS,5 ;returned to bank 0

;Tuened ON LED

STRAT movlw 0x02h
movwf PORTA
;Delay

LOOP1 decfsz COUNT1
goto LOOP1
decfsz COUNT2
goto LOOP1

;Tuened OFF LED

movlw 0x00h
movwf PORTA

;Delay
LOOP2 decfsz COUNT1
goto LOOP2
decfsz COUNT2
goto LOOP2
goto STRAT
end
--------------------------------




You can download MPLAB from the Microchip website for free. This will allow you to compile the asm and generate a list and hex file besides showing you if you had any errors. There are other compilers but this one is most likely the best.
Rick.

ashan_abeysekara wrote:

 Dear Friend,

I am new to PIC Micro and I have selected 16F84 to start my testing.
I have created an ASM program now how do I convert in to HEX file to
program in to 16F84.

My program using port A and A1(2nd ping)and I try to
turned on and off LED.

Here is my program and please advice me any thing to be add.
--------------------------------
;Project Name LED1.asm
;Project Using PICMicro 16F84 to set PortA as out put
;and selective output and terned LED ON & OFF
 

STATSU       equ            0x03h
TRISA      equ            0x85h
PORTA      equ            0x05h
COUNT1      equ            0x08h
COUNT2      equ            0x09h

bsf      STATUS,5      ;switch to bank1
movlw      0x00h            ;set port A as out put
movwf      TRISA            ;put TRISA reg a out put
bcf      STATUS,5      ;returned to bank 0

;Tuened ON LED

STRAT             movlw      0x02h
            movwf      PORTA
;Delay

LOOP1            decfsz      COUNT1
            goto      LOOP1
            decfsz      COUNT2
            goto      LOOP1

;Tuened OFF LED

            movlw      0x00h
            movwf      PORTA

;Delay
LOOP2            decfsz      COUNT1
            goto      LOOP2
            decfsz      COUNT2
            goto      LOOP2
            goto      STRAT
            end
--------------------------------
 
 
 
 

to unsubscribe, go to http://www.yahoogroups.com and follow the instructions
 


Yahoo! Groups Links
  • To