If _Variable is a CONSTANT, it will work indeed. You can still declare it on asm level
and later call the macroCode:@MyVar=.30
Code:NOP?C MyVar+10
If _Variable is a CONSTANT, it will work indeed. You can still declare it on asm level
and later call the macroCode:@MyVar=.30
Code:NOP?C MyVar+10
Last edited by mister_e; - 2nd April 2008 at 17:51.
Steve
It's not a bug, it's a random feature.
There's no problem, only learning opportunities.
In this case, it could be better to change it too.
and at the top of your code you define MyByte likeCode:ASM NOP?C macro Cin local a a=0 while a<(Cin+MyByte) nop a++=1 endw endm ENDASM
Code:@MyByte=.10 ; your value.. whatever
Steve
It's not a bug, it's a random feature.
There's no problem, only learning opportunities.
When you first typed "=.30", I thought the decimal and the zero were a type-o. Then I see you used "=.10". It's been a long time (close to 10 years ago) that I've been through the MPASM manual, and I can still go back and read it, but can you explain the "=.30" and "=.10" for defining 3 and 1? I would have thought it would just be "=3" or "=1".
Thanks for taking your time to explain all this to us.
No, I'm not Superman, but I did stay at a Holiday Inn Express last night!
It's just a MPASM naming convention. Depending the current MPASM radix setting
@a=10
@B=30
Those above could be considered as decimal or hexa.
Let's open a PBP .INC file, let's say 16F628.inc, you'll discover...
so every value should be considered as decimal using PBP.Code:else LIST LIST p = 16F628, r = dec, w = -302 INCLUDE "P16F628.INC" ; MPASM Header ;__config _XT_OSC & _WDT_ON & _PWRTE_ON & _MCLRE_ON & _LVP_OFF & _CP_OFF NOLIST endif LIST
MPASM naming convention
.10 or d'10' will always be considered as 10 decimal whatever your Radix setting is.. kinda safe way to write things.
Steve
It's not a bug, it's a random feature.
There's no problem, only learning opportunities.
Thanks Mr.E. Now that you mentioned it, I remember dealing with the radix before, but never much explored it many uses. Again, that was a long time ago... and I've had several beers since then.![]()
No, I'm not Superman, but I did stay at a Holiday Inn Express last night!
oh... think we ALL had few beer... in case you're thirsty
![]()
Steve
It's not a bug, it's a random feature.
There's no problem, only learning opportunities.
Bookmarks