Searching \ for 'filling unused code space' in subject line. ()
Make payments with PayPal - it's fast, free and secure! Help us get a faster server
FAQ page: www.piclist.com/techref/index.htm?key=filling+unused+code
Search entire site for: 'filling unused code space'.

Truncated match.
PICList Thread
'filling unused code space'
1999\02\16@141238 by Harold Hallikainen

picon face
On Mon, 15 Feb 1999 14:42:04 -0600 John Payson <spam_OUTsupercatTakeThisOuTspamCIRCAD.COM>
writes:

>
>Note that on the 17Cxx parts, a blank program location corresponds
>to a CALL instruction, but on all the 12- and 14-bit parts it will
>leave the PC and related registers alone.
>

       Back when I did stuff with the MC6802, I filled all unused code
space (and initialized all RAM) to 0x3f, which was a "software
interrutp".  If the program counter ended up on one of these locations,
it would vector to the initialization code and restart the machine (the
SWI vector was set the same as the RESET vector in ROM).
       Is there a way to do something similar on the PIC (specifically a
16c61)?  It seems that perhaps high ROM locations could be filled with
nops, then the PC would just roll around to the reset vector.
       Is there a way in MPASM to tell it to fill unused ROM with a
specific instruction?

Harold



Harold Hallikainen
.....haroldKILLspamspam@spam@hallikainen.com
Hallikainen & Friends, Inc.
See the FCC Rules at http://hallikainen.com/FccRules and comments filed
in LPFM proceeding at http://hallikainen.com/lpfm

___________________________________________________________________
You don't need to buy Internet access to use free Internet e-mail.
Get completely free e-mail from Juno at http://www.juno.com/getjuno.html
or call Juno at (800) 654-JUNO [654-5866]

1999\02\16@142142 by dave vanhorn

flavicon
face
>        Back when I did stuff with the MC6802, I filled all unused code
>space (and initialized all RAM) to 0x3f, which was a "software
>interrutp".  If the program counter ended up on one of these locations,
>it would vector to the initialization code and restart the machine (the
>SWI vector was set the same as the RESET vector in ROM).
>        Is there a way to do something similar on the PIC (specifically a
>16c61)?  It seems that perhaps high ROM locations could be filled with
>nops, then the PC would just roll around to the reset vector.
>        Is there a way in MPASM to tell it to fill unused ROM with a
>specific instruction?


Wouldn't JMP Start suffice (or whatever you call the beginning of your
code), which is where the reset vector will take it anyway?

1999\02\16@162519 by Gerhard Fiedler

picon face
At 14:18 02/16/99 -0500, dave vanhorn wrote:
>Wouldn't JMP Start suffice (or whatever you call the beginning of your
>code), which is where the reset vector will take it anyway?

why not leave it unprogrammed, as somebody suggested before (so you can add
something in case you need it)? that's something like ADDLW FFh (on the
14bitters) and either it wraps around to reset, or you put a "jmp here"
endless loop at the end and let it get hit by the watch dog. which seems to
be the proper way to do it.

ge

1999\02\16@164210 by dave vanhorn

flavicon
face
At 01:17 PM 2/16/99 -0800, Gerhard Fiedler wrote:
>At 14:18 02/16/99 -0500, dave vanhorn wrote:
>>Wouldn't JMP Start suffice (or whatever you call the beginning of your
>>code), which is where the reset vector will take it anyway?
>
>why not leave it unprogrammed, as somebody suggested before (so you can add
>something in case you need it)? that's something like ADDLW FFh (on the
>14bitters) and either it wraps around to reset, or you put a "jmp here"
>endless loop at the end and let it get hit by the watch dog. which seems to
>be the proper way to do it.

Depends on the system, I can see leaving a block of codespace somewhere
blank, but you aren't going to need inbetween routines, since you can't get
there anyway.  Everything I work on at the moment is flash, so I'm not
likely to need to go burn a single byte change anywhere, that would be more
work than reloading the whole codespace.

You may not have a watchdog.. Our financial systems don't. We determined
that a watchdog couldn't possibly stop the processor before it peed all
over the data, if it wanted to, and so we used JMP 0 equivalents to force a
reset.

1999\02\16@171028 by Tony Nixon

flavicon
picon face
> 16c61)?  It seems that perhaps high ROM locations could be filled with
> nops, then the PC would just roll around to the reset vector.

That probably isn't necessary in this scenario. If the chip is properly
blank tested before programming then 12 bit chips have FFF which is
XORLW 0xFF and 14 bit chips have 3FFF which is ADDLW 0xFF.
The same thing would happen.


--
Best regards

Tony

Multimedia 16F84 Beginners PIC Tools.
** NEW PicNPro Programmer and Port Interface **

http://www.picnpoke.com
Email picnpokespamKILLspamcdi.com.au

1999\02\17@072018 by Alan Nickerson

flavicon
face
"peed all over the data", Must be a technical term... :)

Alan

-----Original Message-----
From: dave vanhorn <.....dvanhornKILLspamspam.....CEDAR.NET>
To: EraseMEPICLISTspam_OUTspamTakeThisOuTMITVMA.MIT.EDU <PICLISTspamspam_OUTMITVMA.MIT.EDU>
Date: Tuesday, February 16, 1999 4:44 PM
Subject: Re: filling unused code space


>At 01:17 PM 2/16/99 -0800, Gerhard Fiedler wrote:
>>At 14:18 02/16/99 -0500, dave vanhorn wrote:
>>>Wouldn't JMP Start suffice (or whatever you call the beginning of your
>>>code), which is where the reset vector will take it anyway?
>>
>>why not leave it unprogrammed, as somebody suggested before (so you can
add
>>something in case you need it)? that's something like ADDLW FFh (on the
>>14bitters) and either it wraps around to reset, or you put a "jmp here"
>>endless loop at the end and let it get hit by the watch dog. which seems
to
{Quote hidden}

1999\02\17@094030 by dave vanhorn

flavicon
face
At 07:19 AM 2/17/99 -0500, Alan Nickerson wrote:
>"peed all over the data", Must be a technical term... :)


Sorry, I try not to get too technical. :)

1999\02\17@105353 by Alan Nickerson

flavicon
face
I just thought it was funny.

-----Original Message-----
From: dave vanhorn <@spam@dvanhornKILLspamspamCEDAR.NET>
To: KILLspamPICLISTKILLspamspamMITVMA.MIT.EDU <RemoveMEPICLISTTakeThisOuTspamMITVMA.MIT.EDU>
Date: Wednesday, February 17, 1999 9:42 AM
Subject: Re: filling unused code space


>At 07:19 AM 2/17/99 -0500, Alan Nickerson wrote:
>>"peed all over the data", Must be a technical term... :)
>
>
>Sorry, I try not to get too technical. :)
>

1999\02\20@082411 by paulb

flavicon
face
Alan Nickerson wrote:

> I just thought it was funny.

> From: dave vanhorn <spamBeGonedvanhornspamBeGonespamCEDAR.NET>
>>> "peed all over the data", Must be a technical term... :)
>> Sorry, I try not to get too technical. :)

 We all did.

Harold Hallikainen wrote:

> Is there a way to do something similar on the PIC (specifically a
> 16c61)?  It seems that perhaps high ROM locations could be filled with
> nops, then the PC would just roll around to the reset vector.
> Is there a way in MPASM to tell it to fill unused ROM with a specific
> instruction?

 And I think we came to the conclusion that this was already done for
us.  Depending on the µC "core", the instructions "ADDLW -1" and
"XORLW -1" are about as close to a NOP as you'd need.  They cause no
branch, no port alterations, repeated execution simply decrements or
complements W respectively on each cycle and within 1mS (for 1000
instructions at 4MHz) you wind through the unused memory and hit the
*reset* entry point within one eighteenth of the watchdog timeout
interval.

 The comment that this may take "too long" to happen is a little na•ve
as it seems to me.  Something *real bad* has happened to the system to
get here, concerns that it may slow the system down are a little too
late!

 So you can forget it.  Just make sure that the reset code iniitialises
all things that need initialisation, or if you like, code the very last
location with "GOTO $" (or variations involving page select) and let the
WDT run out.
--
 Cheers,
       Paul B.

More... (looser matching)
- Last day of these posts
- In 1999 , 2000 only
- Today
- New search...