|
|
|||||||
| Home | Forums | Rules | Articles | Store | Gallery | Blogs | Register | Donations | FAQ | Calendar | Search | Today's Posts | Mark Forums Read | Search |
| Everything Else Anything related to audio / video / electronics etc) BUT remember- we have many new forums where your thread may now fit! .... Parts, Equipment & Tools, Construction Tips, Software Tools...... |
|
Please consider donating to help us continue to serve you.
Ads on/off / Custom Title / More PMs / More album space / Advanced printing & mass image saving |
|
|
|
Thread Tools | Search this Thread |
|
|
#1 |
|
diyAudio Member
Join Date: Jun 2002
Location: Melbourne, Australia
|
Part of my job involves designing hardware and embedded software. I always use assembly language and have just moved up from 'HC05 to 'HC08 micros. I have always written my code as one long sheet of stuff and have never used "includes" that grab external listings of code.
Now, I got to thinking, with a branch instruction you are limited to branching +/- 127 so sometimes you get the "parameter out of range" error if your code is too long. If though, I included several pieces of external code would I still have this branch limitation seeing each section of code is not in a specific place? Or is it, and you have to state where it is?
__________________
Best-ever T/S parameter spreadsheet. http://www.diyaudio.com/forums/multi...tml#post353269 |
|
|
|
|
#2 |
|
diyAudio Member
Join Date: Jun 2002
Location: Melbourne, Australia
|
Sorry, I should have said *conditional* branch.
The guts of the problem is using things like BRSET 1,PORTA,LABEL_NAME where that label is too far away.
__________________
Best-ever T/S parameter spreadsheet. http://www.diyaudio.com/forums/multi...tml#post353269 |
|
|
|
|
#3 |
|
diyAudio Member
Join Date: Jan 2005
Location: Phoenix, Az.
|
I don't know specifically about HC08s, but I've run into similar problems with smaller PICs that have a limitation of 256 byte - 2kB memory pages. If you try to branch beyond a page boundary, you can run into problems. There are work-arounds such as explicitly loading the upper byte of the program counter before EVERY branch and RETURN instruction, but you would probably have to do that in your included code, too. If your whole program is less than the memory page size, you can issue commands to the assembler to load specific code at specific addresses and thereby prevent accidentally spilling over a page boundary.
There are a bunch of macros people have written for PICs that include things like "long goto", etc. Probbaly some of those for HC08s out there in the tubes of the inter web if you look for them. The root of the problem is that the program counter isn't big enough to address all the program memory without resorting to paging. I ran into this problem on a project about 6 months ago and ultimately decided to go with a bigger uC ($2 higher price) that has a larger program counter so the memory isn't paged. This sort of nit-picky stuff is why many people prefer to program in C. Programming in assembly is hard enough without keeping track of all that stuff, too. I_F |
|
|
| Currently Active Users Viewing This Thread: 1 (0 members and 1 guests) | |
| Thread Tools | Search this Thread |
|
|
|
|
||||
| Thread | Thread Starter | Forum | Replies | Last Post |
| The Limitations of an EL34 in UL | alexmoose | Tubes / Valves | 30 | 8th May 2010 12:40 PM |
| LM317 CCS - Any limitations? | Archwn | Power Supplies | 8 | 16th December 2007 04:12 PM |
| Why two diodes per branch on a full wave rectifier? | photo_marc | Tubes / Valves | 31 | 27th August 2006 07:32 AM |
| 50 pieces TDA1543 @ USD2.00each, includes Shipping | tone | Swap Meet | 10 | 7th May 2003 04:56 PM |
| TDA1543 @ USD2.00, includes Shipping | tone | Swap Meet | 0 | 20th January 2003 03:36 AM |
| New To Site? | Need Help? |
| Page generated in 0.07778 seconds (76.57% PHP - 23.43% MySQL) with 10 queries |