I've smacked into stack issues with the 16F887.
I NEED to use Goto across page boundaries
instead of CALL.
The only examples I've seen are:
Pagesel $ (current page)
Pagesel BASPROGSTART
So:
asm Pagesel xxxxx
asm Goto Label
BUT where do I put my label?
and how do I know what page it's on?
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
It's only that I've used a lot of memory and need to couple a few one-time use
subs together.
So please clarify: All capital labels and 'asm Goto LABEL' will work?
Last edit: Mikorians 2017-08-01
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
I used to just put a couple of asm nop
to eliminate the odd bad org overwrite 2048.
Now with everything in 'Sub packets', I thought
Gcb would find it easier to pack them in, but now
I've tried 20 nops after my first goto and its overlapping all 3 pages
2048, 4096, and 6xxx.
Hm.
Its really too big to post.
Advice, experience ?
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
You could try a more modern device.
The most recent 40PIN device is the PIC16F18877
with 4,096 Bytes of RAM and 56KB Flash it should get over any paging issues and code size probelms.
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
Thank you for your recommendation.
There are 8 subprocessors in my system and I am
experimenting with the 18F4680 (actually).
But we aren't yet ready for that.
Software tip?
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
OK. MORE Bad Org Overwrites!
We've fought these for a few years now and have
usually won. But:
This is now really making it hard to code here.
It's GUESSWORK where my nops have to go.
Or whether I need fewer.
I've gone back and forth from the .ASM
source, looking at which code lies near the boundaries.
IS there like, a strict command line option because
we're all ready to throw our hands up at this coding quagmire.
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
Hm. I can now see what this compiler is up against working
with 2048 bytes of page space. Please forgive our frustration.
Your own must be just as bad.
Our solution was to go back to the larger blocks of code (near 2K).
It forced the little ones back into line again, and now
we can goto across pages.
We do still wish that the little ones were better behaved.
But 1 or 2 'asm nop's at the end or start of a big block kicks 'em out.
Last edit: Mikorians 2017-08-02
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
I've smacked into stack issues with the 16F887.
I NEED to use Goto across page boundaries
instead of CALL.
The only examples I've seen are:
Pagesel $ (current page)
Pagesel BASPROGSTART
So:
asm Pagesel xxxxx
asm Goto Label
BUT where do I put my label?
and how do I know what page it's on?
Just put labels wherever you want in your source code and use goto.
Got any source that would help us understand the issue?
It's only that I've used a lot of memory and need to couple a few one-time use
subs together.
So please clarify: All capital labels and 'asm Goto LABEL' will work?
Last edit: Mikorians 2017-08-01
Not sure what you mean by one-time use subs but if you are referring to a sub that is only ever called once then rather inline the code with a macro.
example:
would call the subroutine MyJob.
But it could be written as:
will replace the word MyJob with the contents of the macro.
There should be no need for the asm keyword, GCBASIC recognises assembler nemonics.
Used in this 'Illegal' connotation, GCBASM throws Symbol not defined back at me.
Sub OneBigSub
'...
Goto SecondSub
BackToOne:
End Sub
Sub Another
SecondSub:
'...
Goto BackToOne
End Sub
Sorry. I do not understand.
But, my guess. . .. define labels and use GOTO. Great Cow BASIC will handle the associated ASM.
Got it:
Works now!
I used to just put a couple of asm nop
to eliminate the odd bad org overwrite 2048.
Now with everything in 'Sub packets', I thought
Gcb would find it easier to pack them in, but now
I've tried 20 nops after my first goto and its overlapping all 3 pages
2048, 4096, and 6xxx.
Hm.
Its really too big to post.
Advice, experience ?
You could try a more modern device.
The most recent 40PIN device is the PIC16F18877
with 4,096 Bytes of RAM and 56KB Flash it should get over any paging issues and code size probelms.
Thank you for your recommendation.
There are 8 subprocessors in my system and I am
experimenting with the 18F4680 (actually).
But we aren't yet ready for that.
Software tip?
Here's a tip: Busted up Subs > 512 bytes
OK. MORE Bad Org Overwrites!
We've fought these for a few years now and have
usually won. But:
This is now really making it hard to code here.
It's GUESSWORK where my nops have to go.
Or whether I need fewer.
I've gone back and forth from the .ASM
source, looking at which code lies near the boundaries.
IS there like, a strict command line option because
we're all ready to throw our hands up at this coding quagmire.
Thanks for the Macro tip!
Hm. I can now see what this compiler is up against working
with 2048 bytes of page space. Please forgive our frustration.
Your own must be just as bad.
Our solution was to go back to the larger blocks of code (near 2K).
It forced the little ones back into line again, and now
we can goto across pages.
We do still wish that the little ones were better behaved.
But 1 or 2 'asm nop's at the end or start of a big block kicks 'em out.
Last edit: Mikorians 2017-08-02