diff --git a/mach/z80/libem/LIST b/mach/z80/libem/LIST index 67c82969f..b61d8d8f4 100644 --- a/mach/z80/libem/LIST +++ b/mach/z80/libem/LIST @@ -1,4 +1,4 @@ -tail_em.a +libem_s.a aaru.s aar.s aar2.s diff --git a/mach/z80/libem/Makefile b/mach/z80/libem/Makefile index f1db57de0..3529a29ad 100644 --- a/mach/z80/libem/Makefile +++ b/mach/z80/libem/Makefile @@ -1,17 +1,29 @@ # $Header$ -install: - ../../install tail_em.a tail_em - ../../install tail.s end_em +MACH=z80 +all: libem_o.a end.o -cmp: - -../../compare tail_em.a tail_em - -../../compare tail.s end_em +install: all + ../../install end.o end_em + ../../install libem_o.a tail_em -clean : + +cmp: all + -../../compare end.o end_em + -../../compare libem_o.a tail_em + +libem_o.a: libem_s.a + ASAR=aal ; export ASAR ;\ + march . libem_o.a + +end.o: end.s + $(MACH) -I../../../h -c end.s + +clean: + rm -f *.o libem_o.a opr : - make pr | opr + make pr | opr pr: - @arch pv tail_em.a | pr -h `pwd`/tail_em.a - @pr `pwd`/tail.s + @pr `pwd`/end.s + @arch pv libem_s.a | pr -h `pwd`/libem_s.a diff --git a/mach/z80/libem/aar.s b/mach/z80/libem/aar.s index ded49f529..09b0eb06e 100644 --- a/mach/z80/libem/aar.s +++ b/mach/z80/libem/aar.s @@ -1,4 +1,9 @@ .define .aar +.sect .text +.sect .rom +.sect .data +.sect .bss +.sect .text ! use .mli2 ! 2-byte descriptor elements diff --git a/mach/z80/libem/aar2.s b/mach/z80/libem/aar2.s index 149eefbdb..b7c350806 100644 --- a/mach/z80/libem/aar2.s +++ b/mach/z80/libem/aar2.s @@ -1,4 +1,9 @@ .define .aar2 +.sect .text +.sect .rom +.sect .data +.sect .bss +.sect .text ! special case aar: element size = 2 (statically known) ! parameters: diff --git a/mach/z80/libem/aaru.s b/mach/z80/libem/aaru.s index 650931f9b..95f6ae41a 100644 --- a/mach/z80/libem/aaru.s +++ b/mach/z80/libem/aaru.s @@ -1,4 +1,9 @@ .define .aaru +.sect .text +.sect .rom +.sect .data +.sect .bss +.sect .text ! AAR NOT DEFINED diff --git a/mach/z80/libem/and.s b/mach/z80/libem/and.s index dd02e8a6f..3aa04f030 100644 --- a/mach/z80/libem/and.s +++ b/mach/z80/libem/and.s @@ -1,4 +1,9 @@ .define .and +.sect .text +.sect .rom +.sect .data +.sect .bss +.sect .text ! auxiliary size 'and' ! parameters: diff --git a/mach/z80/libem/cii.s b/mach/z80/libem/cii.s index 2321874a0..d042d65b2 100644 --- a/mach/z80/libem/cii.s +++ b/mach/z80/libem/cii.s @@ -1,4 +1,10 @@ .define .cii +.define .cuu +.sect .text +.sect .rom +.sect .data +.sect .bss +.sect .text ! cii: convert integer to integer ! parameters: @@ -107,7 +113,6 @@ -.define .cuu ! cuu: convert unsigned to unsigned ! parameters: diff --git a/mach/z80/libem/cms.s b/mach/z80/libem/cms.s index 530f4fc03..8f28ced52 100644 --- a/mach/z80/libem/cms.s +++ b/mach/z80/libem/cms.s @@ -1,4 +1,9 @@ .define .cms +.sect .text +.sect .rom +.sect .data +.sect .bss +.sect .text ! any size sets ! parameters: diff --git a/mach/z80/libem/cmu.s b/mach/z80/libem/cmu.s index 738cb6155..c0a4ac5fd 100644 --- a/mach/z80/libem/cmu.s +++ b/mach/z80/libem/cmu.s @@ -1,4 +1,9 @@ .define .cmu +.sect .text +.sect .rom +.sect .data +.sect .bss +.sect .text ! parameters: ! hl : size (#bytes) diff --git a/mach/z80/libem/cmu4.s b/mach/z80/libem/cmu4.s index 5f91c5d64..8cc431cd0 100644 --- a/mach/z80/libem/cmu4.s +++ b/mach/z80/libem/cmu4.s @@ -1,4 +1,9 @@ .define .cmu4 +.sect .text +.sect .rom +.sect .data +.sect .bss +.sect .text ! 4 byte cmu and cmi routine ! parameters: @@ -56,5 +61,5 @@ inc hl ld sp,hl jp (ix) -.data -savesp: .word 0 +.sect .data +savesp: .data2 0 diff --git a/mach/z80/libem/csa.s b/mach/z80/libem/csa.s index 3f114c8b3..ace728e55 100644 --- a/mach/z80/libem/csa.s +++ b/mach/z80/libem/csa.s @@ -1,4 +1,9 @@ .define .csa +.sect .text +.sect .rom +.sect .data +.sect .bss +.sect .text ! this is not a subroutine, but just a ! piece of code that computes the jump- diff --git a/mach/z80/libem/csb.s b/mach/z80/libem/csb.s index 32bdab04b..53aa41a15 100644 --- a/mach/z80/libem/csb.s +++ b/mach/z80/libem/csb.s @@ -1,4 +1,9 @@ .define .csb +.sect .text +.sect .rom +.sect .data +.sect .bss +.sect .text ! this is not a subroutine, but just a ! piece of code that computes the jump- diff --git a/mach/z80/libem/dvi2.s b/mach/z80/libem/dvi2.s index 986ac4874..2b248184c 100644 --- a/mach/z80/libem/dvi2.s +++ b/mach/z80/libem/dvi2.s @@ -1,4 +1,9 @@ .define .dvi2 +.sect .text +.sect .rom +.sect .data +.sect .bss +.sect .text ! 16-bit signed division ! parameters: diff --git a/mach/z80/libem/dvi4.s b/mach/z80/libem/dvi4.s index 145df9170..d56656091 100644 --- a/mach/z80/libem/dvi4.s +++ b/mach/z80/libem/dvi4.s @@ -1,4 +1,9 @@ .define .dvi4 +.sect .text +.sect .rom +.sect .data +.sect .bss +.sect .text ! 4-byte divide routine for z80 ! parameters: @@ -77,9 +82,9 @@ push bc push de jp (ix) -.data - .flag1: .byte 0 - .flag2: .byte 0 - retaddr:.word 0 - .savebc: .word 0 - .savede: .word 0 +.sect .data + .flag1: .data1 0 + .flag2: .data1 0 + retaddr:.data2 0 + .savebc: .data2 0 + .savede: .data2 0 diff --git a/mach/z80/libem/dvu2.s b/mach/z80/libem/dvu2.s index 06590f70a..4512115f4 100644 --- a/mach/z80/libem/dvu2.s +++ b/mach/z80/libem/dvu2.s @@ -1,4 +1,9 @@ .define .dvu2 +.sect .text +.sect .rom +.sect .data +.sect .bss +.sect .text ! 16-bit divide ! parameters: diff --git a/mach/z80/libem/dvu4.s b/mach/z80/libem/dvu4.s index eeecec423..d0e3ab899 100644 --- a/mach/z80/libem/dvu4.s +++ b/mach/z80/libem/dvu4.s @@ -1,4 +1,9 @@ .define .dvu4 +.sect .text +.sect .rom +.sect .data +.sect .bss +.sect .text ! 4-byte divide routine for z80 ! parameters: @@ -129,9 +134,9 @@ ld hl,(.retaddr) jp (hl) ! return -.data -.flag: .byte 0 -.low: .word 0 -.iysave: .word 0 -.retaddr: .word 0 -.result: .word 0 +.sect .data +.flag: .data1 0 +.low: .data2 0 +.iysave: .data2 0 +.retaddr: .data2 0 +.result: .data2 0 diff --git a/mach/z80/libem/end.s b/mach/z80/libem/end.s index aead49970..6b9ce418e 100644 --- a/mach/z80/libem/end.s +++ b/mach/z80/libem/end.s @@ -1,15 +1,17 @@ +.sect .text; .sect .rom; .sect .data; .sect .bss .define endtext,enddata,endbss .define _end,_etext,_edata - .text + ! $Header$ + .sect .text endtext: _etext: .align 2 - .data + .sect .data enddata: _edata: .align 2 - .bss +.sect .endsect _end: endbss: .align 2 diff --git a/mach/z80/libem/exg.s b/mach/z80/libem/exg.s index d7dc3bdda..149a1e5bd 100644 --- a/mach/z80/libem/exg.s +++ b/mach/z80/libem/exg.s @@ -1,4 +1,9 @@ .define .exg +.sect .text +.sect .rom +.sect .data +.sect .bss +.sect .text .exg: pop ix pop de diff --git a/mach/z80/libem/gto.s b/mach/z80/libem/gto.s index 230d6a9b3..97aaba846 100644 --- a/mach/z80/libem/gto.s +++ b/mach/z80/libem/gto.s @@ -1,4 +1,9 @@ .define .gto +.sect .text +.sect .rom +.sect .data +.sect .bss +.sect .text .gto: ld e,(hl) diff --git a/mach/z80/libem/hulp.s b/mach/z80/libem/hulp.s index 1f1ffaa37..b287d2ec1 100644 --- a/mach/z80/libem/hulp.s +++ b/mach/z80/libem/hulp.s @@ -1,3 +1,8 @@ +.sect .text +.sect .rom +.sect .data +.sect .bss +.sect .text loop = 100 dvi4: xor a @@ -57,6 +62,6 @@ dvi4: push hl push de jp (iy) -.data - .flag1: .byte 0 - .flag2: .byte 0 +.sect .data + .flag1: .data1 0 + .flag2: .data1 0 diff --git a/mach/z80/libem/inn.s b/mach/z80/libem/inn.s index a6fed7675..ddd4b1b89 100644 --- a/mach/z80/libem/inn.s +++ b/mach/z80/libem/inn.s @@ -1,4 +1,9 @@ .define .inn +.sect .text +.sect .rom +.sect .data +.sect .bss +.sect .text ! use .unimpld ! any size sets diff --git a/mach/z80/libem/ior.s b/mach/z80/libem/ior.s index 6a6fded72..4e5e1881c 100644 --- a/mach/z80/libem/ior.s +++ b/mach/z80/libem/ior.s @@ -1,4 +1,9 @@ .define .ior +.sect .text +.sect .rom +.sect .data +.sect .bss +.sect .text ! auxiliary size 'ior' ! parameters: diff --git a/mach/z80/libem/lar.s b/mach/z80/libem/lar.s index 105ebbf90..dbed31176 100644 --- a/mach/z80/libem/lar.s +++ b/mach/z80/libem/lar.s @@ -1,4 +1,9 @@ .define .lar +.sect .text +.sect .rom +.sect .data +.sect .bss +.sect .text ! use .mli2 ! 2-byte descriptor elements diff --git a/mach/z80/libem/lar2.s b/mach/z80/libem/lar2.s index e4ce311f5..dcc487b3f 100644 --- a/mach/z80/libem/lar2.s +++ b/mach/z80/libem/lar2.s @@ -1,4 +1,9 @@ .define .lar2 +.sect .text +.sect .rom +.sect .data +.sect .bss +.sect .text ! special case lar: element size = 2 (statically known) ! parameters: diff --git a/mach/z80/libem/laru.s b/mach/z80/libem/laru.s index 0ad563d40..19c0df5e3 100644 --- a/mach/z80/libem/laru.s +++ b/mach/z80/libem/laru.s @@ -1,4 +1,9 @@ .define .laru +.sect .text +.sect .rom +.sect .data +.sect .bss +.sect .text ! LAR NOT DEFINED diff --git a/mach/z80/libem/los.s b/mach/z80/libem/los.s index 0799c7e34..e472e2157 100644 --- a/mach/z80/libem/los.s +++ b/mach/z80/libem/los.s @@ -1,4 +1,9 @@ .define .los +.sect .text +.sect .rom +.sect .data +.sect .bss +.sect .text diff --git a/mach/z80/libem/mli2.s b/mach/z80/libem/mli2.s index 28e7a9e70..fc8873895 100644 --- a/mach/z80/libem/mli2.s +++ b/mach/z80/libem/mli2.s @@ -1,4 +1,9 @@ .define .mli2 +.sect .text +.sect .rom +.sect .data +.sect .bss +.sect .text ! 16 bit multiply ! parameters: diff --git a/mach/z80/libem/mli4.s b/mach/z80/libem/mli4.s index 0284310c5..3fbeb2b0d 100644 --- a/mach/z80/libem/mli4.s +++ b/mach/z80/libem/mli4.s @@ -1,4 +1,9 @@ .define .mli4 +.sect .text +.sect .rom +.sect .data +.sect .bss +.sect .text ! 32-bit multiply routine for z80 ! parameters: @@ -70,6 +75,6 @@ ! on stack! put return address in hl push ix ! least sign. 2 bytes of result jp (hl) ! return -.data -.flag: .byte 0 +.sect .data +.flag: .data1 0 .mplier: .space 4 diff --git a/mach/z80/libem/nop.s b/mach/z80/libem/nop.s index 6a61101bf..016192f0f 100644 --- a/mach/z80/libem/nop.s +++ b/mach/z80/libem/nop.s @@ -1,6 +1,11 @@ - - .define .nop +.sect .text +.sect .rom +.sect .data +.sect .bss +.sect .text + + ! NOP ! changed into output routine to print linenumber diff --git a/mach/z80/libem/outdec.s b/mach/z80/libem/outdec.s index 74f96982f..5a03edf55 100644 --- a/mach/z80/libem/outdec.s +++ b/mach/z80/libem/outdec.s @@ -1,4 +1,9 @@ .define outdec +.sect .text +.sect .rom +.sect .data +.sect .bss +.sect .text ! output contents of HL as a sequence ! of decimal digits outdec: @@ -47,7 +52,7 @@ convert: pop bc ret table: - .short 10000 - .short 1000 - .short 100 - .short 10 + .data2 10000 + .data2 1000 + .data2 100 + .data2 10 diff --git a/mach/z80/libem/pstrng.s b/mach/z80/libem/pstrng.s index f3e0885ac..d9ebc5587 100644 --- a/mach/z80/libem/pstrng.s +++ b/mach/z80/libem/pstrng.s @@ -1,6 +1,11 @@ - - .define pstrng +.sect .text +.sect .rom +.sect .data +.sect .bss +.sect .text + + ! print a string of characters to the console ! entry: DE points to string ! string terminator is 0x00 diff --git a/mach/z80/libem/rck.s b/mach/z80/libem/rck.s index c98e1ca67..3831042cd 100644 --- a/mach/z80/libem/rck.s +++ b/mach/z80/libem/rck.s @@ -1,4 +1,9 @@ .define .rck +.sect .text +.sect .rom +.sect .data +.sect .bss +.sect .text .rck: pop bc pop ix diff --git a/mach/z80/libem/rmi2.s b/mach/z80/libem/rmi2.s index 16cf68b5b..c6b8d1822 100644 --- a/mach/z80/libem/rmi2.s +++ b/mach/z80/libem/rmi2.s @@ -1,4 +1,9 @@ .define .rmi2 +.sect .text +.sect .rom +.sect .data +.sect .bss +.sect .text ! 16-bit signed remainder ! parameters: diff --git a/mach/z80/libem/sar.s b/mach/z80/libem/sar.s index a89ecdaf4..65aec5878 100644 --- a/mach/z80/libem/sar.s +++ b/mach/z80/libem/sar.s @@ -1,4 +1,9 @@ .define .sar +.sect .text +.sect .rom +.sect .data +.sect .bss +.sect .text ! use .mli2 ! use .trp.z diff --git a/mach/z80/libem/sar2.s b/mach/z80/libem/sar2.s index 9dbe81efb..286738cd2 100644 --- a/mach/z80/libem/sar2.s +++ b/mach/z80/libem/sar2.s @@ -1,4 +1,9 @@ .define .sar2 +.sect .text +.sect .rom +.sect .data +.sect .bss +.sect .text ! special case sar: element size = 2 (statically known) ! parameters: diff --git a/mach/z80/libem/saru.s b/mach/z80/libem/saru.s index b2784e40d..1d53cc905 100644 --- a/mach/z80/libem/saru.s +++ b/mach/z80/libem/saru.s @@ -1,4 +1,9 @@ .define .saru +.sect .text +.sect .rom +.sect .data +.sect .bss +.sect .text ! SAR NOT DEFINED diff --git a/mach/z80/libem/sdf.s b/mach/z80/libem/sdf.s index 7a3caf15d..89e81a419 100644 --- a/mach/z80/libem/sdf.s +++ b/mach/z80/libem/sdf.s @@ -1,4 +1,9 @@ .define .sdf +.sect .text +.sect .rom +.sect .data +.sect .bss +.sect .text ! store double offsetted diff --git a/mach/z80/libem/sdl.s b/mach/z80/libem/sdl.s index 643428cc7..2acfd85cf 100644 --- a/mach/z80/libem/sdl.s +++ b/mach/z80/libem/sdl.s @@ -1,4 +1,9 @@ .define .sdl +.sect .text +.sect .rom +.sect .data +.sect .bss +.sect .text ! store double local at any offset ! parameters: diff --git a/mach/z80/libem/set.s b/mach/z80/libem/set.s index 2e698f775..f2251af00 100644 --- a/mach/z80/libem/set.s +++ b/mach/z80/libem/set.s @@ -1,4 +1,9 @@ .define .set +.sect .text +.sect .rom +.sect .data +.sect .bss +.sect .text ! use .unimpld ! any size sets diff --git a/mach/z80/libem/str.s b/mach/z80/libem/str.s index 4a4a2b195..70e97f535 100644 --- a/mach/z80/libem/str.s +++ b/mach/z80/libem/str.s @@ -1,4 +1,9 @@ .define .strhp +.sect .text +.sect .rom +.sect .data +.sect .bss +.sect .text .strhp: pop ix diff --git a/mach/z80/libem/sts.s b/mach/z80/libem/sts.s index 89f5cbb9f..db1cea328 100644 --- a/mach/z80/libem/sts.s +++ b/mach/z80/libem/sts.s @@ -1,4 +1,9 @@ .define .sts +.sect .text +.sect .rom +.sect .data +.sect .bss +.sect .text ! use trp.z ! object size given by 2-byte integer on diff --git a/mach/z80/libem/trp.s b/mach/z80/libem/trp.s index 07f835274..f153b8e3c 100644 --- a/mach/z80/libem/trp.s +++ b/mach/z80/libem/trp.s @@ -1,4 +1,9 @@ .define .trp.z +.sect .text +.sect .rom +.sect .data +.sect .bss +.sect .text ! changed into output routine to print errornumber diff --git a/mach/z80/libem/unim.s b/mach/z80/libem/unim.s index 53970f3f6..fa5e4c598 100644 --- a/mach/z80/libem/unim.s +++ b/mach/z80/libem/unim.s @@ -1,4 +1,9 @@ .define unimpld, e.mon, e.rck, .trp.z, .unimpld +.sect .text +.sect .rom +.sect .data +.sect .bss +.sect .text .unimpld: unimpld: ! used in dispatch table to diff --git a/mach/z80/libem/xor.s b/mach/z80/libem/xor.s index ae882577c..b9b12e0b4 100644 --- a/mach/z80/libem/xor.s +++ b/mach/z80/libem/xor.s @@ -1,4 +1,9 @@ .define .xor +.sect .text +.sect .rom +.sect .data +.sect .bss +.sect .text ! auxiliary size 'xor' ! parameters: