Trying to compile the program below but the compiler never seems to end.
According to Task Manager it's using half the available processor time - presumably the whole of one core.
If I prune a few of the phrases, then it compiles OK - but as it stands it never finishes. Is it ever going to, or is there some page-boundary issue I've not dealt with or some other mistake? I was rather hoping to add quite a few more phrases - is this likely to be possible with this chip, or would I have to migrate to the 18F series?
Thanks - Skipweasel.
;ChipSettings#chip16F876A,4#configOSC=HS;Defines(Constants)#defineLCD_IO4#defineLCD_RSPORTA.2#defineLCD_EnablePORTA.3#defineLCD_DB4PORTC.4#defineLCD_DB5PORTC.5#defineLCD_DB6PORTC.6#defineLCD_DB7PORTC.7#defineLCD_NO_RWDirPORTA.0InDoForeverportb=randomwaitrandommsifporta.0=1thenlcd_intendifLoopSublcd_intregenerate:Selectcaserandomcase1CLSPrint"Aliens- run away"case2CLSPrint"Tidy away socks"case3CLSPrint"The pants attack"Case4CLSPrint"Smells of fish"case5CLSPrint"Eat fruit"case6CLSPrint"Destroy enemies"case7CLSPrint"Engine not start"case8CLSPrint"Too many sloths"case9CLSPrint"Out of cheese"case10CLSPrint"Error - unknown"case11CLSPrint"Energy low"case12CLSPrint"Purple is green"case13CLSPrint"Elephant storm"case14CLSPrint"Fuel low"case15CLSPrint"Six ways to hell"case16CLSPrint"On a mission"case17CLSPrint"Short circuit"case18CLSPrint"Beware - ducks"case19CLSPrint"FISH is not a"locate1,0Print"valid integer"case20CLSPrint"Beer overflow"case21CLSPrint"Sixpennny bust"case22CLSPrint"Regenerator"locate1,0Print"clogged"case23CLSPrint"Three gone"case24CLSPrint"Duff clone error"case25CLSPrint"Sock check fault"case26CLSPrint"Dire warning"case27CLSPrint"Footling coming"case28CLSPrint"End of world"case29CLSPrint"Start of world"case30CLSPrint"No clean pants"case31CLSPrint"Reuse teeshirt"case32CLSPrint"Wake up now"case33CLSPrint"Detect mammals"case34CLSPrint"Unused beer in"locate1,0Print"cellar"case35CLSPrint"Cellar flooded"case36CLSPrint"Toes fighting"locate1,0Print"on lower deck"case37CLSPrint"GOODBYE WORLD"case38CLSPrint"Nanobots corrupt"case39CLSPrint"Error nonlinear"locate1,0Print"linearity"case40CLSPrint"Case not found"case41CLSPrint"Non-specific"locate1,0Print"error"case42CLSPrint"Warning, towel"locate1,0Print"velocity known"case43CLSPrint"Universe out"locate1,0Print"of synch error"case44CLSPrint"Lawyers detected"case45CLSPrint"Unmatched socks"case46CLSPrint"Error: Unkown"locate1,0Print"universe"case47CLSPrint"General reality"locate1,0Print"dislocation"case48CLSPrint"Fart attack"case49CLSPrint"Meep - Meep - "locate1,1Meep-Meep-"case50Print"Brain-fart in"locate1,0Print"in progress"caseelsegotoregenerateendselectEndSub
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
At a guess the program is too big to fit in 1 code page , and in the 16F type chips
program code cant cross a page boundary, so the compiler is getting lost trying to do something it cant.
You need to break the program into smaller pieces, ie instead one 1 large subroutine
make several small sub routines that do the same thing.
The 16F876 has 4 pages of 2048 words each, so no sub can be bigger than 2048 words.
Or use a chip with linear memory like the 18F type.
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
Also look to the compile.lst file for indications on page boundary. Main and subs well within first page, and string tables starting off at ORG 2048, so plenty of room (approx. half full), before splitting up?
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
Trying to compile the program below but the compiler never seems to end.
According to Task Manager it's using half the available processor time - presumably the whole of one core.
If I prune a few of the phrases, then it compiles OK - but as it stands it never finishes. Is it ever going to, or is there some page-boundary issue I've not dealt with or some other mistake? I was rather hoping to add quite a few more phrases - is this likely to be possible with this chip, or would I have to migrate to the 18F series?
Thanks - Skipweasel.
At a guess the program is too big to fit in 1 code page , and in the 16F type chips
program code cant cross a page boundary, so the compiler is getting lost trying to do something it cant.
You need to break the program into smaller pieces, ie instead one 1 large subroutine
make several small sub routines that do the same thing.
The 16F876 has 4 pages of 2048 words each, so no sub can be bigger than 2048 words.
Or use a chip with linear memory like the 18F type.
Ah - that makes sense, thanks.
Would a data-table cross the boundary OK? Not that I'm against breaking it up into chunks, but it might be a more elegant solution.
Print "Does not parse"
Take a look at this line for a typo:
Also look to the compile.lst file for indications on page boundary. Main and subs well within first page, and string tables starting off at ORG 2048, so plenty of room (approx. half full), before splitting up?