More missing register prefixes and _C_LABEL()s for ELF. Should now compile

with ELF, but still needs an "elf2bb" program.
This commit is contained in:
mhitch 2001-03-02 16:43:25 +00:00
parent 5864b6d958
commit f9e9387cf0
9 changed files with 127 additions and 128 deletions

View File

@ -1,4 +1,4 @@
/* $NetBSD: alloc.s,v 1.6 2001/03/01 21:32:53 is Exp $ */
/* $NetBSD: alloc.s,v 1.7 2001/03/02 16:43:25 mhitch Exp $ */
/*-
* Copyright (c) 1996 The NetBSD Foundation, Inc.
@ -43,7 +43,7 @@
#include <machine/asm.h>
ENTRY_NOPROFILE(alloc)
movl %a6,sp@-
movl %a6,%sp@-
movl %pc@(_C_LABEL(SysBase):w),%a6
movl %sp@(8),%d0
movl #0x50001,%d1 | MEMF_CLEAR|MEMF_REVERSE|MEMF_PUBLIC for now.
@ -52,7 +52,7 @@ ENTRY_NOPROFILE(alloc)
rts
ENTRY_NOPROFILE(free)
movl %a6,sp@-
movl %a6,%sp@-
movl %pc@(_C_LABEL(SysBase):w),%a6
movl %sp@(8),%a1
jsr %a6@(-0x2b2) | FreeVec

View File

@ -1,4 +1,4 @@
/* $NetBSD: ashrdi3.s,v 1.5 2001/03/01 21:32:53 is Exp $ */
/* $NetBSD: ashrdi3.s,v 1.6 2001/03/02 16:43:25 mhitch Exp $ */
/*-
* Copyright (c) 1996 The NetBSD Foundation, Inc.
@ -39,8 +39,8 @@
#include <machine/asm.h>
ENTRY_NOPROFILE(__ashrdi3)
movl %d2,sp@- | 0 reg, 1 %pc, 2..4 parameters
movml %sp@(8),%d0-d2
movl %d2,%sp@- | 0 reg, 1 %pc, 2..4 parameters
movml %sp@(8),%d0-%d2
jra L2
L1:
asrl #1,%d0

View File

@ -1,4 +1,4 @@
/* $NetBSD: bbstart.s,v 1.7 2001/03/01 21:32:53 is Exp $ */
/* $NetBSD: bbstart.s,v 1.8 2001/03/02 16:43:26 mhitch Exp $ */
/*-
* Copyright (c) 1996 The NetBSD Foundation, Inc.
@ -80,28 +80,28 @@ Lreltab:
* autoload
*/
Lautoload:
movl %a6,sp@- |SysBase
movl %a1,sp@- |IORequest
movl %a6,%sp@- |SysBase
movl %a1,%sp@- |IORequest
movl #AUTOLOAD,%d0 |Howmuch
movl %d0,a1@(IOlen) | for the actual read...
movl %d0,%a1@(IOlen) | for the actual read...
movl #0x10001,%d1 |MEMF_CLEAR|MEMF_PUBLIC
jsr %a6@(LVOAllocMem)
movl %sp@+,%a1 |IORequest
movl %sp@+,%a6 |SysBase
orl %d0,d0
orl %d0,%d0
jne Lgotmem
movql #1,%d0
rts
Lgotmem:
movl %d0,sp@- |Address
movl %d0,%sp@- |Address
movl %a1@(IOoff),%sp@- |Old offset
movl %a1,sp@-
movl %a6,sp@-
movl %a1,%sp@-
movl %a6,%sp@-
/* we've set IOlen above */
movl %d0,a1@(IObuf)
movl %d0,%a1@(IObuf)
movw #Cmd_Rd,%a1@(IOcmd)
jsr %a6@(LVODoIO)
@ -113,7 +113,7 @@ Lgotmem:
jne Lioerr
addl #Lrelocate-Lzero,%sp@
movl %a6,sp@-
movl %a6,%sp@-
jsr %a6@(LVOCacheClearU)
movl %sp@+,%a6
rts
@ -140,17 +140,17 @@ Lioerr:
Lrelocate:
lea %pc@(Lzero),%a0
movl %a0,d1
movl %a0,%d1
movw %pc@(Lreltab),%a2
addl %d1,a2
addl %d1,%a2
jra Loopend
Loopw:
clrw %a2@+
movl %d1,a0 | for a variant with relative words, erase this line
movl %d1,%a0 | for a variant with relative words, erase this line
Loopb:
addl %d0,a0
addl %d1,a0@
addl %d0,%a0
addl %d1,%a0@
Loopend:
movq #0,%d0
movb %a2@,%d0
@ -162,15 +162,15 @@ Loopend:
jne Loopw
Lendtab:
movl %a6,sp@-
movl %a6,%sp@-
jsr %a6@(LVOCacheClearU)
movl %sp@+,%a6
/* We are relocated. Now it is safe to initialize _SysBase: */
movl %a6,_SysBase
movl %a6,_C_LABEL(SysBase)
movl %a1,sp@-
movl %a1,%sp@-
bsr _C_LABEL(pain)
Lerr:

View File

@ -1,4 +1,4 @@
/* $NetBSD: bcopy.s,v 1.6 2001/03/01 21:32:53 is Exp $ */
/* $NetBSD: bcopy.s,v 1.7 2001/03/02 16:43:26 mhitch Exp $ */
/*-
* Copyright (c) 1996 The NetBSD Foundation, Inc.
@ -56,7 +56,7 @@ ENTRY_NOPROFILE(bcopy)
Lcpy:
movel %sp@(12),%d0
jeq L1
cmpl %a1,a0
cmpl %a1,%a0
jcc L3
L4:
moveb %a1@+,%a0@+
@ -64,8 +64,8 @@ L4:
jne L4
rts
L3:
addl %d0,a1
addl %d0,a0
addl %d0,%a1
addl %d0,%a0
L9:
moveb %a1@-,%a0@-
subql #1,%d0

View File

@ -1,4 +1,4 @@
/* $NetBSD: libstubs.s,v 1.5 2001/03/01 21:32:53 is Exp $ */
/* $NetBSD: libstubs.s,v 1.6 2001/03/02 16:43:26 mhitch Exp $ */
/*-
* Copyright (c) 1996 The NetBSD Foundation, Inc.
@ -43,8 +43,8 @@
.comm _C_LABEL(SysBase),4
ENTRY_NOPROFILE(OpenLibrary)
movl %a6,sp@-
movl %pc@(_SysBase:w),%a6
movl %a6,%sp@-
movl %pc@(_C_LABEL(SysBase):w),%a6
movl %sp@(8),%a1
movl %sp@(12),%d0
jsr %a6@(-0x228)
@ -52,16 +52,16 @@ ENTRY_NOPROFILE(OpenLibrary)
rts
#ifdef notyet
ENTRY_NOPROFILE(CloseLibrary)
movl %a6,sp@-
movl %pc@(_SysBase:w),%a6
movl %a6,%sp@-
movl %pc@(_C_LABEL(SysBase):w),%a6
movl %sp@(8),%a1
jsr %a6@(-0x19e)
movl %sp@+,%a6
rts
#endif
ENTRY_NOPROFILE(CreateIORequest)
movl %a6,sp@-
movl %pc@(_SysBase:w),%a6
movl %a6,%sp@-
movl %pc@(_C_LABEL(SysBase):w),%a6
movl %sp@(8),%a0
movl %sp@(12),%d0
jsr %a6@(-0x28e)
@ -69,24 +69,24 @@ ENTRY_NOPROFILE(CreateIORequest)
rts
ENTRY_NOPROFILE(CreateMsgPort)
movl %a6,sp@-
movl %pc@(_SysBase:w),%a6
movl %a6,%sp@-
movl %pc@(_C_LABEL(SysBase):w),%a6
jsr %a6@(-0x29a)
movl %sp@+,%a6
rts
#ifdef notyet
ENTRY_NOPROFILE(DeleteMsgPort)
movl %a6,sp@-
movl %pc@(_SysBase:w),%a6
movl %a6,%sp@-
movl %pc@(_C_LABEL(SysBase):w),%a6
movl %sp@(8),%a0
jsr %a6@(-0x2%a0)
jsr %a6@(-0x2a0)
movl %sp@+,%a6
rts
ENTRY_NOPROFILE(DeleteIORequest)
movl %a6,sp@-
movl %pc@(_SysBase:w),%a6
movl %a6,%sp@-
movl %pc@(_C_LABEL(SysBase):w),%a6
movl %sp@(8),%a0
jsr %a6@(-0x294)
movl %sp@+,%a6
@ -94,8 +94,8 @@ ENTRY_NOPROFILE(DeleteIORequest)
#endif
ENTRY_NOPROFILE(OpenDevice)
movl %a6,sp@-
movl %pc@(_SysBase:w),%a6
movl %a6,%sp@-
movl %pc@(_C_LABEL(SysBase):w),%a6
movl %sp@(8),%a0
movl %sp@(12),%d0
movl %sp@(16),%a1
@ -105,48 +105,48 @@ ENTRY_NOPROFILE(OpenDevice)
rts
ENTRY_NOPROFILE(DoIO)
movl %a6,sp@-
movl %pc@(_SysBase:w),%a6
movl %a6,%sp@-
movl %pc@(_C_LABEL(SysBase):w),%a6
movl %sp@(8),%a1
jsr %a6@(-0x1c8)
movl %sp@+,%a6
rts
#ifdef nomore
ENTRY_NOPROFILE(CheckIO)
movl %a6,sp@-
movl %pc@(_SysBase:w),%a6
movl %a6,%sp@-
movl %pc@(_C_LABEL(SysBase):w),%a6
movl %sp@(8),%a1
jsr %a6@(-0x1%d4)
jsr %a6@(-0x1d4)
movl %sp@+,%a6
rts
#endif
ENTRY_NOPROFILE(WaitIO)
movl %a6,sp@-
movl %pc@(_SysBase:w),%a6
movl %a6,%sp@-
movl %pc@(_C_LABEL(SysBase):w),%a6
movl %sp@(8),%a1
jsr %a6@(-0x1da)
movl %sp@+,%a6
rts
ENTRY_NOPROFILE(SendIO)
movl %a6,sp@-
movl %pc@(_SysBase:w),%a6
movl %a6,%sp@-
movl %pc@(_C_LABEL(SysBase):w),%a6
movl %sp@(8),%a1
jsr %a6@(-0x1ce)
movl %sp@+,%a6
rts
ENTRY_NOPROFILE(AbortIO)
movl %a6,sp@-
movl %pc@(_SysBase:w),%a6
movl %a6,%sp@-
movl %pc@(_C_LABEL(SysBase):w),%a6
movl %sp@(8),%a1
jsr %a6@(-0x1e0)
movl %sp@+,%a6
rts
ENTRY_NOPROFILE(WaitPort)
movl %a6,sp@-
movl %pc@(_SysBase:w),%a6
movl %a6,%sp@-
movl %pc@(_C_LABEL(SysBase):w),%a6
movl %sp@(8),%a0
jsr %a6@(-0x180)
movl %sp@+,%a6
@ -154,15 +154,15 @@ ENTRY_NOPROFILE(WaitPort)
#ifndef DOINLINES
ENTRY_NOPROFILE(CacheClearU)
movl %a6,sp@-
movl %pc@(_SysBase:w),%a6
movl %a6,%sp@-
movl %pc@(_C_LABEL(SysBase):w),%a6
jsr %a6@(-0x27c)
movl %sp@+,%a6
rts
#endif
ENTRY_NOPROFILE(CachePreDMA)
movl %a6,sp@-
movl %pc@(_SysBase:w),%a6
movl %a6,%sp@-
movl %pc@(_C_LABEL(SysBase):w),%a6
movl %sp@(8),%a0
movl %sp@(12),%a1
movl %sp@(16),%d0
@ -171,31 +171,31 @@ ENTRY_NOPROFILE(CachePreDMA)
rts
ENTRY_NOPROFILE(FindResident)
movl %a6,sp@-
movl %pc@(_SysBase:w),%a6
movl %a6,%sp@-
movl %pc@(_C_LABEL(SysBase):w),%a6
movl %sp@(8),%a1
jsr %a6@(-0x60)
movl %sp@+,%a6
rts
ENTRY_NOPROFILE(OpenResource)
movl %a6,sp@-
movl %pc@(_SysBase:w),%a6
movl %a6,%sp@-
movl %pc@(_C_LABEL(SysBase):w),%a6
movl %sp@(8),%a1
jsr %a6@(-0x1f2)
movl %sp@+,%a6
rts
#ifdef notyet
ENTRY_NOPROFILE(Forbid)
movl %a6,sp@-
movl %pc@(_SysBase:W),%a6
movl %a6,%sp@-
movl %pc@(_C_LABEL(SysBase):W),%a6
jsr %a6@(-0x84)
movl %sp@+,%a6
rts
ENTRY_NOPROFILE(Permit)
movl %a6,sp@-
movl %pc@(_SysBase:W),%a6
movl %a6,%sp@-
movl %pc@(_C_LABEL(SysBase):W),%a6
jsr %a6@(-0x8a)
movl %sp@+,%a6
rts
@ -205,11 +205,11 @@ ENTRY_NOPROFILE(Permit)
* Intuition.library functions.
*/
.comm _IntuitionBase,4
.comm _C_LABEL(IntuitionBase),4
ENTRY_NOPROFILE(OpenScreenTagList)
movl %a6,sp@-
movl %pc@(_IntuitionBase:w),%a6
movl %a6,%sp@-
movl %pc@(_C_LABEL(IntuitionBase):w),%a6
movl %sp@(8),%a0
movl %sp@(12),%a1
jsr %a6@(-0x264)
@ -217,8 +217,8 @@ ENTRY_NOPROFILE(OpenScreenTagList)
rts
ENTRY_NOPROFILE(OpenWindowTagList)
movl %a6,sp@-
movl %pc@(_IntuitionBase:w),%a6
movl %a6,%sp@-
movl %pc@(_C_LABEL(IntuitionBase):w),%a6
movl %sp@(8),%a0
movl %sp@(12),%a1
jsr %a6@(-0x25e)
@ -226,10 +226,10 @@ ENTRY_NOPROFILE(OpenWindowTagList)
rts
#ifdef nomore
ENTRY_NOPROFILE(mytime)
movl %a6,sp@-
movl %pc@(_IntuitionBase:w),%a6
movl %a6,%sp@-
movl %pc@(_C_LABEL(IntuitionBase):w),%a6
subql #8,%sp
movl %sp,a0
movl %sp,%a0
lea %sp@(4),%a1
jsr %a6@(-0x54)
movl %sp@+,%d0
@ -237,10 +237,10 @@ ENTRY_NOPROFILE(mytime)
movl %sp@+,%a6
rts
#endif
.comm _ExpansionBase,4
.comm _C_LABEL(ExpansionBase),4
ENTRY_NOPROFILE(FindConfigDev)
movl %a6,sp@-
movl _ExpansionBase,%a6
movl %a6,%sp@-
movl _C_LABEL(ExpansionBase),%a6
movl %sp@(8),%a0
movl %sp@(12),%d0
movl %sp@(16),%d1

View File

@ -1,4 +1,4 @@
/* $NetBSD: muldi3.s,v 1.5 2001/03/01 21:32:53 is Exp $ */
/* $NetBSD: muldi3.s,v 1.6 2001/03/02 16:43:26 mhitch Exp $ */
/*-
* Copyright (c) 1996 The NetBSD Foundation, Inc.
@ -38,8 +38,8 @@
#include <machine/asm.h>
ENTRY_NOPROFILE(__muldi3)
movml %d2/d3/%d4/d5/%d6,sp@- | 0..4 regs, 5 %pc, 6..9 parameters
movml %sp@(24),%d2-d5
movml %d2/%d3/%d4/%d5/%d6,%sp@- | 0..4 regs, 5 %pc, 6..9 parameters
movml %sp@(24),%d2-%d5
| movl %sp@(24),%d2
| movl %sp@(28),%d3
| movl %sp@(32),%d4
@ -51,12 +51,12 @@ L4:
asrl #1,%d2
roxrl #1,%d3
jcc L5
addl %d5,d1
addxl %d4,d0
addl %d5,%d1
addxl %d4,%d0
L5:
addl %d5,d5
addxl %d4,d4
addl %d5,%d5
addxl %d4,%d4
L7:
dbra %d6,L4
movml %sp@+,%d2/d3/%d4/d5/%d6
movml %sp@+,%d2/%d3/%d4/%d5/%d6
rts

View File

@ -1,4 +1,4 @@
/* $NetBSD: printf.s,v 1.5 2001/03/01 21:32:53 is Exp $ */
/* $NetBSD: printf.s,v 1.6 2001/03/02 16:43:26 mhitch Exp $ */
/*-
* Copyright (c) 1996 The NetBSD Foundation, Inc.
@ -44,7 +44,7 @@
.text
.even
Lputch:
movl %d0,sp@-
movl %d0,%sp@-
bsr _C_LABEL(putchar)
addql #4,%sp
rts
@ -63,7 +63,6 @@ Lstorech:
movb %d0, %a3@+
rts
.globl _sprintf
ENTRY_NOPROFILE(sprintf)
movml #0x0032,%sp@-
movl %sp@(16),%a3

View File

@ -1,4 +1,4 @@
/* $NetBSD: startit.s,v 1.7 2001/03/01 21:32:53 is Exp $ */
/* $NetBSD: startit.s,v 1.8 2001/03/02 16:43:26 mhitch Exp $ */
/*
* Copyright (c) 1996 Ignatios Souvatzis
@ -31,7 +31,7 @@
* THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*
*
* From: $NetBSD: startit.s,v 1.7 2001/03/01 21:32:53 is Exp $
* From: $NetBSD: startit.s,v 1.8 2001/03/02 16:43:26 mhitch Exp $
*/
#include <machine/asm.h>
@ -49,7 +49,7 @@ ENTRY_NOPROFILE(startit)
moveb #31,0x200003c9
moveb #31,0x200003c9
#endif
movel %sp,a3
movel %sp,%a3
movel 4:w,%a6
lea %pc@(start_super:w),%a5
jmp %a6@(-0x1e) | supervisor-call
@ -58,7 +58,7 @@ start_super:
#if TESTONAMIGA
movew #0x900,0xdff180 | dark red
#endif
movew #0x2700,sr
movew #0x2700,%sr
| the BSD kernel wants values into the following registers:
| %a0: fastmem-start
@ -73,7 +73,7 @@ start_super:
| %a2: Inhibit sync flags
| All other registers zeroed for possible future requirements.
lea %pc@(_startit:w),%sp | make sure we have a good stack ***
lea %pc@(_C_LABEL(startit):w),%sp | make sure we have a good stack ***
movel %a3@(4),%a1 | loaded kernel
movel %a3@(8),%d2 | length of loaded kernel
@ -115,7 +115,7 @@ start_super:
| Turn off 68040/060 MMU
subl %a5,a5
subl %a5,%a5
.word 0x4e7b,0xd003 | movec %a5,tc
.word 0x4e7b,0xd806 | movec %a5,urp
.word 0x4e7b,0xd807 | movec %a5,srp
@ -127,10 +127,10 @@ start_super:
not040:
lea %pc@(zero:w),%a5
pmove %a5@,tc | Turn off MMU
pmove %a5@,%tc | Turn off MMU
lea %pc@(nullrp:w),%a5
pmove %a5@,crp | Turn off MMU some more
pmove %a5@,srp | Really, really, turn off MMU
pmove %a5@,%crp | Turn off MMU some more
pmove %a5@,%srp | Really, really, turn off MMU
| Turn off 68030 TT registers
@ -158,45 +158,45 @@ nott:
| removed Z flag
| tstl %a3 | Can we load to fastmem?
| jeq L0 | No, leave destination at 0
movl %a0,a3 | Move to start of fastmem chunk
addl %a0,a6 | relocate kernel entry point
movl %a0,%a3 | Move to start of fastmem chunk
addl %a0,%a6 | relocate kernel entry point
addl #3,%d2
andl #0xfffffffc,%d2 | round up.
| determine if the kernel need be copied upwards or downwards
cmpl %a1,a3 | %a3-a1
cmpl %a1,%a3 | %a3-a1
bcs above | source is above
movl %a0,sp
addl %d0,sp | move the stack to the end of segment
movl %a0,%sp
addl %d0,%sp | move the stack to the end of segment
| copy from below upwards requires copying from end to start.
addl %d2,a3 | one long word past
addl %d2,a1 | one long word past
addl %d2,%a3 | one long word past
addl %d2,%a1 | one long word past
subl #4,%sp | alloc space
movl %a1,sp@- | save source
movl %a3,sp@- | save destination
movl %a1,%sp@- | save source
movl %a3,%sp@- | save destination
| copy copier to end of segment
movl %sp,a3
movl %sp,%a3
subl #256,%a3 | end of segment save our stack
lea %pc@(_startit_end:w),%a1
movl %a0,sp@- | save segment start
lea %pc@(_C_LABEL(startit_end):w),%a1
movl %a0,%sp@- | save segment start
lea %pc@(below:w),%a0
L0: movw %a1@-,%a3@-
cmpl %a0,a1
cmpl %a0,%a1
bne L0
movl %sp@,%a0 | restore segment start
movl %a3,sp@ | address of relocated below
movl %a3,%sp@ | address of relocated below
addl #(ckend - below),%a3
movl %a3,sp@(12) | address of ckend for later
movl %a3,%sp@(12) | address of ckend for later
| ---- switch off cache ----
bra Lchoff | and to relocated below
@ -216,8 +216,8 @@ above: movl %a1@+,%a3@+
bne above
lea %pc@(ckend:w),%a1
movl %a3,sp@-
pea %pc@(_startit_end:w)
movl %a3,%sp@-
pea %pc@(_C_LABEL(startit_end):w)
L2:
movl %a1@+,%a3@+
cmpl %sp@,%a1
@ -238,9 +238,9 @@ L2:
Lchoff: btst #3,%d5
jeq L3c
.word 0xf4f8
L3c: movl %d2,sp@- | save %d2
L3c: movl %d2,%sp@- | save %d2
movql #0,%d2 | switch off cache to ensure we use
movec %d2,cacr | valid kernel data
movec %d2,%cacr | valid kernel data
movl %sp@+,%d2 | restore %d2
rts
@ -257,14 +257,14 @@ ckend:
moveb #63,0x200003c9
#endif
movl %d5,d2
movl %d5,%d2
roll #8,%d2
cmpb #0x7D,%d2
jne noDraCo
| DraCo: switch off MMU now:
subl %a5,a5
subl %a5,%a5
.word 0x4e7b,0xd003 | movec %a5,tc
.word 0x4e7b,0xd806 | movec %a5,urp
.word 0x4e7b,0xd807 | movec %a5,srp
@ -275,11 +275,11 @@ ckend:
noDraCo:
moveq #0,%d2 | zero out unused registers
movel %d2,a1 | (might make future compatibility
movel %d2,a3 | would have known contents)
movel %d2,a5
movel %a6,sp | entry point into stack pointer
movel %d2,a6
movel %d2,%a1 | (might make future compatibility
movel %d2,%a3 | would have known contents)
movel %d2,%a5
movel %a6,%sp | entry point into stack pointer
movel %d2,%a6
#if TESTONAMIGA
movew #0x0F0,0xdff180 | green

View File

@ -5,7 +5,7 @@ pea[ ][_A-Za-z][A-Za-z0-9_]*$ {printf("pea");munchit(yytext+3);}
\ [_A-Za-z][A-Za-z0-9_]*/\, munchit(yytext);
. putchar(*yytext);
%%
/* $NetBSD: txlt.l,v 1.2 1998/01/05 21:34:56 perry Exp $ */
/* $NetBSD: txlt.l,v 1.3 2001/03/02 16:43:25 mhitch Exp $ */
void
munchit(s)
@ -17,5 +17,5 @@ munchit(s)
((*s == 'a') || (*s == 'd')) && ((s[1]-'0')<=7))
printf("%s", s);
else
printf("pc@(%s)",s);
printf("%%pc@(%s)",s);
}