Relay-Version: version B 2.10 5/3/83; site utzoo.UUCP
Posting-Version: version B 2.10.2 9/17/84; site gatech.UUCP
Path: utzoo!watmath!clyde!burl!ulysses!mhuxj!ihnp4!zehntel!dual!amd!decwrl!decvax!mcnc!akgua!gatech!arnold
From: arnold@gatech.UUCP (Mister Snufilupagus)
Newsgroups: net.lang.c
Subject: Re: Using &LABEL
Message-ID: <10294@gatech.UUCP>
Date: Wed, 19-Sep-84 12:23:14 EDT
Article-I.D.: gatech.10294
Posted: Wed Sep 19 12:23:14 1984
Date-Received: Wed, 26-Sep-84 07:28:16 EDT
References: rabbit.3115, <3185@ecsvax.UUCP> <9406@brunix.UUCP> <15@tikal.UUCP>
Organization: Sesame Street
Lines: 29

> 	In response to the idea of switches implementing jump tables, I would
> 	like to know how many C compilers really generate jump tables.

The Georgia Tech C compiler for Prime computers implements switches as
a CGT instruction.  Guess what this is.  Yes, believe it or not, a Computed
GOTO instruction, in the hardware! (yuch, barf...)

It is exactly a jump table, implemented in the micro code.  Very fast.  You
put the value in the A register.  The next word contains the number of one
word addresses following the CGT, and the data itself.  The A register
is used as the index into the list of addresses following the instruction:

	LDA  
	CGT
	DATA	
	ADDR1
	ADDR2
	ADDR3
	....

So at least one compile does use jump tables.  The Cyber Pascal compiler
will also generate a jump table in certain conditions, which are fairly
common, especially in student code.
-- 
Arnold Robbins
CSNET: arnold@gatech	ARPA:	arnold%gatech.csnet@csnet-relay.arpa
UUCP: { akgua, allegra, hplabs, ihnp4 }!gatech!arnold

Can you tell me how to get, how to get to Sesame Street?