how to change .asm to .hex in proteus

Discussion in 'Embedded Systems and Microcontrollers' started by cpleng7, Jun 13, 2009.

  1. cpleng7

    Thread Starter Active Member

    Dec 18, 2008
    120
    0
    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

    Code ( (Unknown Language)):
    1. ;******Set up the Constants*****
    2. STATUS equ 03h  ;Address of the STATUS register
    3. TRISA equ 85h  ;Address of the tristate register for port A
    4. PORTA equ 05h  ;Address of Port A
    5. COUNT1 equ 08h  ;First counter for our delay loops
    6. COUNT2 equ 09h  ;Second counter for our delay loops
    7. ;******Set up the port******
    8.  
    9.   bsf STATUS,5 ;Switch to Bank 1
    10.   movlw 00h  ;Set the Port A pins
    11.   movwf TRISA  ;to output
    12.   bcf STATUS,5 ;Switch bank 1 to bank 0
    13. ;******Turn the LED on*****
    14.  
    15. Start  movlw 02h  ;Turn the LED on by first putting
    16.   movwf PORTA  ;it into the w register and then on the port
    17. ;*****Start of the delay loop 1****
    18. Loop1  decfsz COUNT1,1 ;Subtract 1 from 255
    19.   goto Loop1  ;If COUNT is zero, carry on
    20.   decfsz COUNT2,1 ;Subtract 1 from 255
    21.   goto Loop1  ;Go back to the start of our loop
    22. ;*****Delay finished, now turn the LED off*****
    23.   movlw 00h  ;Turn the LED off by first putting
    24.   movwf PORTA  ;it into the w register and then on
    25. ;*****Add another delay*****
    26. Loop2  decfsz COUNT1,1 ;This second loop keeps the
    27.   goto Loop2  ;LED turned off long enough for
    28.   decfsz COUNT2,1 ;us to see it turned off
    29.   goto Loop2  ;
    30. ;******Now go back to the start of the program*****
    31.   goto Start  ;go back to the Start and turn LED
    32. ;******End of the program*****
    33. end     ;Needed by some compilers
    Please help me
     
  2. bertus

    Administrator

    Apr 5, 2008
    15,650
    2,348
  3. markosillypig

    Active Member

    Jul 21, 2008
    184
    0
    hi
    what is the asm file for and what does it do ?
     
  4. beenthere

    Retired Moderator

    Apr 20, 2004
    15,815
    282
    It is a set of instructions for the microprocessor. An assembler lets you generate a program using commands that are reasonably close to English. The editor function lets you write the instructions. The assembler proper parses the instructions and outputs the actual machine code.

    If you follow the comments (the text to the right of the ;) with an instruction set list for the microprocessor, you can tell what the program is supposed to do.

    I do not know what microprocessor is associated with the instructions.
     
Loading...