Quantcast
Channel: MCS Electronics Forum
Viewing all articles
Browse latest Browse all 20637

BASCOM-AVR : Library .equ references : REPLY

$
0
0
[quote:fdb9a77bc5="mmarlette"]It appears that a .equ is like a local CONST in the library. It can't be referenced outside of the library.[/quote:fdb9a77bc5] Yeah, tried some, but did not succeed either. [quote:fdb9a77bc5]Would be nice not having to double define values. Not that hard to do I know, just want to make hardware change transitions minimal and to use the compiler as it was designed to be.[/quote:fdb9a77bc5] It's not neccessary to do a double declaration, as the lib can use constant declarations from the main code, so declare it only one time there. Main code: [code:1:fdb9a77bc5]Const myc = 10 + 20 Dim Z As Byte z = myc[/code:1:fdb9a77bc5] Lib: [code:1:fdb9a77bc5][TEST] Test: * ldi r24,myc ... [END][/code:1:fdb9a77bc5] The asterisk before ldi makes the compiler ignore the missing myc constant declaration, if you want to compile the lib via tools --> lib manager for making a lbx out it.

Viewing all articles
Browse latest Browse all 20637

Trending Articles