asm e picbasic


Closed Thread
Results 1 to 6 of 6

Thread: asm e picbasic

  1. #1
    Join Date
    Dec 2005
    Posts
    21

    Unhappy asm e picbasic

    Hi all,
    I have a problem. After compiling, PicBasicPro generates a warning error:


    Error[118]C:\test.asm53: Overwriting previous address contents (000E)
    Error[118]C:\test.asm54: Overwriting previous address contents (000F)
    Error[118]C:\test.asm55: Overwriting previous address contents (0010)
    Error[118]C:\test.asm56: Overwriting previous address contents (0011)
    Error[118]C:\test.asm57: Overwriting previous address contents (0012)
    Error[118]C:\test.asm58: Overwriting previous address contents (0013)

    and so on.. It does not work. Why?


    this is code:
    ---------------------------------
    DEFINE OSC 4

    define LCD_DREG PORTB
    DEFINE LCD_DBIT 4
    DEFINE LCD_RSREG PORTB
    DEFINE LCD_RSBIT 3
    DEFINE LCD_EREG PORTB
    DEFINE LCD_EBIT 2


    ASM
    BSF STATUS,5
    movlw 00000b
    MOVWF TRISA
    BCF STATUS,5
    LED BSF PORTA,0
    END
    ENDASM


    lighting:

    LCDOUT $fe,1,"light!"
    ---------------------------------

    THX
    chip

  2. #2
    Join Date
    Jul 2003
    Posts
    2,358


    Did you find this post helpful? Yes | No

    Default

    What PIC, what PBP version?

  3. #3
    Join Date
    Dec 2005
    Posts
    21


    Did you find this post helpful? Yes | No

    Smile version

    Hi Melanie,
    I have PicBasicPro version 2.46
    PIC: 16f84a & 16f877a

    thx
    chip

  4. #4
    Join Date
    Jul 2003
    Posts
    2,358


    Did you find this post helpful? Yes | No

    Default

    I get...

    [235] Opcode Expected Instead of 'LED'

    ...which is pretty understandable since your posted code isn't complete!

  5. #5
    Join Date
    Dec 2005
    Posts
    21


    Did you find this post helpful? Yes | No

    Default sorry Melanie..

    "code complete"
    --------------------



    DEFINE OSC 4

    DEFINE LCD_DREG PORTB
    DEFINE LCD_DBIT 4
    DEFINE LCD_RSREG PORTB
    DEFINE LCD_RSBIT 3
    DEFINE LCD_EREG PORTB
    DEFINE LCD_EBIT 2


    ASM
    ORG 0X0C
    CONT RES 2

    BSF STATUS,5
    movlw 00000b
    MOVWF TRISA
    MOVLW 00000000B
    MOVWF TRISB
    BCF STATUS,5

    BSF PORTA,0
    CALL DELAY
    BCF PORTA,0
    CALL DELAY

    DELAY

    D1 DECFSZ CONT,1
    GOTO D1
    D2 DECFSZ CONT+1,1
    GOTO D2
    RETURN
    END

    ENDASM

    IF (PORTA.0 = 1) THEN LIGHT
    IF (PORTA.0 = 0) THEN NO_LIGHT


    LIGHT:
    LCDOUT $FE,1,"LIGHT"

    NO_LIGHT:
    LCDOUT $FE,1,"NO_LIGHT"

  6. #6
    Join Date
    Jul 2003
    Posts
    2,358


    Did you find this post helpful? Yes | No

    Default

    Fisrtly your code isn't going to work... you got serious logical errors (the code is a bit of a mish-mash... have you simply cut & paste or do you have a plan and know what you're doing?)... but that aside...

    If you're going to mix Assembler and PICBasic you can't specify a low-order ORIGIN (your ORG statement), because PICBasic will start assembling it's code down there. If you really need to specify a fixed location for your code, dump it in high memory space, well away from where PICBasic will place it's code.

Similar Threads

  1. ASM cycles in PICBASIC
    By breeno in forum General
    Replies: 4
    Last Post: - 10th July 2006, 08:59
  2. Replies: 22
    Last Post: - 12th July 2005, 17:39
  3. Can an asm interrupt contain gosub to a picbasic routine?
    By sougata in forum mel PIC BASIC Pro
    Replies: 5
    Last Post: - 21st April 2005, 19:49
  4. Asm To Picbasic Disassembler
    By Squibcakes in forum mel PIC BASIC Pro
    Replies: 1
    Last Post: - 10th December 2003, 07:48
  5. asm to picbasic
    By wilfried in forum mel PIC BASIC Pro
    Replies: 1
    Last Post: - 12th March 2003, 01:18

Members who have read this thread : 0

You do not have permission to view the list of names.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts