PDA

View Full Version : asm e picbasic



chip15
- 5th April 2006, 07:20
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

Melanie
- 5th April 2006, 10:04
What PIC, what PBP version?

chip15
- 5th April 2006, 11:52
Hi Melanie,
I have PicBasicPro version 2.46
PIC: 16f84a & 16f877a

thx
chip

Melanie
- 5th April 2006, 12:42
I get...

[235] Opcode Expected Instead of 'LED'

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

chip15
- 5th April 2006, 13:47
"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"

Melanie
- 5th April 2006, 16:03
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.