From c754f6ca696b3482ae9cbcd4bbeeaf73073ceaef Mon Sep 17 00:00:00 2001 From: ceriel Date: Thu, 8 Jan 1987 10:13:48 +0000 Subject: [PATCH] adapted to new assembler syntax --- mach/i86/libem/LIST | 3 +- mach/i86/libem/Makefile | 37 ++++++++++++----- mach/i86/libem/adi.s | 5 ++- mach/i86/libem/and.s | 3 +- mach/i86/libem/cii.s | 5 ++- mach/i86/libem/cms.s | 3 +- mach/i86/libem/cmu4.s | 3 +- mach/i86/libem/com.s | 3 +- mach/i86/libem/csa2.s | 5 ++- mach/i86/libem/csb2.s | 5 ++- mach/i86/libem/cuu.s | 5 ++- mach/i86/libem/dup.s | 3 +- mach/i86/libem/dvi.s | 6 ++- mach/i86/libem/dvi4.s | 3 +- mach/i86/libem/dvu.s | 6 ++- mach/i86/libem/dvu4.s | 3 +- mach/i86/libem/error.s | 5 ++- mach/i86/libem/exg.s | 3 +- mach/i86/libem/fakfp.s | 5 ++- mach/i86/libem/fat.s | 5 ++- mach/i86/libem/gto.s | 3 +- mach/i86/libem/iaar.s | 4 +- mach/i86/libem/ilar.s | 5 ++- mach/i86/libem/inn.s | 7 ++-- mach/i86/libem/ior.s | 3 +- mach/i86/libem/isar.s | 5 ++- mach/i86/libem/lar2.s | 3 +- mach/i86/libem/loi.s | 3 +- mach/i86/libem/mli.s | 5 ++- mach/i86/libem/mli4.s | 3 +- mach/i86/libem/mon.s | 4 +- mach/i86/libem/ngi.s | 5 ++- mach/i86/libem/nop.s | 4 +- mach/i86/libem/print.s | 4 +- mach/i86/libem/printf.s | 4 +- mach/i86/libem/rck.s | 5 ++- mach/i86/libem/rmi.s | 6 ++- mach/i86/libem/rmi4.s | 3 +- mach/i86/libem/rmu.s | 6 ++- mach/i86/libem/rmu4.s | 3 +- mach/i86/libem/rol.s | 5 ++- mach/i86/libem/ror.s | 5 ++- mach/i86/libem/sar2.s | 3 +- mach/i86/libem/sbi.s | 7 +++- mach/i86/libem/set.s | 9 +++-- mach/i86/libem/sli.s | 5 ++- mach/i86/libem/sri.s | 5 ++- mach/i86/libem/sti.s | 3 +- mach/i86/libem/stop.s | 3 +- mach/i86/libem/strhp.s | 4 +- mach/i86/libem/trp.s | 4 +- mach/i86/libem/unknown.s | 4 +- mach/i86/libem/xor.s | 3 +- mach/i86/libsys/head_em.s | 83 ++++++++++++++++----------------------- 54 files changed, 225 insertions(+), 119 deletions(-) diff --git a/mach/i86/libem/LIST b/mach/i86/libem/LIST index 370909b60..a94a4e3f3 100644 --- a/mach/i86/libem/LIST +++ b/mach/i86/libem/LIST @@ -1,4 +1,4 @@ -tail_em.a +libem_s.a adi.s and.s cii.s @@ -50,4 +50,3 @@ trp.s stop.s printf.s print.s -tail.s diff --git a/mach/i86/libem/Makefile b/mach/i86/libem/Makefile index 351b5160c..3dcf0e6b9 100644 --- a/mach/i86/libem/Makefile +++ b/mach/i86/libem/Makefile @@ -1,16 +1,33 @@ -install: - ../../install head_em.s head_em - ../../install tail_em.a tail_em +# $Header$ +MACH=i86 +install: all + ../../install head_em.o head_em + ../../install libem_o.a tail_em + ../../install end.o end_em -cmp: - -../../compare head_em.s head_em - -../../compare tail_em.a tail_em +cmp: all + -../../compare head_em.o head_em + -../../compare libem_o.a tail_em + -../../compare end.o end_em -clean : +all: head_em.o libem_o.a end.o +end.o: end.s + $(MACH) -I../../../h -c end.s + +head_em.o: head_em.s + $(MACH) -I../../../h -c head_em.s + +libem_o.a: libem_s.a + ASAR=aal ; export ASAR ;\ + march . libem_o.a + +clean: + rm -f *.o opr : - make pr | opr + make pr | opr pr: - @pr head_em.s - @arch pv tail_em.a | pr -h `pwd`/tail_em.a + @pr `pwd`/head_em.s + @arch pv libem_s.a | pr -h `pwd`/libem_s.a + @pr `pwd`/end.s diff --git a/mach/i86/libem/adi.s b/mach/i86/libem/adi.s index f1f060900..88f12a293 100644 --- a/mach/i86/libem/adi.s +++ b/mach/i86/libem/adi.s @@ -1,7 +1,8 @@ +.sect .text; .sect .rom; .sect .data; .sect .bss .define .adi - ! $Header$ ! #bytes in cx , top of stack in ax + .sect .text .adi: pop bx ! return address cmp cx,2 @@ -20,6 +21,8 @@ push dx jmp bx 9: +.extern EODDZ +.extern .trp mov ax,EODDZ push ax jmp .trp diff --git a/mach/i86/libem/and.s b/mach/i86/libem/and.s index e77b09d51..07e2c74d2 100644 --- a/mach/i86/libem/and.s +++ b/mach/i86/libem/and.s @@ -1,7 +1,8 @@ +.sect .text; .sect .rom; .sect .data; .sect .bss .define .and - ! $Header$ ! #bytes in cx + .sect .text .and: pop bx ! return address mov di,sp diff --git a/mach/i86/libem/cii.s b/mach/i86/libem/cii.s index 4304a0ee8..4cf0cb3cb 100644 --- a/mach/i86/libem/cii.s +++ b/mach/i86/libem/cii.s @@ -1,7 +1,8 @@ +.sect .text; .sect .rom; .sect .data; .sect .bss .define .cii +.sect .text .cii: - ! $Header$ pop di ! return address ! pop cx, dest. size ! pop bx, src. size @@ -31,6 +32,8 @@ jmp di 9: push ax ! push low source +.extern EILLINS +.extern .fat mov ax,EILLINS push ax jmp .fat diff --git a/mach/i86/libem/cms.s b/mach/i86/libem/cms.s index cec20db01..308d70a1b 100644 --- a/mach/i86/libem/cms.s +++ b/mach/i86/libem/cms.s @@ -1,7 +1,8 @@ +.sect .text; .sect .rom; .sect .data; .sect .bss .define .cms - ! $Header$ ! #bytes in cx + .sect .text .cms: pop bx ! return address mov dx,sp diff --git a/mach/i86/libem/cmu4.s b/mach/i86/libem/cmu4.s index 2e4bf9460..fc14b4dd8 100644 --- a/mach/i86/libem/cmu4.s +++ b/mach/i86/libem/cmu4.s @@ -1,7 +1,8 @@ +.sect .text; .sect .rom; .sect .data; .sect .bss .define .cmu4 +.sect .text .cmu4: - ! $Header$ pop bx ! return address xor ax,ax pop cx diff --git a/mach/i86/libem/com.s b/mach/i86/libem/com.s index 23aee51da..ea398d83a 100644 --- a/mach/i86/libem/com.s +++ b/mach/i86/libem/com.s @@ -1,7 +1,8 @@ +.sect .text; .sect .rom; .sect .data; .sect .bss .define .com - ! $Header$ ! #bytes in cx + .sect .text .com: pop bx ! return address mov di,sp diff --git a/mach/i86/libem/csa2.s b/mach/i86/libem/csa2.s index 60ef8ed16..257f70365 100644 --- a/mach/i86/libem/csa2.s +++ b/mach/i86/libem/csa2.s @@ -1,7 +1,8 @@ +.sect .text; .sect .rom; .sect .data; .sect .bss .define .csa2 +.sect .text .csa2: - ! $Header$ ! si, descriptor address ! bx, index mov dx,(si) ! default @@ -16,6 +17,8 @@ mov bx,dx test bx,bx jnz 2f +.extern ECASE +.extern .fat mov ax,ECASE push ax jmp .fat diff --git a/mach/i86/libem/csb2.s b/mach/i86/libem/csb2.s index f49fe8a54..bae85588a 100644 --- a/mach/i86/libem/csb2.s +++ b/mach/i86/libem/csb2.s @@ -1,7 +1,8 @@ +.sect .text; .sect .rom; .sect .data; .sect .bss .define .csb2 +.sect .text .csb2: - ! $Header$ !si, descriptor address !dx, index lods @@ -19,6 +20,8 @@ 2: test bx,bx jnz 3f +.extern ECASE +.extern .fat mov ax,ECASE push ax jmp .fat diff --git a/mach/i86/libem/cuu.s b/mach/i86/libem/cuu.s index 7719f39d1..3d47d5f80 100644 --- a/mach/i86/libem/cuu.s +++ b/mach/i86/libem/cuu.s @@ -1,11 +1,12 @@ +.sect .text; .sect .rom; .sect .data; .sect .bss .define .ciu .define .cui .define .cuu +.sect .text .ciu: .cui: .cuu: - ! $Header$ pop di ! return address ! pop cx, dest. size ! pop bx, source size @@ -29,6 +30,8 @@ jmp di 9: push ax ! to help debugging ? +.extern EILLINS +.extern .fat mov ax,EILLINS push ax jmp .fat diff --git a/mach/i86/libem/dup.s b/mach/i86/libem/dup.s index 9634463c5..ba2c75309 100644 --- a/mach/i86/libem/dup.s +++ b/mach/i86/libem/dup.s @@ -1,7 +1,8 @@ +.sect .text; .sect .rom; .sect .data; .sect .bss .define .dup - ! $Header$ ! #bytes in cx + .sect .text .dup: pop bx ! return address mov si,sp diff --git a/mach/i86/libem/dvi.s b/mach/i86/libem/dvi.s index fd3daac87..38cabc6e6 100644 --- a/mach/i86/libem/dvi.s +++ b/mach/i86/libem/dvi.s @@ -1,7 +1,8 @@ +.sect .text; .sect .rom; .sect .data; .sect .bss .define .dvi - ! $Header$ ! #bytes in ax + .sect .text .dvi: pop bx ! return address cmp ax,2 @@ -24,12 +25,15 @@ push si push dx push ax +.extern .dvi4 call .dvi4 pop bx push cx push ax jmp bx 9: +.extern EODDZ +.extern .trp mov ax,EODDZ push ax jmp .trp diff --git a/mach/i86/libem/dvi4.s b/mach/i86/libem/dvi4.s index e4c66ff13..c9c9714ed 100644 --- a/mach/i86/libem/dvi4.s +++ b/mach/i86/libem/dvi4.s @@ -1,3 +1,4 @@ +.sect .text; .sect .rom; .sect .data; .sect .bss .define .dvi4 yl=2 @@ -5,8 +6,8 @@ yh=4 xl=6 xh=8 +.sect .text .dvi4: - ! $Header$ mov si,sp ! copy of sp mov bx,yl(si) mov ax,yh(si) diff --git a/mach/i86/libem/dvu.s b/mach/i86/libem/dvu.s index b2bcdd678..71dcdfa5a 100644 --- a/mach/i86/libem/dvu.s +++ b/mach/i86/libem/dvu.s @@ -1,7 +1,8 @@ +.sect .text; .sect .rom; .sect .data; .sect .bss .define .dvu - ! $Header$ ! #bytes in ax + .sect .text .dvu: pop bx ! return address cmp ax,2 @@ -24,12 +25,15 @@ push si push dx push ax +.extern .dvu4 call .dvu4 pop bx push cx push ax jmp bx 9: +.extern EODDZ +.extern .trp mov ax,EODDZ push ax jmp .trp diff --git a/mach/i86/libem/dvu4.s b/mach/i86/libem/dvu4.s index fff547b6a..bc189ff5e 100644 --- a/mach/i86/libem/dvu4.s +++ b/mach/i86/libem/dvu4.s @@ -1,3 +1,4 @@ +.sect .text; .sect .rom; .sect .data; .sect .bss .define .dvu4 yl=2 @@ -5,8 +6,8 @@ yh=4 xl=6 xh=8 +.sect .text .dvu4: - ! $Header$ mov si,sp ! copy of sp mov bx,yl(si) mov ax,yh(si) diff --git a/mach/i86/libem/error.s b/mach/i86/libem/error.s index 64354e67f..dedc9df00 100644 --- a/mach/i86/libem/error.s +++ b/mach/i86/libem/error.s @@ -1,10 +1,11 @@ +.sect .text; .sect .rom; .sect .data; .sect .bss .define .error - ! $Header$ ! ax is trap number ! all registers must be saved ! because return is possible ! May only be called with error no's <16 +.sect .text .error: push bp push si @@ -16,6 +17,8 @@ mov cx,ax mov bx,1 sal bx,cl +.extern .ignmask +.extern .trp test bx,(.ignmask) jne 2f call .trp diff --git a/mach/i86/libem/exg.s b/mach/i86/libem/exg.s index 8b5bf4b93..be2f6cb40 100644 --- a/mach/i86/libem/exg.s +++ b/mach/i86/libem/exg.s @@ -1,7 +1,8 @@ +.sect .text; .sect .rom; .sect .data; .sect .bss .define .exg - ! $Header$ ! #bytes in cx +.sect .text .exg: pop bx ! return address mov dx,cx diff --git a/mach/i86/libem/fakfp.s b/mach/i86/libem/fakfp.s index df97bc26d..5d6bb3c7b 100644 --- a/mach/i86/libem/fakfp.s +++ b/mach/i86/libem/fakfp.s @@ -1,3 +1,5 @@ +.sect .text; .sect .rom; .sect .data; .sect .bss +.sect .text .define .mlf,.dvf,.ngf,.adf,.sbf,.cmf,.zrf,.fif,.fef .define .mlf8,.dvf8,.ngf8,.adf8,.sbf8,.cmf8,.zrf8,.fif8,.fef8 .define .mlf4,.dvf4,.ngf4,.adf4,.sbf4,.cmf4,.zrf4,.fif4,.fef4 @@ -35,8 +37,9 @@ .cuf: .cfu: .cff: - ! $Header$ pop bx ! return address +.extern EILLINS +.extern .fat mov ax,EILLINS push ax jmp .fat diff --git a/mach/i86/libem/fat.s b/mach/i86/libem/fat.s index 5a0dd072f..0302552dc 100644 --- a/mach/i86/libem/fat.s +++ b/mach/i86/libem/fat.s @@ -1,7 +1,10 @@ +.sect .text; .sect .rom; .sect .data; .sect .bss +.sect .text .define .fat .fat: - ! $Header$ +.extern .trp +.extern .stop call .trp call .stop ! no return diff --git a/mach/i86/libem/gto.s b/mach/i86/libem/gto.s index 8fdb23bab..b7c325b5d 100644 --- a/mach/i86/libem/gto.s +++ b/mach/i86/libem/gto.s @@ -1,7 +1,8 @@ +.sect .text; .sect .rom; .sect .data; .sect .bss +.sect .text .define .gto .gto: - ! $Header$ mov bp,4(bx) mov sp,2(bx) jmp (bx) diff --git a/mach/i86/libem/iaar.s b/mach/i86/libem/iaar.s index 4a2a92ebc..679c9b222 100644 --- a/mach/i86/libem/iaar.s +++ b/mach/i86/libem/iaar.s @@ -1,10 +1,12 @@ +.sect .text; .sect .rom; .sect .data; .sect .bss +.sect .text .define .iaar .iaar: - ! $Header$ pop bx pop dx cmp dx,2 +.extern .unknown jne .unknown pop si ! descriptor address pop ax ! index diff --git a/mach/i86/libem/ilar.s b/mach/i86/libem/ilar.s index 11fbed54f..a1de8be54 100644 --- a/mach/i86/libem/ilar.s +++ b/mach/i86/libem/ilar.s @@ -1,13 +1,16 @@ +.sect .text; .sect .rom; .sect .data; .sect .bss +.sect .text .define .ilar .ilar: - ! $Header$ pop bx pop dx +.extern .unknown cmp dx,2 jne .unknown pop di ! descriptor address pop ax ! index pop si ! array base push bx +.extern .lar2 jmp .lar2 diff --git a/mach/i86/libem/inn.s b/mach/i86/libem/inn.s index ced6bbc28..9b29e9f57 100644 --- a/mach/i86/libem/inn.s +++ b/mach/i86/libem/inn.s @@ -1,6 +1,7 @@ +.sect .text; .sect .rom; .sect .data; .sect .bss +.sect .text .define .inn - ! $Header$ ! #bytes in cx ! bit # in ax .inn: @@ -24,6 +25,6 @@ ! ax is result jmp bx - .data + .sect .data bits: - .byte 1,2,4,8,16,32,64,128 + .data1 1,2,4,8,16,32,64,128 diff --git a/mach/i86/libem/ior.s b/mach/i86/libem/ior.s index 0fc130a44..489eff7b9 100644 --- a/mach/i86/libem/ior.s +++ b/mach/i86/libem/ior.s @@ -1,6 +1,7 @@ +.sect .text; .sect .rom; .sect .data; .sect .bss +.sect .text .define .ior - ! $Header$ ! #bytes in cx .ior: pop bx ! return address diff --git a/mach/i86/libem/isar.s b/mach/i86/libem/isar.s index 569bb7797..af83d30c6 100644 --- a/mach/i86/libem/isar.s +++ b/mach/i86/libem/isar.s @@ -1,13 +1,16 @@ +.sect .text; .sect .rom; .sect .data; .sect .bss +.sect .text .define .isar .isar: - ! $Header$ pop bx pop dx cmp dx,2 +.extern .unknown jne .unknown pop si ! descriptor address pop ax ! index pop di ! array base push bx +.extern .sar2 jmp .sar2 diff --git a/mach/i86/libem/lar2.s b/mach/i86/libem/lar2.s index 58a7c3aa7..caa6575c3 100644 --- a/mach/i86/libem/lar2.s +++ b/mach/i86/libem/lar2.s @@ -1,7 +1,8 @@ +.sect .text; .sect .rom; .sect .data; .sect .bss +.sect .text .define .lar2 .lar2: - ! $Header$ pop bx ! return address ! di, descriptor address ! ax, index diff --git a/mach/i86/libem/loi.s b/mach/i86/libem/loi.s index c958d5e72..b6c750d83 100644 --- a/mach/i86/libem/loi.s +++ b/mach/i86/libem/loi.s @@ -1,6 +1,7 @@ +.sect .text; .sect .rom; .sect .data; .sect .bss +.sect .text .define .loi - ! $Header$ ! #bytes in cx ! source address in si .loi: diff --git a/mach/i86/libem/mli.s b/mach/i86/libem/mli.s index f143488db..0fdf338ab 100644 --- a/mach/i86/libem/mli.s +++ b/mach/i86/libem/mli.s @@ -1,6 +1,7 @@ +.sect .text; .sect .rom; .sect .data; .sect .bss +.sect .text .define .mli - ! $Header$ ! #bytes in ax .mli: pop bx ! return address @@ -22,6 +23,8 @@ push dx jmp .mli4 9: +.extern EODDZ +.extern .trp mov ax,EODDZ push ax jmp .trp diff --git a/mach/i86/libem/mli4.s b/mach/i86/libem/mli4.s index 36395fd7d..d3b87c69d 100644 --- a/mach/i86/libem/mli4.s +++ b/mach/i86/libem/mli4.s @@ -1,6 +1,7 @@ +.sect .text; .sect .rom; .sect .data; .sect .bss +.sect .text .define .mli4 - ! $Header$ ! x * y with ! x.low = si x.high = di ! y.low = bx y.high = ax diff --git a/mach/i86/libem/mon.s b/mach/i86/libem/mon.s index 30dd48ef0..42cac7ca8 100644 --- a/mach/i86/libem/mon.s +++ b/mach/i86/libem/mon.s @@ -1,5 +1,7 @@ +.sect .text; .sect .rom; .sect .data; .sect .bss +.sect .text .define .mon .mon: - ! $Header$ +.extern .stop call .stop diff --git a/mach/i86/libem/ngi.s b/mach/i86/libem/ngi.s index 6a479f7f2..ce4589511 100644 --- a/mach/i86/libem/ngi.s +++ b/mach/i86/libem/ngi.s @@ -1,6 +1,7 @@ +.sect .text; .sect .rom; .sect .data; .sect .bss +.sect .text .define .ngi - ! $Header$ ! #bytes in ax .ngi: pop bx ! return address @@ -22,6 +23,8 @@ push ax jmp bx 9: +.extern EODDZ +.extern .trp mov ax,EODDZ push ax jmp .trp diff --git a/mach/i86/libem/nop.s b/mach/i86/libem/nop.s index 26aa071d0..62e861b55 100644 --- a/mach/i86/libem/nop.s +++ b/mach/i86/libem/nop.s @@ -1,11 +1,13 @@ +.sect .text; .sect .rom; .sect .data; .sect .bss +.sect .text .define .nop +.extern printd, printc, hol0 SIO_S = 0xDA SIO_D = 0xD8 RXRDY = 0x02 .nop: - ! $Header$ mov ax,(hol0) call printd ! movb al,' ' diff --git a/mach/i86/libem/print.s b/mach/i86/libem/print.s index bb8ea8ae9..5cb8c04b0 100644 --- a/mach/i86/libem/print.s +++ b/mach/i86/libem/print.s @@ -1,10 +1,11 @@ +.sect .text; .sect .rom; .sect .data; .sect .bss +.sect .text .define printc,printd,prints SIO_D = 0xD8 SIO_S = 0xDA TXRDY = 0x01 - ! $Header$ ! argument in ax ! uses bx prints: @@ -33,7 +34,6 @@ printd: 1: xchg ax,dx addb al,'0' - .errnz printc - . ! argument in ax printc: diff --git a/mach/i86/libem/printf.s b/mach/i86/libem/printf.s index 31ea794be..83f133202 100644 --- a/mach/i86/libem/printf.s +++ b/mach/i86/libem/printf.s @@ -1,7 +1,9 @@ +.sect .text; .sect .rom; .sect .data; .sect .bss +.sect .text .define printf +.extern printc, printd, prints printf: - ! $Header$ pop bx ! return address xchg ax,di mov si,sp diff --git a/mach/i86/libem/rck.s b/mach/i86/libem/rck.s index 5a012147e..acc5330bf 100644 --- a/mach/i86/libem/rck.s +++ b/mach/i86/libem/rck.s @@ -1,6 +1,7 @@ +.sect .text; .sect .rom; .sect .data; .sect .bss +.sect .text .define .rck - ! $Header$ ! descriptor address in si ! value in ax, must be left there .rck: @@ -11,6 +12,8 @@ ret 2: push ax +.extern ERANGE +.extern .error mov ax,ERANGE call .error pop ax diff --git a/mach/i86/libem/rmi.s b/mach/i86/libem/rmi.s index 81fdc89ec..eda6ffd78 100644 --- a/mach/i86/libem/rmi.s +++ b/mach/i86/libem/rmi.s @@ -1,6 +1,7 @@ +.sect .text; .sect .rom; .sect .data; .sect .bss +.sect .text .define .rmi - ! $Header$ ! #bytes in ax .rmi: pop bx ! return address @@ -24,12 +25,15 @@ push si push dx push ax +.extern .rmi4 call .rmi4 pop ax push bx push dx jmp ax 9: +.extern EODDZ +.extern .trp mov ax,EODDZ push ax jmp .trp diff --git a/mach/i86/libem/rmi4.s b/mach/i86/libem/rmi4.s index 6abaea1b8..cdfcf75c9 100644 --- a/mach/i86/libem/rmi4.s +++ b/mach/i86/libem/rmi4.s @@ -1,3 +1,5 @@ +.sect .text; .sect .rom; .sect .data; .sect .bss +.sect .text .define .rmi4 yl=2 @@ -6,7 +8,6 @@ xl=6 xh=8 .rmi4: - ! $Header$ mov si,sp ! copy of sp mov bx,yl(si) mov ax,yh(si) diff --git a/mach/i86/libem/rmu.s b/mach/i86/libem/rmu.s index 3e74de7ea..7b89c669f 100644 --- a/mach/i86/libem/rmu.s +++ b/mach/i86/libem/rmu.s @@ -1,6 +1,7 @@ +.sect .text; .sect .rom; .sect .data; .sect .bss +.sect .text .define .rmu - ! $Header$ ! #bytes in ax .rmu: pop bx ! return address @@ -24,12 +25,15 @@ push si push dx push ax +.extern .rmu4 call .rmu4 pop ax push bx push dx jmp ax 9: +.extern EODDZ +.extern .trp mov ax,EODDZ push ax jmp .trp diff --git a/mach/i86/libem/rmu4.s b/mach/i86/libem/rmu4.s index 4a79fcf05..4ef5dd2f8 100644 --- a/mach/i86/libem/rmu4.s +++ b/mach/i86/libem/rmu4.s @@ -1,3 +1,5 @@ +.sect .text; .sect .rom; .sect .data; .sect .bss +.sect .text .define .rmu4 yl=2 @@ -6,7 +8,6 @@ xl=6 xh=8 .rmu4: - ! $Header$ mov si,sp ! copy of sp mov bx,yl(si) mov ax,yh(si) diff --git a/mach/i86/libem/rol.s b/mach/i86/libem/rol.s index 6de420f41..df8629914 100644 --- a/mach/i86/libem/rol.s +++ b/mach/i86/libem/rol.s @@ -1,6 +1,7 @@ +.sect .text; .sect .rom; .sect .data; .sect .bss +.sect .text .define .rol - ! $Header$ ! #bytes in ax .rol: pop dx ! return address @@ -28,6 +29,8 @@ 2: jmp dx 9: +.extern EODDZ +.extern .trp mov ax,EODDZ push ax jmp .trp diff --git a/mach/i86/libem/ror.s b/mach/i86/libem/ror.s index 5b98ec8f8..ea1183c1c 100644 --- a/mach/i86/libem/ror.s +++ b/mach/i86/libem/ror.s @@ -1,6 +1,7 @@ +.sect .text; .sect .rom; .sect .data; .sect .bss +.sect .text .define .ror - ! $Header$ ! #bytes in ax .ror: pop dx ! return address @@ -29,6 +30,8 @@ 2: jmp dx 9: +.extern EODDZ +.extern .trp mov ax,EODDZ push ax jmp .trp diff --git a/mach/i86/libem/sar2.s b/mach/i86/libem/sar2.s index 8a317de4b..61205bf89 100644 --- a/mach/i86/libem/sar2.s +++ b/mach/i86/libem/sar2.s @@ -1,7 +1,8 @@ +.sect .text; .sect .rom; .sect .data; .sect .bss +.sect .text .define .sar2 .sar2: - ! $Header$ pop bx ! return address ! si, descriptor address ! ax, index diff --git a/mach/i86/libem/sbi.s b/mach/i86/libem/sbi.s index 018f399fc..13018ff3e 100644 --- a/mach/i86/libem/sbi.s +++ b/mach/i86/libem/sbi.s @@ -1,6 +1,7 @@ +.sect .text; .sect .rom; .sect .data; .sect .bss +.sect .text .define .sbi - ! $Header$ ! #bytes in cx , top of stack in ax .sbi: pop bx ! return subress @@ -18,10 +19,12 @@ sub cx,ax mov ax,cx pop cx - sbc cx,dx + sbb cx,dx push cx jmp bx 9: +.extern EODDZ +.extern .trp mov ax,EODDZ push ax jmp .trp diff --git a/mach/i86/libem/set.s b/mach/i86/libem/set.s index 0c5dabd8b..b5d4c05d1 100644 --- a/mach/i86/libem/set.s +++ b/mach/i86/libem/set.s @@ -1,6 +1,7 @@ +.sect .text; .sect .rom; .sect .data; .sect .bss +.sect .text .define .set - ! $Header$ ! #bytes in cx ! bit # in ax .set: @@ -25,11 +26,13 @@ orb (di),dl jmp bx 2: +.extern ESET +.extern .trp push bx mov ax,ESET push ax jmp .trp - .data + .sect .data bits: - .byte 1,2,4,8,16,32,64,128 + .data1 1,2,4,8,16,32,64,128 diff --git a/mach/i86/libem/sli.s b/mach/i86/libem/sli.s index 3d57008bd..b8b0f1ef3 100644 --- a/mach/i86/libem/sli.s +++ b/mach/i86/libem/sli.s @@ -1,6 +1,7 @@ +.sect .text; .sect .rom; .sect .data; .sect .bss +.sect .text .define .sli - ! $Header$ ! #bytes in ax .sli: pop dx ! return address @@ -27,6 +28,8 @@ 2: jmp dx 9: +.extern EODDZ +.extern .trp mov ax,EODDZ push ax jmp .trp diff --git a/mach/i86/libem/sri.s b/mach/i86/libem/sri.s index 9cd97357c..1566ac3be 100644 --- a/mach/i86/libem/sri.s +++ b/mach/i86/libem/sri.s @@ -1,6 +1,7 @@ +.sect .text; .sect .rom; .sect .data; .sect .bss +.sect .text .define .sri - ! $Header$ ! #bytes in ax .sri: pop dx ! return address @@ -27,6 +28,8 @@ 2: jmp dx 9: +.extern EODDZ +.extern .trp mov ax,EODDZ push ax jmp .trp diff --git a/mach/i86/libem/sti.s b/mach/i86/libem/sti.s index 9e2fcc670..eb49d2f40 100644 --- a/mach/i86/libem/sti.s +++ b/mach/i86/libem/sti.s @@ -1,6 +1,7 @@ +.sect .text; .sect .rom; .sect .data; .sect .bss +.sect .text .define .sti - ! $Header$ ! #bytes in cx ! destination address in di .sti: diff --git a/mach/i86/libem/stop.s b/mach/i86/libem/stop.s index 5aeaf51fd..fbf0e691e 100644 --- a/mach/i86/libem/stop.s +++ b/mach/i86/libem/stop.s @@ -1,4 +1,5 @@ +.sect .text; .sect .rom; .sect .data; .sect .bss +.sect .text .define .stop .stop: - ! $Header$ int 3 diff --git a/mach/i86/libem/strhp.s b/mach/i86/libem/strhp.s index e5e11bf86..1dd17a96d 100644 --- a/mach/i86/libem/strhp.s +++ b/mach/i86/libem/strhp.s @@ -1,7 +1,9 @@ +.sect .text; .sect .rom; .sect .data; .sect .bss +.sect .text .define .strhp +.extern .reghp, .limhp, EHEAP, .fat .strhp: - ! $Header$ pop bx pop ax mov (.reghp),ax diff --git a/mach/i86/libem/trp.s b/mach/i86/libem/trp.s index 7f95dc289..123739559 100644 --- a/mach/i86/libem/trp.s +++ b/mach/i86/libem/trp.s @@ -1,6 +1,8 @@ +.sect .text; .sect .rom; .sect .data; .sect .bss +.sect .text .define .trp +.extern .trppc, .stop - ! $Header$ ! ax is trap number .trp: xor bx,bx diff --git a/mach/i86/libem/unknown.s b/mach/i86/libem/unknown.s index 2da916e26..a436afd48 100644 --- a/mach/i86/libem/unknown.s +++ b/mach/i86/libem/unknown.s @@ -1,7 +1,9 @@ +.sect .text; .sect .rom; .sect .data; .sect .bss +.sect .text .define .unknown +.extern EILLINS, .fat .unknown: - ! $Header$ mov ax,EILLINS push ax jmp .fat diff --git a/mach/i86/libem/xor.s b/mach/i86/libem/xor.s index 913d3429c..093e9c3f8 100644 --- a/mach/i86/libem/xor.s +++ b/mach/i86/libem/xor.s @@ -1,6 +1,7 @@ +.sect .text; .sect .rom; .sect .data; .sect .bss +.sect .text .define .xor - ! $Header$ ! #bytes in cx .xor: pop bx ! return address diff --git a/mach/i86/libsys/head_em.s b/mach/i86/libsys/head_em.s index d421e79b8..956765b16 100644 --- a/mach/i86/libsys/head_em.s +++ b/mach/i86/libsys/head_em.s @@ -1,6 +1,10 @@ +.sect .text; .sect .rom; .sect .data; .sect .bss + .define begtext,begdata,begbss .define hol0,.reghp,.limhp,.trppc,.ignmask -.define ERANGE,ESET,EHEAP,ECASE,EILLINS,EODDZ +.define ERANGE,ESET,EHEAP,ECASE,EILLINS +.extern _end +.extern np ERANGE = 1 ESET = 2 @@ -10,66 +14,45 @@ EILLINS = 18 EODDZ = 19 ECASE = 20 -base = 0x01C0 -topmem = 0xFFF0 - - .org topmem-16 -.extern __n_line -maxmem: -__n_line: - .space 16 - .errnz __n_line-0xFFE0 - - .base base - - .text +.sect .text begtext: - cld - xor ax,ax - mov ss,ax - mov ds,ax - mov es,ax - mov (2),cs - mov (0),.diverr - mov sp,maxmem - mov di,begbss - mov cx,[[endbss-begbss]/2]&0x7FFF - ! xor ax,ax ! ax still is 0 - rep stos - mov ax,envp - push ax - mov ax,argv - push ax - mov ax,1 - push ax + mov bx,sp + mov cx,(bx) + add bx,2 + mov ax,cx + inc ax + shl ax,1 + add ax,bx + push ax + push bx + push cx + mov (np),begbss + mov bx,endbss + push bx + call _brk ! allocate space for bss + pop si + xor bp,bp call _m_a_i_n - call .stop -.diverr: - push ax - mov ax,EIDIVZ - call .error - pop ax - iret - - .data + int 0x81 +.sect .data begdata: hol0: - .word 0,0 - .word 0,0 + .data2 0,0 + .data2 0,0 argv: - .word 3f + .data2 3f envp: - .word 0 + .data2 0 3: .asciz "PROGRAM" .reghp: - .word endbss + .data2 endbss .limhp: - .word endbss + .data2 endbss .ignmask: - .word 0 + .data2 0 .trppc: - .word 0 + .data2 0 - .bss + .sect .bss begbss: -- 2.34.1