68020/68881? (also UIPC note)

Michael "Ford" Ditto ford at cbmvax.UUCP
Fri Nov 10 23:05:35 AEST 1989


In article <18551 at rphroy.UUCP> tkacik at rphroy.UUCP (Tom Tkacik) writes:
>It should be very easy to get Gcc to generate 68020/68881 code, for the
>UnixPC.  But that is not the only problem.  Does anyone know if the 
>assembler understands 68020 code?

It certainly does.  Back in the days before Alex's gcc port I got gcc
1.14 running on the Unix PC with full 68020/881 support.  I used it as
the host for cross development to a 68020 system.  The stock Unix PC
assembler knows all the 68020 and 68881 opcodes and addressing modes.
Adb knows how to disassemble them too:

kenobi: ford: /u/ford 34> cat t.c
struct foo
{
    int x:2;
    int y:4;
    int :6;
    int z:8;
};
main()
{
    struct foo foo;
    printf("%d %d %d", foo.x, foo.y, foo.z);
    return 0;
}
kenobi: ford: /u/ford 35> gcc -m68020 t.c
ld warning:  resultant object marking: "CPU=68020,FPU=SOFTWARE",
   incompatible with CENVIRON: "CPU=,FPU="

kenobi: ford: /u/ford 36> ./a.out
Illegal instruction - core dumped
kenobi: ford: /u/ford 37> adb
main,10?ia
main:			link.w	%a6,&-4
main+4:			bfexts	-3.w(%fp){&4:&8},%d0
main+a:			mov.l	%d0,-(%sp)
main+c:			bfexts	-4.w(%fp){&2:&4},%d0
main+12:		mov.l	%d0,-(%sp)
main+14:		bfexts	-4.w(%fp){&0:&2},%d0
main+1a:		mov.l	%d0,-(%sp)
main+1c:		pea.l	-28.w(%pc)
main+20:		lea.l	printf,%a0
main+26:		jsr	(%a0)
main+28:		clr.l	%d0
main+2a:		add.w	&10,%sp
main+2e:		bra.w	main+32
main+32:		unlk	%a6
main+34:		rts
printf:
printf:			link.w	%a6,&-c
printf+4:
kenobi: ford: /u/ford 38> 

-- 
					-=] Ford [=-

"The number of Unix installations	(In Real Life:  Mike Ditto)
has grown to 10, with more expected."	ditto at amix.commodore.com
- The Unix Programmer's Manual,		...!uunet!cbmvax!ditto
  2nd Edition, June, 1972.		ford at kenobi.commodore.com



More information about the Unix-pc.general mailing list