Re:Bug #48669: PHP now includes GOTO
by ivanstojic on Friday August 21, 2009 @05:35PM
(#778530)
Next up, PHP 6 will include ComeFrom.
[ Parent
| on HN ]
comefrom is an excellent and seriously useful instruction.
My team has (kind of) implemented it in hardware as a way of patching ROM code in RAM. When the PC becomes equal to an address in the comefrom table, the PC is loaded with a RAM address and execution continues there.
If you have a big chunk of code that could need small tweaks, storing it in ROM and implementing a small RAM alongside it saves a lot of chip area.
I'm almost 100% sure Freescale does this on some of their 32-bit microcontrollers.
Yes, I design ICs. No, I do not work for Freescale.