Talk:COMEFROM

From Wikipedia, the free encyclopedia

I don't see any discussion here of the resemblance between block structured exception handling and COMEFROM. "Catch" clauses are very much like a "structured" cousin of COMEFROM, as the point from which control is transferred doesn't specify where it goes, and instead the point at which it arrives "catches" it.--74.104.131.76 15:48, 31 December 2006 (UTC)

[edit] Breakpoints

The most practical known use of a COMEFROM-like structure is as a breakpoint during debugging. One implementation of FORTRAN included it, under the name "AT", as a debugging aid, with dire warnings against using it in production code. In addition, many modern CPUs have hardware support for breakpoints.

Do these "hardware breakpoints" really act like COMEFROM, or are they some kind of "break" instruction that isn't at all like COMEFROM? The latter sounds much more likely to me... - furrykef (Talk at me) 08:03, 28 March 2007 (UTC)

They really do act like COMEFROM. The CPU has special debug registers which hold the addresses of instructions that should be made to trap. Any regular instruction can be made to trap, without needing to replace the instruction. An x86 supports 4 simultaneously. Most debuggers don't use them, because break instructions are easier and because the debug registers are best used for watching data. AlbertCahalan 04:09, 27 May 2007 (UTC)

[edit] SHARC example

For those who will surely doubt...

Yes, that's real assembly language for a real CPU. I know it looks like a bastard hybrid of C and FORTRAN. It's the kind of assembly language you get from people who design a CPU with hardware support for 6 simultaneous COMEFROMs. The SHARC is VLIW, so that crazy line with 3 math operations and two memory loads is also real... and executes with single clock cycle throughput.

BTW, SHARC also has two delay slots, word addressing, 48-bit instructions, and 40-bit floats. Anybody else think the designers were completely insane?

AlbertCahalan 04:24, 27 May 2007 (UTC)