From a9bbf81f93223e46b9583ffedcc6eea4e82a8986 Mon Sep 17 00:00:00 2001 From: keie Date: Tue, 4 Jun 1985 10:57:42 +0000 Subject: [PATCH] Adapted to use of new assembler & linker --- mach/m68k2/libem/ara.s | 6 +++++- mach/m68k2/libem/cii.s | 6 +++++- mach/m68k2/libem/cmi.s | 6 +++++- mach/m68k2/libem/cmp.s | 6 +++++- mach/m68k2/libem/cms.s | 6 +++++- mach/m68k2/libem/cmu.s | 6 +++++- mach/m68k2/libem/csa.s | 6 +++++- mach/m68k2/libem/csb.s | 6 +++++- mach/m68k2/libem/cuu.s | 6 +++++- mach/m68k2/libem/cvf.s | 6 +++++- mach/m68k2/libem/dia.s | 10 ++++++--- mach/m68k2/libem/dvi.s | 6 +++++- mach/m68k2/libem/dvu.s | 6 +++++- mach/m68k2/libem/end.s | 16 ++++++++------ mach/m68k2/libem/exg.s | 6 +++++- mach/m68k2/libem/fat.s | 6 +++++- mach/m68k2/libem/ffp.s | 18 ++++++++++++++++ mach/m68k2/libem/gto.s | 12 +++++++---- mach/m68k2/libem/inn.s | 6 +++++- mach/m68k2/libem/los.s | 6 +++++- mach/m68k2/libem/lpb.s | 4 ++++ mach/m68k2/libem/lxa.s | 4 ++++ mach/m68k2/libem/lxl.s | 4 ++++ mach/m68k2/libem/mli.s | 6 +++++- mach/m68k2/libem/mlu.s | 6 +++++- mach/m68k2/libem/mon.s | 8 +++++-- mach/m68k2/libem/nop.s | 8 +++++-- mach/m68k2/libem/printf.s | 36 +++++++++++++++++-------------- mach/m68k2/libem/rck.s | 6 +++++- mach/m68k2/libem/ret.s | 6 +++++- mach/m68k2/libem/set.s | 6 +++++- mach/m68k2/libem/shp.s | 6 +++++- mach/m68k2/libem/sig.s | 6 +++++- mach/m68k2/libem/sts.s | 6 +++++- mach/m68k2/libem/trp.s | 10 ++++++--- mach/m68k2/libsys/head_em.s | 43 +++++++++++++++---------------------- 36 files changed, 230 insertions(+), 87 deletions(-) create mode 100644 mach/m68k2/libem/ffp.s diff --git a/mach/m68k2/libem/ara.s b/mach/m68k2/libem/ara.s index 3c3f179a1..41869eb99 100644 --- a/mach/m68k2/libem/ara.s +++ b/mach/m68k2/libem/ara.s @@ -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 diff --git a/mach/m68k2/libem/cii.s b/mach/m68k2/libem/cii.s index 045d7c72e..3859107cb 100644 --- a/mach/m68k2/libem/cii.s +++ b/mach/m68k2/libem/cii.s @@ -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 diff --git a/mach/m68k2/libem/cmi.s b/mach/m68k2/libem/cmi.s index dd5e554cd..6de1fee90 100644 --- a/mach/m68k2/libem/cmi.s +++ b/mach/m68k2/libem/cmi.s @@ -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 diff --git a/mach/m68k2/libem/cmp.s b/mach/m68k2/libem/cmp.s index f2d962f9e..15b95b1c1 100644 --- a/mach/m68k2/libem/cmp.s +++ b/mach/m68k2/libem/cmp.s @@ -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 diff --git a/mach/m68k2/libem/cms.s b/mach/m68k2/libem/cms.s index 1ff61a85e..18101dc62 100644 --- a/mach/m68k2/libem/cms.s +++ b/mach/m68k2/libem/cms.s @@ -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 diff --git a/mach/m68k2/libem/cmu.s b/mach/m68k2/libem/cmu.s index 624e2cb68..87b8a184b 100644 --- a/mach/m68k2/libem/cmu.s +++ b/mach/m68k2/libem/cmu.s @@ -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 diff --git a/mach/m68k2/libem/csa.s b/mach/m68k2/libem/csa.s index 9d3e036f4..b16313db6 100644 --- a/mach/m68k2/libem/csa.s +++ b/mach/m68k2/libem/csa.s @@ -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 diff --git a/mach/m68k2/libem/csb.s b/mach/m68k2/libem/csb.s index c36ecf003..5d25385a9 100644 --- a/mach/m68k2/libem/csb.s +++ b/mach/m68k2/libem/csb.s @@ -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 diff --git a/mach/m68k2/libem/cuu.s b/mach/m68k2/libem/cuu.s index d1db8f5ca..fb3989c5f 100644 --- a/mach/m68k2/libem/cuu.s +++ b/mach/m68k2/libem/cuu.s @@ -1,8 +1,12 @@ .define .ciu .define .cui .define .cuu +.sect .text +.sect .rom +.sect .data +.sect .bss - .text + .sect .text .ciu: .cui: .cuu: diff --git a/mach/m68k2/libem/cvf.s b/mach/m68k2/libem/cvf.s index d0b081ddc..dc2c5d2e4 100644 --- a/mach/m68k2/libem/cvf.s +++ b/mach/m68k2/libem/cvf.s @@ -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: diff --git a/mach/m68k2/libem/dia.s b/mach/m68k2/libem/dia.s index 849f29e23..dd7e6a0c3 100644 --- a/mach/m68k2/libem/dia.s +++ b/mach/m68k2/libem/dia.s @@ -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 diff --git a/mach/m68k2/libem/dvi.s b/mach/m68k2/libem/dvi.s index 508f66707..a17ad0f71 100644 --- a/mach/m68k2/libem/dvi.s +++ b/mach/m68k2/libem/dvi.s @@ -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 diff --git a/mach/m68k2/libem/dvu.s b/mach/m68k2/libem/dvu.s index 2c3dea8d6..7efdd441c 100644 --- a/mach/m68k2/libem/dvu.s +++ b/mach/m68k2/libem/dvu.s @@ -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 diff --git a/mach/m68k2/libem/end.s b/mach/m68k2/libem/end.s index e05364bd9..37e1cef2c 100644 --- a/mach/m68k2/libem/end.s +++ b/mach/m68k2/libem/end.s @@ -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: diff --git a/mach/m68k2/libem/exg.s b/mach/m68k2/libem/exg.s index 042f80fb8..8d9da1639 100644 --- a/mach/m68k2/libem/exg.s +++ b/mach/m68k2/libem/exg.s @@ -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 diff --git a/mach/m68k2/libem/fat.s b/mach/m68k2/libem/fat.s index fe2e07826..9c1e2b946 100644 --- a/mach/m68k2/libem/fat.s +++ b/mach/m68k2/libem/fat.s @@ -1,6 +1,10 @@ .define .fat +.sect .text +.sect .rom +.sect .data +.sect .bss - .text + .sect .text .fat: jsr .trp jmp EXIT diff --git a/mach/m68k2/libem/ffp.s b/mach/m68k2/libem/ffp.s new file mode 100644 index 000000000..d6bd1303b --- /dev/null +++ b/mach/m68k2/libem/ffp.s @@ -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 diff --git a/mach/m68k2/libem/gto.s b/mach/m68k2/libem/gto.s index c78ca22ac..3a394f814 100644 --- a/mach/m68k2/libem/gto.s +++ b/mach/m68k2/libem/gto.s @@ -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 diff --git a/mach/m68k2/libem/inn.s b/mach/m68k2/libem/inn.s index 79d057c53..28c60db80 100644 --- a/mach/m68k2/libem/inn.s +++ b/mach/m68k2/libem/inn.s @@ -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 diff --git a/mach/m68k2/libem/los.s b/mach/m68k2/libem/los.s index 5bc40cc89..84b683282 100644 --- a/mach/m68k2/libem/los.s +++ b/mach/m68k2/libem/los.s @@ -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 diff --git a/mach/m68k2/libem/lpb.s b/mach/m68k2/libem/lpb.s index 325677352..177fac45c 100644 --- a/mach/m68k2/libem/lpb.s +++ b/mach/m68k2/libem/lpb.s @@ -1,4 +1,8 @@ .define .lpb +.sect .text +.sect .rom +.sect .data +.sect .bss .extern .lpb .lpb: ! convert local to argument base diff --git a/mach/m68k2/libem/lxa.s b/mach/m68k2/libem/lxa.s index ff0df4269..9172a3d6a 100644 --- a/mach/m68k2/libem/lxa.s +++ b/mach/m68k2/libem/lxa.s @@ -1,4 +1,8 @@ .define .lxa +.sect .text +.sect .rom +.sect .data +.sect .bss .extern .lxa .lxa: ! #levels (>= 0) on stack diff --git a/mach/m68k2/libem/lxl.s b/mach/m68k2/libem/lxl.s index 7ab2354eb..e41f8318a 100644 --- a/mach/m68k2/libem/lxl.s +++ b/mach/m68k2/libem/lxl.s @@ -1,4 +1,8 @@ .define .lxl +.sect .text +.sect .rom +.sect .data +.sect .bss .extern .lxl .lxl: ! #levels on stack (> 0) diff --git a/mach/m68k2/libem/mli.s b/mach/m68k2/libem/mli.s index fdf9242c1..a0aa9a4f2 100644 --- a/mach/m68k2/libem/mli.s +++ b/mach/m68k2/libem/mli.s @@ -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 diff --git a/mach/m68k2/libem/mlu.s b/mach/m68k2/libem/mlu.s index b8522da48..f3146c091 100644 --- a/mach/m68k2/libem/mlu.s +++ b/mach/m68k2/libem/mlu.s @@ -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 diff --git a/mach/m68k2/libem/mon.s b/mach/m68k2/libem/mon.s index dabe65a92..dffaaede3 100644 --- a/mach/m68k2/libem/mon.s +++ b/mach/m68k2/libem/mon.s @@ -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 diff --git a/mach/m68k2/libem/nop.s b/mach/m68k2/libem/nop.s index f7dd9db14..47e242c03 100644 --- a/mach/m68k2/libem/nop.s +++ b/mach/m68k2/libem/nop.s @@ -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 diff --git a/mach/m68k2/libem/printf.s b/mach/m68k2/libem/printf.s index cc79a6964..044484df5 100644 --- a/mach/m68k2/libem/printf.s +++ b/mach/m68k2/libem/printf.s @@ -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 diff --git a/mach/m68k2/libem/rck.s b/mach/m68k2/libem/rck.s index 52af333aa..73bae4ae7 100644 --- a/mach/m68k2/libem/rck.s +++ b/mach/m68k2/libem/rck.s @@ -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 diff --git a/mach/m68k2/libem/ret.s b/mach/m68k2/libem/ret.s index a1b394de0..c18c42acf 100644 --- a/mach/m68k2/libem/ret.s +++ b/mach/m68k2/libem/ret.s @@ -1,6 +1,10 @@ .define .ret +.sect .text +.sect .rom +.sect .data +.sect .bss - .text + .sect .text .ret: beq 3f cmp #2,d0 diff --git a/mach/m68k2/libem/set.s b/mach/m68k2/libem/set.s index 7d32c69de..42111bbea 100644 --- a/mach/m68k2/libem/set.s +++ b/mach/m68k2/libem/set.s @@ -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 diff --git a/mach/m68k2/libem/shp.s b/mach/m68k2/libem/shp.s index 88421e459..912af4fcb 100644 --- a/mach/m68k2/libem/shp.s +++ b/mach/m68k2/libem/shp.s @@ -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 diff --git a/mach/m68k2/libem/sig.s b/mach/m68k2/libem/sig.s index 3fa3e0bcf..f93c9f8ab 100644 --- a/mach/m68k2/libem/sig.s +++ b/mach/m68k2/libem/sig.s @@ -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 diff --git a/mach/m68k2/libem/sts.s b/mach/m68k2/libem/sts.s index 937c9304b..3c1bf9176 100644 --- a/mach/m68k2/libem/sts.s +++ b/mach/m68k2/libem/sts.s @@ -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 diff --git a/mach/m68k2/libem/trp.s b/mach/m68k2/libem/trp.s index 36045db47..bd6f15d7f 100644 --- a/mach/m68k2/libem/trp.s +++ b/mach/m68k2/libem/trp.s @@ -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 diff --git a/mach/m68k2/libsys/head_em.s b/mach/m68k2/libsys/head_em.s index 7c7eb12b6..a47d8eea7 100644 --- a/mach/m68k2/libsys/head_em.s +++ b/mach/m68k2/libsys/head_em.s @@ -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!