First: those "odd mnemonics" were not part of the original 6502 code
set. They were coined by curious hackers who spent innumerable
hours trying "undocumented" opcodes out to see what effect they
had, by setting up values in the registers and memory, running
an instruction and figuring out what changed. A mate of mine
actually found some sort of useful ones that he wrote a "manual"
extension for, in 6502 format! (Looked like an addendum!)
Second: HCF was an opcode that was used on some really archaic hardware
well before apples were even thought of. It really did halt and
catch fire, on one machine, since what it did (if not used
properly) was to enter a tight loop which was not interruptable
or resettable, and since the machine used core memory, the
repetetive access to the same core locations heated up the
to the point where the wires would melt, causing short circuits,
and driver chips would begin to smoke!
Third: You'll only find such opcodes on the 8086/186 since the 286 and
better have implemented an undefined instruction trap which
causes a routine to be called whenever one of these instructions
that is not a "legal" Intel instruction is executed. That is,
if there are any at all! Most of the ones that I tried just
cause the 8086 or 80186 to shutdown, leaving the bus in a halted
state (as if some other processor had taken it over). (Try POP
CS! The "hole" exists in the instruction set, since there are
PUSH CS/DS/ES and SS instructions and only POP DE/ES or SS).
Hope this sheds some light!
Hmm, executing 0xf1 on my Intel 486DX/33 from ring 3 in protected mode
results in not an int 0x6 (Illegal Instruction), but instead either an
int 0x01 or an int 0x03 (I am doing this under Linux, and thus can't tell
the difference without a lot of work).
Just a side note: the HCF "instruction" is probably an unimplemented
instruction opcode whose behavior varies according to the specific
implementation of the 6502 on which it is executed. Many CPUs have such
undefined instructions and they are mainly useful for trivia questions.
--
Chris Page "I got a Power Macintosh...
Adobe Systems Incorporated ...now what?" -- Me
cp...@mv.us.adobe.com
Disclaimer: opinions expressed are not necessarily those of my employer.
Well, there is no single instruction that does exactly that, however,
youc an definitely lock up your CPU with
CLI
HLT
--
--> Kevin Marcus, Computer Science Dept., University of California, Riverside
Email: dat...@cs.ucr.edu.
.. "Two types of programs do CALL <next instr>; POP <index reg>. They are
viruses and a good chunk of DOS programs. Down with MicroSloth."
Don't try pop CS !
Debug will assemle it for you but the actual instruction is NOT a Pop CS.
The OP code is 0F and it is just a prefix for system instructions in a
286/386/486/Pentium chip.
(Instructions like LIDT, LGDT and the like.)
Andras
: Don't try pop CS !
: Debug will assemle it for you but the actual instruction is NOT a Pop CS.
: The OP code is 0F and it is just a prefix for system instructions in a
: 286/386/486/Pentium chip.
: (Instructions like LIDT, LGDT and the like.)
POP CS _is_ an instruction on the 8088, and it does exactly that. It's
not entirely clear where this instruction might be usefully employed.
--
Gary L. Smith g...@infinet.com
Columbus, Ohio Gary_...@oclc.org
>Hmm, executing 0xf1 on my Intel 486DX/33 from ring 3 in protected mode
>results in not an int 0x6 (Illegal Instruction), but instead either an
>int 0x01 or an int 0x03 (I am doing this under Linux, and thus can't tell
>the difference without a lot of work).
Correct, opcode 0F1 on Intel chips causes a Debug Trap, even when not single
stepping. On the 286, the opcode 0F1 would IGNORE the next instruction when
single stepping was used. Great opcode to prevent debugging. It's too bad
they reversed it on the 386+. As far as I know, even the Pentium supports the
386 version of the 0F1 opcode. I have never seen 0F1 generate INT 3, however.
On some AMD chips, this opcode does something altogether different, when a
certain bit is set in one of the debug registers (DR7, I think).
Hope this helps,
JJ
>I used to do a bit of assembler on Apple IIs (65c02), and I read once
>about several odd instructions, with insane mnemonics. One example, HCF,
>would compleatly trash all 3 registers, and hang everything. It stood for
>"Halt and Catch Fire". What I'm wondering is, is there anything similar
>in the x86 line, particularly the 80x8 and the 186?
Yes, on the x86 there is an equivalent of HCF. It is called WIN. And it
isn't as reliable as HCF.
Mike Schmit
-------------------------------------------------------------------
msc...@ix.netcom.com author:
408-244-6826 Pentium Processor Programming Tools
800-765-8086 ISBN: 0-12-627230-1
-------------------------------------------------------------------
>: Second: HCF was an opcode that was used on some really archaic hardware
>: well before apples were even thought of. It really did halt and
>: catch fire, on one machine, since what it did (if not used
>: properly) was to enter a tight loop which was not interruptable
>: or resettable, and since the machine used core memory, the
>: repetetive access to the same core locations heated up the
>: to the point where the wires would melt, causing short circuits,
>: and driver chips would begin to smoke!
Some very early 6800 CPUs (may have been betas) also had this mis-feature.
The chip would literaly burn up! Worked with a guy who was there....
(un-documented opcode).
-Mark
65c02 eh? I did a fair amount of ASM programming on my Apple ][e as well,
wrting serial drivers for BBSs, graphics program etc. I've just decided to
try learning x86 assembly, and although there are a significant amount of new
opcodes to make life for the modern day ASM programmer pretty nice, its still
not that far off the old stuff I used to code..
Anyways, glad to have a newsgroup like this to help lower the learning curve!
Alan Krause
-------------------------------------------------
Alan Krause krau...@coyote.csusm.edu
Compuserve: 76651, 1674
[stuff about invalid op codes gone]
): state (as if some other processor had taken it over). (Try POP
): CS! The "hole" exists in the instruction set, since there are
): PUSH CS/DS/ES and SS instructions and only POP DE/ES or SS).
POP CS is a valid 8088/8086 instruction. It is not a hole. It is not a
valid 80286/80386/80486 instruction. I don't know about the 80188/80186.
Mike
----
char *p="char *p=%c%s%c;main(){printf(p,34,p,34);}";main(){printf(p,34,p,34);}
Not only that, but POP CS is *NOT* a valid 8088/8086 instruction. Oh, its
there all right, and it works, but as it was not documented or supported by
Intel, it isn't valid. Not only that, most 8088 machines that I know of have
been "upgraded" to a V20 in order to pick up a little speed and '286
(non-protected mode) instruction compatability.
;*****************************************************************************
;* ___ *
;* / \ Mark D. Pickerill Monterey Bay Aquarium Research Institute *
;*| | ma...@mbari.org (M.B.A.R.I.) *
;* \ / *
;*__\_/__ Servant of Athena |==================================|*
;* | Assembly hack extrodinaire | All opinions are my own, and in |*
;* | Diesel engine nut | no way reflect opinions of MBARI |*
;* | Mercedes-Benz enthusiast | "Standard disclaimers apply" |*
;* | |==================================|*
;*****************************************************************************