Great! But you where wrong about the 9Tcy...Read previous post again... or build an ASM project then watch the Program Memory window.
Great! But you where wrong about the 9Tcy...Read previous post again... or build an ASM project then watch the Program Memory window.
Steve
It's not a bug, it's a random feature.
There's no problem, only learning opportunities.
And yet again, that's what I get for posting off the hip... Since when is a macro...a subroutine? Must forgive my blatent stupidity...the house payment is due today
So, does that little @ NOP?C trick work any other little way that I'm not knowing of yet with anything else?
BTW...Self-Expanding Macro is my new buzzword...
Well i don't know.. i'm not in your own shortSo, does that little @ NOP?C trick work any other little way that I'm not knowing of yet with anything else?
When you call a Macro, the compiler just copy/paste the whole macro code where you called the macro.
let see...
EACH TIME you call the macro like this...Code:OneMacro macro MOVE?CT 1,PORTA,0 MOVE?BB _MyVar,_YourVar endm
This will pasteCode:@ OneMacro
so...Code:MOVE?CT 1,PORTA,0 MOVE?BB _MyVar,_YourVar
will obviously generateCode:@ OneMacro @ OneMacro
Hence why we often suggest to reduce your macro size.Code:MOVE?CT 1,PORTA,0 MOVE?BB _MyVar,_YourVar MOVE?CT 1,PORTA,0 MOVE?BB _MyVar,_YourVar
in NOP?C, The Conditional While (not sure if conditional or MPASM directive.. but anyway), just copy the amount of NOP you asked in the argument parameter
NOP?C 5
will juste paste
@ NOP
@ NOP
@ NOP
@ NOP
@ NOP
that's it. No code overhead, no nothing.... self expanding... or expandOnDemand ... huh?
Steve
It's not a bug, it's a random feature.
There's no problem, only learning opportunities.
Ok, now it's clear and I understnad why it's 5 Tcy for the example. Though it's still going to load tons of NOP's in the code (for my program), it's still strait line. Like you said, it sure will reduce the time needed to tweek the NOP's for clocking speed adjustments. Excelent tip and thanks!
No, I'm not Superman, but I did stay at a Holiday Inn Express last night!
Might even work with a separate variable...as in...
@ NOP?C _variable
? maybe? maybe not?
then you could set the variable at the top and only change it once and in your code use something like
@ NOP?C _variable+2
or
@ NOP?C _variable+10
and so on...
But then again, if you go that far, all you're doing is reinventing the wheel (i.e. pauseus)
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 16:51.
Steve
It's not a bug, it's a random feature.
There's no problem, only learning opportunities.
Bookmarks