Adapted to use of new assembler & linker

This commit is contained in:
keie 1985-06-04 10:57:42 +00:00
parent fa2547ddf7
commit a9bbf81f93
36 changed files with 230 additions and 87 deletions

View file

@ -1,12 +1,16 @@
.define .sar
.define .lar
.define .aar
.sect .text
.sect .rom
.sect .data
.sect .bss
!register usage:
! a0 : descriptor address
! d0 : index
! a1 : base address
.text
.sect .text
.aar:
move.l (sp)+,d2 ! return address
move.l (sp)+,a0

View file

@ -1,6 +1,10 @@
.define .cii
.sect .text
.sect .rom
.sect .data
.sect .bss
.text
.sect .text
.cii:
move.l (sp)+,a0 ! return address
move (sp)+,d0 ! destination size

View file

@ -1,8 +1,12 @@
.define .cmi, .cmi_
.sect .text
.sect .rom
.sect .data
.sect .bss
! NUM == 4
! result in d1
.text
.sect .text
.cmi:
.cmi_:
move.l (sp)+,a0

View file

@ -1,6 +1,10 @@
.define .cmp
.sect .text
.sect .rom
.sect .data
.sect .bss
.text
.sect .text
.cmp:
move.l (sp)+,a0 ! return address
move.l #1,d1

View file

@ -1,8 +1,12 @@
.define .cms
.sect .text
.sect .rom
.sect .data
.sect .bss
! d0 contains set size
.text
.sect .text
.cms:
move.l (sp)+,d2 ! return address
move.l sp,a0

View file

@ -1,7 +1,11 @@
.define .cmu
.sect .text
.sect .rom
.sect .data
.sect .bss
! d0 : # bytes of 1 block
.text
.sect .text
.cmu:
move.l (sp)+,d2 ! reta
move.l sp,a0 ! top block

View file

@ -1,6 +1,10 @@
.define .csa
.sect .text
.sect .rom
.sect .data
.sect .bss
.text
.sect .text
.csa:
move.l (sp)+,a0 ! case descriptor
move (sp)+,d0 ! index

View file

@ -1,6 +1,10 @@
.define .csb
.sect .text
.sect .rom
.sect .data
.sect .bss
.text
.sect .text
.csb:
move.l (sp)+,a0 ! case descriptor
move (sp)+,d0 ! index

View file

@ -1,8 +1,12 @@
.define .ciu
.define .cui
.define .cuu
.sect .text
.sect .rom
.sect .data
.sect .bss
.text
.sect .text
.ciu:
.cui:
.cuu:

View file

@ -1,6 +1,10 @@
.define .cfi,.cif,.cfu,.cuf,.cff
.sect .text
.sect .rom
.sect .data
.sect .bss
.text
.sect .text
! this is a dummy float conversion routine
.cfi:

View file

@ -1,12 +1,16 @@
.define .diagnos
.sect .text
.sect .rom
.sect .data
.sect .bss
space = 040
del = 0177
.text
.sect .text
.diagnos:
move.w hol0,-(sp)
move.l hol0+FILN_AD,d2
move.l hol0+4,d2
beq 1f
move.l d2,a0
move.l #40,d0
@ -31,7 +35,7 @@ del = 0177
move.l #unknwn,d2
bra 2b
.data
.sect .data
fmt: .asciz "%s, line %d: "
unknwn: .asciz "unknown file"
.align 2

View file

@ -1,7 +1,11 @@
.define .dvi
.sect .text
.sect .rom
.sect .data
.sect .bss
! signed long divide
.text
.sect .text
.dvi:
move.l (sp)+,a0 ! return address
move.l (sp)+,d0

View file

@ -1,4 +1,8 @@
.define .dvu
.sect .text
.sect .rom
.sect .data
.sect .bss
! unsigned long divide
! register usage:
@ -6,7 +10,7 @@
! d1 dividend
! exit : d1 quotient
! d2 remainder
.text
.sect .text
.dvu:
move.l (sp)+,a1 ! return address
move.l (sp)+,d0

View file

@ -1,14 +1,16 @@
.define endtext,enddata,endbss,_etext,_edata,_end
.sect .text
.sect .rom
.sect .data
.sect .bss
.sect .end ! only for declaration of _end and endbss.
.text
.align 2
.sect .text
endtext:
_etext:
.data
.align 2
.sect .data
enddata:
_edata:
.bss
.align 2
endbss:
.sect .end
_end:
endbss:

View file

@ -1,7 +1,11 @@
.define .exg
.sect .text
.sect .rom
.sect .data
.sect .bss
! d0 : exchange size in bytes
.text
.sect .text
.exg:
move.l (sp)+,d2 ! return address
move.l sp,a1

View file

@ -1,6 +1,10 @@
.define .fat
.sect .text
.sect .rom
.sect .data
.sect .bss
.text
.sect .text
.fat:
jsr .trp
jmp EXIT

18
mach/m68k2/libem/ffp.s Normal file
View file

@ -0,0 +1,18 @@
.define .cmf8, .cif8, .dvf8, .adf8, .ngf8, .mlf8, .fif8, .fef8, .cff4
.sect .text
.sect .rom
.sect .data
.sect .bss
.sect .text
.cmf8:
.cif8:
.dvf8:
.adf8:
.ngf8:
.mlf8:
.fif8:
.fef8:
.cff4:
move.w #EILLINS,-(sp)
jmp .fat

View file

@ -1,4 +1,8 @@
.define .gto
.sect .text
.sect .rom
.sect .data
.sect .bss
.extern .gto
.gto:
@ -69,7 +73,7 @@ etabd:
etaba:
move.l d2,a1
jmp (a1) ! return
.data
savd0: .long 0
savd1: .long 0
.text
.sect .data
savd0: .data4 0
savd1: .data4 0
.sect .text

View file

@ -1,9 +1,13 @@
.define .inn
.sect .text
.sect .rom
.sect .data
.sect .bss
! d0 : set size in bytes
! d1 : bitnumber
.text
.sect .text
.inn:
move.l (sp)+,d2 ! return address
move.w (sp)+,d1

View file

@ -1,8 +1,12 @@
.define .los
.sect .text
.sect .rom
.sect .data
.sect .bss
! d0 : # bytes
! a0 : source address
.text
.sect .text
.los:
move.l (sp)+,a1
move.w (sp)+,d0

View file

@ -1,4 +1,8 @@
.define .lpb
.sect .text
.sect .rom
.sect .data
.sect .bss
.extern .lpb
.lpb:
! convert local to argument base

View file

@ -1,4 +1,8 @@
.define .lxa
.sect .text
.sect .rom
.sect .data
.sect .bss
.extern .lxa
.lxa:
! #levels (>= 0) on stack

View file

@ -1,4 +1,8 @@
.define .lxl
.sect .text
.sect .rom
.sect .data
.sect .bss
.extern .lxl
.lxl:
! #levels on stack (> 0)

View file

@ -1,7 +1,11 @@
.define .mli
.sect .text
.sect .rom
.sect .data
.sect .bss
.text
.sect .text
.mli:
move.l (sp)+,a0
move.l (sp)+,d1

View file

@ -1,11 +1,15 @@
.define .mlu
.sect .text
.sect .rom
.sect .data
.sect .bss
! entry : d0 multiplicand
! d1 multiplier
! exit : d0 high order result
! d1 low order result
.text
.sect .text
.mlu:
move.l (sp)+,a1
move.l (sp)+,d1

View file

@ -1,5 +1,9 @@
.define .mon
.text
.sect .text
.sect .rom
.sect .data
.sect .bss
.sect .text
.mon:
move.l (sp)+,a0
pea fmt
@ -7,6 +11,6 @@
add #6,sp
jmp EXIT
.data
.sect .data
fmt: .asciz "system call %d not implemented"
.align 2

View file

@ -1,6 +1,10 @@
.define .nop
.sect .text
.sect .rom
.sect .data
.sect .bss
.text
.sect .text
.nop:
move.w hol0,-(sp)
pea fmt
@ -8,6 +12,6 @@
add #6,sp
rts
.data
.sect .data
fmt: .asciz "test %d\n"
.align 2

View file

@ -1,6 +1,10 @@
.define _printn
.define _printf
.text
.sect .text
.sect .rom
.sect .data
.sect .bss
.sect .text
_putchar:
move.w #1,-(sp)
pea 7(sp)
@ -10,14 +14,14 @@ _putchar:
rts
_printf:
link a6,#-12
.data
.sect .data
_12:
.short 28786
.short 26990
.short 29798
.short 11875
.short 0
.text
.data2 28786
.data2 26990
.data2 29798
.data2 11875
.data2 0
.sect .text
pea 8+4(a6)
move.l (sp)+,-6(a6)
I004:
@ -138,15 +142,15 @@ I002:
rts
_printn:
link a6,#-2
.data
.sect .data
_15:
.short 12337
.short 12851
.short 13365
.short 13879
.short 14393
.short 0
.text
.data2 12337
.data2 12851
.data2 13365
.data2 13879
.data2 14393
.data2 0
.sect .text
move.w 8+0(a6),-(sp)
move.w #10,-(sp)
move.w (sp)+,d0

View file

@ -1,6 +1,10 @@
.define .rck
.sect .text
.sect .rom
.sect .data
.sect .bss
.text
.sect .text
.rck:
move.l (sp)+,a1
move.l (sp)+,a0 ! descriptor address

View file

@ -1,6 +1,10 @@
.define .ret
.sect .text
.sect .rom
.sect .data
.sect .bss
.text
.sect .text
.ret:
beq 3f
cmp #2,d0

View file

@ -1,8 +1,12 @@
.define .set
.sect .text
.sect .rom
.sect .data
.sect .bss
! d0 : setsize in bytes
! d1 : bitnumber
.text
.sect .text
.set:
move.l (sp)+,a0
move.w (sp)+,d1

View file

@ -1,6 +1,10 @@
.define .strhp
.sect .text
.sect .rom
.sect .data
.sect .bss
.text
.sect .text
.strhp:
move.l (sp)+,a0
move.l (sp)+,d0 ! heap pointer

View file

@ -1,6 +1,10 @@
.define .sig
.sect .text
.sect .rom
.sect .data
.sect .bss
.text
.sect .text
.sig:
move.l (sp)+,a0
move.l (sp)+,a1 ! trap pc

View file

@ -1,8 +1,12 @@
.define .sts
.sect .text
.sect .rom
.sect .data
.sect .bss
! d0 : # bytes
! a0 : destination address
.text
.sect .text
.sts:
move.l (sp)+,a1
move.w (sp)+,d0

View file

@ -1,6 +1,10 @@
.define .trp
.sect .text
.sect .rom
.sect .data
.sect .bss
.text
.sect .text
.trp:
move.l (sp)+,a1 ! return address
move.w (sp)+,d0 ! error number
@ -30,7 +34,7 @@
jsr .diagnos
jmp EXIT
.data
.rettrp: .long 0
.sect .data
.rettrp: .data4 0
fmt: .asciz "trap %d called\n"
.align 2

View file

@ -1,23 +1,18 @@
.define CERASE,CKILL,CSTOP,CSTART
.define .lino,.filn
.define F_DUM,EXIT
.define EXIT
.define begtext,begdata,begbss
.define EARRAY,ERANGE,ESET,EIDIVZ,EHEAP,EILLINS,ECASE,EBADGTO
.define hol0,.reghp,.limhp,.trpim,.trppc
.define LINO_AD,FILN_AD
.sect .text
.sect .rom
.sect .data
.sect .bss
! EM runtime start-off for the Bleasdale 68000 system
CERASE = 010
CKILL = 030
CSTART = 021
CSTOP = 023
F_DUM = 0
LINO_AD = 0
FILN_AD = 4
@ -30,8 +25,7 @@ EILLINS = 18
ECASE = 20
EBADGTO = 27
.base 0x20000
.text
.sect .text
begtext:
! Bleasdale puts the argument and environment vectors
! themselves on top of the stack, instead of POINTERS
@ -57,30 +51,27 @@ begtext:
! envp pointer.
add.l #2,sp !convert argc from 4-byte to 2-byte
pea endbss
jsr _brk
add.l #4,sp
jsr _m_a_i_n
add #010,sp
EXIT:
jsr __exit
.data
.sect .data
begdata:
hol0:
.lino:
.short 0,0 ! lino
.data2 0,0 ! lino
.filn:
.long 0 ! filn
.data4 0 ! filn
.reghp:
.long endbss
.data4 endbss
.limhp:
.long endbss
.data4 endbss
.trppc:
.long 0
.data4 0
.trpim:
.short 0
.data2 0
.bss
begbss:
.sect .bss
begbss: !initialization is not needed because ALL entries are in zero space!