currently i am learning microcontroller in proteus, i am found out it can write the source code in .asm change to .hex and put in to the microcontroller to simulate. but i can't do it.
can someone tell me step by step how to change this code to .hex
Please help me
can someone tell me step by step how to change this code to .hex
Rich (BB code):
;******Set up the Constants*****
STATUS equ 03h ;Address of the STATUS register
TRISA equ 85h ;Address of the tristate register for port A
PORTA equ 05h ;Address of Port A
COUNT1 equ 08h ;First counter for our delay loops
COUNT2 equ 09h ;Second counter for our delay loops
;******Set up the port******
bsf STATUS,5 ;Switch to Bank 1
movlw 00h ;Set the Port A pins
movwf TRISA ;to output
bcf STATUS,5 ;Switch bank 1 to bank 0
;******Turn the LED on*****
Start movlw 02h ;Turn the LED on by first putting
movwf PORTA ;it into the w register and then on the port
;*****Start of the delay loop 1****
Loop1 decfsz COUNT1,1 ;Subtract 1 from 255
goto Loop1 ;If COUNT is zero, carry on
decfsz COUNT2,1 ;Subtract 1 from 255
goto Loop1 ;Go back to the start of our loop
;*****Delay finished, now turn the LED off*****
movlw 00h ;Turn the LED off by first putting
movwf PORTA ;it into the w register and then on
;*****Add another delay*****
Loop2 decfsz COUNT1,1 ;This second loop keeps the
goto Loop2 ;LED turned off long enough for
decfsz COUNT2,1 ;us to see it turned off
goto Loop2 ;
;******Now go back to the start of the program*****
goto Start ;go back to the Start and turn LED
;******End of the program*****
end ;Needed by some compilers