[unix-pc.general] /bin/as

alex@umbc3.UMD.EDU (Alex S. Crain) (06/15/88)

	ARRRGGGGGG! Has anyone ever managed to get the %!*$# assembler to
take rel-rel expressions? Ie: some thing like

	mov.w	L2-L1(%pc,%d0.w),%d0
		^^^^^
or

	set arf,.+1    # or ~+1, or any other syntax that you like
		^^^

The manual states that this is supposed to work, but should be used with 
caution. In reality, all I can get is syntax errors.

	This sucks.

-- 
					:alex.

nerwin!alex@umbc3.umd.edu
alex@umbc3.umd.edu

ford@elgar.UUCP (Mike "Ford" Ditto) (06/17/88)

In article <1018@umbc3.UMD.EDU> alex@umbc3.UMD.EDU (Alex S. Crain) writes:
>
>	ARRRGGGGGG! Has anyone ever managed to get the %!*$# assembler to
>take rel-rel expressions? Ie: some thing like
>
>	mov.w	L2-L1(%pc,%d0.w),%d0

Although the manual does that they can be used ("with caution"),
trying to use them quickly shows that this is not true.  There is one
way to make them work (and even with no "caution" required): use the
swbeg statement.  This is an incredibly bogus "feature" of the
assembler, which is used like so:

L1:
	swbeg	&3	# the 3 is the number of rel-rel short's which follow
	short	L2-L1
	short	L3-L1
	short	L4-L1
L2:
	mov.l	&42,%d0
	bra	L5
L3:
	mov.l	&99,%d0
	bra	L5
L4:
	etc...

Obviously, this is only helpful if you want to store the rel-rel
expressions in a table.

That is what is output by the SGS C compiler, and the assembler takes
it just fine.  I couldn't make GNU CC output the swbeg statement, so
I just had it never generate switch tables until I figure out a way
around it.

>or
>
>	set arf,.+1    # or ~+1, or any other syntax that you like
>		^^^

~ is the proper symbol for location counter, and I have used it
successfully, although not in a "set" directive.


					-=] Ford [=-

"Once there were parking lots,		(In Real Life:  Mike Ditto)
now it's a peaceful oasis.		ford@kenobi.cts.com
This was a Pizza Hut,			...!sdcsvax!crash!kenobi!ford
now it's all covered with daisies." -- Talking Heads

rrr@naucse.UUCP (Bob Rose ) (06/18/88)

In article <1018@umbc3.UMD.EDU>, alex@umbc3.UMD.EDU (Alex S. Crain) writes:
> 
> 	ARRRGGGGGG! Has anyone ever managed to get the %!*$# assembler to
> take rel-rel expressions? Ie: some thing like
> 
> 	mov.w	L2-L1(%pc,%d0.w),%d0
> 		^^^^^
Alex, this looks just like the code gcc produces. AMAZING! :^)
If you are tring to get gcc-1.22 up just replace the L2-L1
(or any labels they may happen to be) with the magic number ten. (i.e. 10)
(It occurs three times in tm-3b1.h)
Also since were on the subject of gcc I've been doing some hacking
on it myself, you may be interested in the following drystones.

		 Compile time		drystones/second
					 noreg     reg

cc		1m51.96s real		 998.3	1071.4
		  58.95s user
		  12.46s sys

gcc		2m17.31s real		1020.4	1020.4
		  53.25s user
		  13.91s sys

gcc-hack1	2m36.78s real		1207.2	1207.2
		  53.70s user
		  16.73s sys

When I get it working (yes I broke it but it runs so much faster)
I'll post the diff.
                              -bob