Searching \ for '[PIC] HALT instruction' 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/microchip/devices.htm?key=pic
Search entire site for: 'HALT instruction'.

Exact match. Not showing close matches.
PICList Thread
'[PIC] HALT instruction'
2004\10\04@130655 by piclist

flavicon
face
I came across some code which included the HALT instruction, and can't
find any documentation as to what it is.  MPASM accepts the
instruction, and generates an opcode for it for both PIC16 and PIC18
families.  MPLAB, however, doesn't disassemble it in the program
memory window.  Does anyone know what it's for?

--
John W. Temples, III
_______________________________________________
http://www.piclist.com
View/change your membership options at
http://mailman.mit.edu/mailman/listinfo/piclist

2004\10\04@134643 by Dwayne Reid

flavicon
face
At 11:06 AM 10/4/2004, spam_OUTpiclistTakeThisOuTspamxargs.com wrote:
>I came across some code which included the HALT instruction, and can't
>find any documentation as to what it is.  MPASM accepts the
>instruction, and generates an opcode for it for both PIC16 and PIC18
>families.  MPLAB, however, doesn't disassemble it in the program
>memory window.  Does anyone know what it's for?

Any chance that the op-code generated looks anything like:

    goto  $

All I can think of at the moment.

dwayne

--
Dwayne Reid   <.....dwaynerKILLspamspam@spam@planet.eon.net>
Trinity Electronics Systems Ltd    Edmonton, AB, CANADA
(780) 489-3199 voice          (780) 487-6397 fax

Celebrating 20 years of Engineering Innovation (1984 - 2004)
 .-.   .-.   .-.   .-.   .-.   .-.   .-.   .-.   .-.   .-
    `-'   `-'   `-'   `-'   `-'   `-'   `-'   `-'   `-'
Do NOT send unsolicited commercial email to this email address.
This message neither grants consent to receive unsolicited
commercial email nor is intended to solicit commercial email.

_______________________________________________
http://www.piclist.com
View/change your membership options at
http://mailman.mit.edu/mailman/listinfo/piclist

2004\10\04@135300 by Dave VanHorn

flavicon
face
At 12:06 PM 10/4/2004, piclistspamKILLspamxargs.com wrote:

>I came across some code which included the HALT instruction, and can't
>find any documentation as to what it is.  MPASM accepts the
>instruction, and generates an opcode for it for both PIC16 and PIC18
>families.  MPLAB, however, doesn't disassemble it in the program
>memory window.  Does anyone know what it's for?

Not documented in the proc's data sheet?

Normally, halt is NOT a "jump here".
Normally, it is a way to reduce CPU consumption by halting operations in the ALU.
I/O normally continues, so that you have some way to exit the halt, like on an interrupt.

There are so may variations, it's hard to be too specific.
Halt, Sleep, Snooze.... :)

_______________________________________________
http://www.piclist.com
View/change your membership options at
http://mailman.mit.edu/mailman/listinfo/piclist

2004\10\04@140238 by Mauricio Jancic

flavicon
face
I think that John refers to the HALT instruction that is recognized by the
MPASM compiler. I've tested a few minutes ago and I don't see what it
does... Might it be an instruction for the ICE or ICD or anything like that?
The help says that it stop execution, but I thnk it's refering to the F5 -
Halt...

Mauricio Jancic
Janso Desarrollos
Microchip Consultant Program Member
(54) 11-4542-3519
.....infoKILLspamspam.....janso.com.ar
http://www.janso.com.ar


>>{Original Message removed}

2004\10\04@140350 by Mauricio Jancic

flavicon
face

>>Any chance that the op-code generated looks anything like:
>>
>>     goto  $

No, It generate a 0x0061 opcode, which has no translation to "human code" or
assembler... Try it your self in the MPLAB.

Mauricio Jancic
Janso Desarrollos
Microchip Consultant Program Member
(54) 11-4542-3519
EraseMEinfospam_OUTspamTakeThisOuTjanso.com.ar
http://www.janso.com.ar


_______________________________________________
http://www.piclist.com
View/change your membership options at
http://mailman.mit.edu/mailman/listinfo/piclist

2004\10\04@141728 by Dave VanHorn

flavicon
face
At 01:02 PM 10/4/2004, Mauricio Jancic wrote:

>I think that John refers to the HALT instruction that is recognized by the
>MPASM compiler. I've tested a few minutes ago and I don't see what it
>does... Might it be an instruction for the ICE or ICD or anything like that?
>The help says that it stop execution, but I thnk it's refering to the F5 -
>Halt...

Compiler directive instead of processor instruction?

_______________________________________________
http://www.piclist.com
View/change your membership options at
http://mailman.mit.edu/mailman/listinfo/piclist

2004\10\04@142624 by John J. McDonough

flavicon
face
----- Original Message -----
From: "Mauricio Jancic" <infospamspam_OUTjanso.com.ar>
Subject: RE: [PIC] HALT instruction


> No, It generate a 0x0061 opcode, which has no translation to "human code"
or
> assembler... Try it your self in the MPLAB.

Interesting, though ... other nearby opcodes:
 62 option
 63 sleep
 64 clrwdt
certainly sounds like a control sort of instruction.

--McD


_______________________________________________
http://www.piclist.com
View/change your membership options at
http://mailman.mit.edu/mailman/listinfo/piclist

2004\10\04@143240 by Herbert Graf

flavicon
face
On Mon, 2004-10-04 at 14:26, John J. McDonough wrote:
> ----- Original Message -----
> From: "Mauricio Jancic" <@spam@infoKILLspamspamjanso.com.ar>
> Subject: RE: [PIC] HALT instruction
>
>
> > No, It generate a 0x0061 opcode, which has no translation to "human code"
> or
> > assembler... Try it your self in the MPLAB.
>
> Interesting, though ... other nearby opcodes:
>   62 option
>   63 sleep
>   64 clrwdt
> certainly sounds like a control sort of instruction.

Could it be a breakpoint sort of deal for the ICD2? TTYL

-----------------------------
Herbert's PIC Stuff:
http://repatch.dyndns.org:8383/pic_stuff/

_______________________________________________
http://www.piclist.com
View/change your membership options at
http://mailman.mit.edu/mailman/listinfo/piclist

2004\10\04@143827 by Robert Rolf

picon face
John J. McDonough wrote:

> Interesting, though ... other nearby opcodes:
>   62 option
>   63 sleep
>   64 clrwdt
> certainly sounds like a control sort of instruction.

My sentiments too.
Perhaps a 'breakpoint' sleep instruction?
_______________________________________________
http://www.piclist.com
View/change your membership options at
http://mailman.mit.edu/mailman/listinfo/piclist

2004\10\04@145659 by Spehro Pefhany

picon face
At 02:32 PM 10/4/2004 -0400, you wrote:
>On Mon, 2004-10-04 at 14:26, John J. McDonough wrote:
> > {Original Message removed}

2004\10\04@150531 by piclist

flavicon
face
On Mon, 4 Oct 2004, Dwayne Reid wrote:

> Any chance that the op-code generated looks anything like:
>
>      goto  $

No, it's not an opcode that MPLAB can disassemble.  On the PIC18, it
generates a 0000 0000 0000 0001 opcode, which is not documented in the
18 family datasheet.  It appears to do nothing in the simulator.

--
John W. Temples, III
_______________________________________________
http://www.piclist.com
View/change your membership options at
http://mailman.mit.edu/mailman/listinfo/piclist

2004\10\04@152003 by Jan-Erik Soderholm

face picon face
> It [the HALT instruction] appears to do nothing in the simulator.

The next step usualy is to try the following command :

 "HALT ! Or I'll pull the trigger !"

:-)

Jan-Erik.

_______________________________________________
http://www.piclist.com
View/change your membership options at
http://mailman.mit.edu/mailman/listinfo/piclist

2004\10\04@154416 by Ken Pergola

flavicon
face

John Temples wrote:


> Does anyone know what it's for?


Hi John,

I can't answer your question directly but you might want to check this out
(it's a snippet from a past post I made on the PICList):


There was a past discussion on the Microchip forum regarding undocumented
instructions (i.e. TRAP) that are decoded by MPLAB.

One of the Microchip moderator's posted this:

=====
One trick I revealed at a MASTERs conference was that you can assemble the
TRAP instruction into your code to get more than one breakpoint with the
MPLAB ICD 2. It's a little more laborious, because you've got to insert it
into your code and assemble, but when you absolutely must have more
breakpoints, this is a nice trick.

Of course, you can manually insert a TRAP into program memory, but you will
overwrite the instruction at that address.

dj
====




Best regards,

Ken Pergola


_______________________________________________
http://www.piclist.com
View/change your membership options at
http://mailman.mit.edu/mailman/listinfo/piclist

2004\10\04@162427 by piclist

flavicon
face
On Mon, 4 Oct 2004, Spehro Pefhany wrote:

> The help file says:
>
> "HaltHalt
> A stop of program execution. Executing Halt is the same as stopping at a
> breakpoint."

That's referring to the MPLAB halt; i.e., pressing F5 in debug mode.

--
John W. Temples, III
_______________________________________________
http://www.piclist.com
View/change your membership options at
http://mailman.mit.edu/mailman/listinfo/piclist

2004\10\04@164844 by Harold Hallikainen
face picon face
The halt instruction sounds interesting. I don't see application for it in
a typical embedded system. I have sometimes done a goto $ to force a
watchdog timeout to reset the system. On TRAP, and the need to overwrite a
code location when putting it in as a breakpoint, I imagine this is what
MPLAB does. When you remove the breakpoint, it probably just writes the
original instruction back. My first microprocessor experience was with the
MC6802. It had several interrupts including a nonmaskable, a maskable, and
a "software interrupt." The SWI (0x3f) was like any other interrupt except
that it actually took a byte of code space. It would stick the registers
on the stack, then vector to the address listed in the table at the top of
memory (something like at 0xfff8). I wrote a monitor program that would
dump processor status (PC, A, B, X, flags, SP) to my terminal (Lear
Siegler ADM-1) when the program hit a location with 0x3f in it. I'd guess
that the ICD and MPLAB do something similar.

I'd be interested in finding out what the halt instruction does, though.

Harold



--
FCC Rules Online at http://www.hallikainen.com
_______________________________________________
http://www.piclist.com
View/change your membership options at
http://mailman.mit.edu/mailman/listinfo/piclist

2004\10\05@174243 by Robert Rolf

picon face
Jan-Erik Soderholm wrote:
>
> > It [the HALT instruction] appears to do nothing in the simulator.
>
> The next step usualy is to try the following command :
>
>   "HALT ! Or I'll pull the trigger !"
>
> :-)

No no no... You want the "HCF" instruction from
the old Motorola (now Freescale) 6800 data sheet.

http://computing-dictionary.thefreedictionary.com/Halt%20and%20Catch%20Fire

Halt and Catch Fire - (HCF) Any of several undocumented and
semi-mythical machine instructions with destructive side-effects,
supposedly included for test purposes on several well-known architectures
going as far back as the IBM 360. The Motorola 6800 microprocessor
was the first for which an HCF opcode became widely known.
This instruction caused the processor to toggle a subset
of the bus lines as rapidly as it could;
in some configurations this could actually cause lines to burn up.
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^

So much for 'mythical'....
R
_______________________________________________
http://www.piclist.com
View/change your membership options at
http://mailman.mit.edu/mailman/listinfo/piclist

2004\10\05@181804 by Mauricio Jancic

flavicon
face
According to Microchip Tech support:

This instruction is used by emulators and debuggers for breakpoint
operation. It isn't a user instruction.

I've just requested a full list of instructions and explanation to see if
there is something usefull...

regards

Mauricio Jancic
Janso Desarrollos
Microchip Consultant Program Member
(54) 11-4542-3519
KILLspaminfoKILLspamspamjanso.com.ar
http://www.janso.com.ar


_______________________________________________
http://www.piclist.com
View/change your membership options at
http://mailman.mit.edu/mailman/listinfo/piclist

2004\10\05@182100 by SHands

flavicon
face
I don't know about you guys - but I find that undocumented bits like
these actually make languages/code/products/etc a whole lot more
interesting and/or useful.

I know it's a very simple example - but cast your minds back to MS-DOS's
FORMAT and the /AUTOTEST switch. This'll format a disk without asking if
you really want to do it. Useful? Probably not. But it just goes to show
that when you thought that you knew something inside-out - there are
still hidden bits in there to be investigated to re-spark your interest.
Why is it there? Who put it there? Is there a story behind it? And so
on...

Speaking of which - does anyone know of any other undocumented PIC, (or
other), instructions? (Myths or otherwise!)

Cheers,
Stuart

{Original Message removed}

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