[comp.sys.att] /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

aglew@urbsdc.Urbana.Gould.COM (06/16/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.

I see that you're still working on the GNU CC port, switch statements.
The above is where I gave up (the paper was due in a few days, so I
hacked pcc).
  So, what's the overall state of GCC on the 3B1? I know Alex ported
version 18, but the later versions have this rel-rel problem.
But I've heard people talk as if they are using it regularly. 
What gives? Is everybody just using old versions, or what?
  If the old versions work I'd like to use it. Unfortunately, the ftp sites
I know seem only to have recent versions and diffs back to 19. Can anybody
tell me where I can get 18 source. (I once had version 18-19 and 19-20
diffs, and 20 source, but two successive reverse patches produced a
horrible mess).


Andy "Krazy" Glew. Gould CSD-Urbana.    1101 E. University, Urbana, IL 61801   
    aglew@gould.com     	- preferred, if you have MX records
    aglew@xenurus.gould.com     - if you don't
    ...!ihnp4!uiucuxc!ccvaxa!aglew  - paths may still be the only way
   
My opinions are my own, and are not the opinions of my employer, or any
other organisation. I indicate my company only so that the reader may
account for any possible bias I may have towards our products.

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

aglew@urbsdc.Urbana.Gould.COM (06/21/88)

>> 	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)

This worries me a little bit. I have at least some hope of running
a code rearranger on the assembly output; the move statement for
switch is exactly the sort of thing that you might want to 
rearrange, except for the explicit constant. Not that code scheduling
makes much difference on a 68010 anyway...