ack/mach/m68k4/libsys/head_em.s

82 lines
1.2 KiB
ArmAsm
Raw Normal View History

1985-03-26 15:04:46 +00:00
.define .lino,.filn
1992-06-30 16:10:24 +00:00
.define EXIT,WRITE,BRK
1985-03-26 15:04:46 +00:00
.define begtext,begdata,begbss
1987-01-21 15:21:49 +00:00
.define EARRAY,ERANGE,ESET,EIDIVZ,EHEAP,EILLINS,ECASE,EBADGTO
1985-03-26 15:04:46 +00:00
.define hol0,.reghp,.limhp,.trpim,.trppc
1987-01-21 15:21:49 +00:00
.sect .text
.sect .rom
.sect .data
.sect .bss
1985-03-26 15:04:46 +00:00
1987-01-21 15:21:49 +00:00
! EM runtime start-off for the Bleasdale 68000 system
1985-03-26 15:04:46 +00:00
LINO_AD = 0
FILN_AD = 4
EARRAY = 0
ERANGE = 1
ESET = 2
EIDIVZ = 6
EHEAP = 17
EILLINS = 18
ECASE = 20
1987-01-21 15:21:49 +00:00
EBADGTO = 27
1985-03-26 15:04:46 +00:00
1987-01-21 15:21:49 +00:00
.sect .text
1985-03-26 15:04:46 +00:00
begtext:
! Bleasdale puts the argument and environment vectors
! themselves on top of the stack, instead of POINTERS
! to these vectors. We get things right here.
move.l 4(sp),a0
clr.l -4(a0)
move.l sp,a0
sub.l #8,sp
move.l (a0),(sp)
add.l #4,a0
move.l a0,4(sp)
1:
tst.l (a0)+
bne 1b
move.l 4(sp),a1
cmp.l (a1),a0
blt 2f
sub.l #4,a0
2:
move.l a0,8(sp)
! Now the stack contains an argc (4 bytes), argv-pointer and
! envp pointer.
1991-03-06 14:26:16 +00:00
jsr __m_a_i_n
1985-03-26 15:04:46 +00:00
add #012,sp
EXIT:
1987-03-03 11:22:29 +00:00
move.l d0,-(sp)
1985-03-26 15:04:46 +00:00
jsr __exit
1992-06-30 16:10:24 +00:00
WRITE: jmp __write
BRK: jmp __brk
1987-01-21 15:21:49 +00:00
.sect .data
1985-03-26 15:04:46 +00:00
begdata:
hol0:
.lino:
1987-01-21 15:21:49 +00:00
.data4 0 ! lino
1985-03-26 15:04:46 +00:00
.filn:
1987-01-21 15:21:49 +00:00
.data4 0 ! filn
1985-03-26 15:04:46 +00:00
.reghp:
1987-01-21 15:21:49 +00:00
.data4 endbss
1985-03-26 15:04:46 +00:00
.limhp:
1987-01-21 15:21:49 +00:00
.data4 endbss
1985-03-26 15:04:46 +00:00
.trppc:
1987-01-21 15:21:49 +00:00
.data4 0
1985-03-26 15:04:46 +00:00
.trpim:
1987-01-21 15:21:49 +00:00
.data4 0
1985-03-26 15:04:46 +00:00
1987-01-21 15:21:49 +00:00
.sect .bss
begbss: !initialization is not needed because ALL entries are in zero space!