adapted to new assembler syntax
authorceriel <none@none>
Thu, 8 Jan 1987 10:13:48 +0000 (10:13 +0000)
committerceriel <none@none>
Thu, 8 Jan 1987 10:13:48 +0000 (10:13 +0000)
54 files changed:
mach/i86/libem/LIST
mach/i86/libem/Makefile
mach/i86/libem/adi.s
mach/i86/libem/and.s
mach/i86/libem/cii.s
mach/i86/libem/cms.s
mach/i86/libem/cmu4.s
mach/i86/libem/com.s
mach/i86/libem/csa2.s
mach/i86/libem/csb2.s
mach/i86/libem/cuu.s
mach/i86/libem/dup.s
mach/i86/libem/dvi.s
mach/i86/libem/dvi4.s
mach/i86/libem/dvu.s
mach/i86/libem/dvu4.s
mach/i86/libem/error.s
mach/i86/libem/exg.s
mach/i86/libem/fakfp.s
mach/i86/libem/fat.s
mach/i86/libem/gto.s
mach/i86/libem/iaar.s
mach/i86/libem/ilar.s
mach/i86/libem/inn.s
mach/i86/libem/ior.s
mach/i86/libem/isar.s
mach/i86/libem/lar2.s
mach/i86/libem/loi.s
mach/i86/libem/mli.s
mach/i86/libem/mli4.s
mach/i86/libem/mon.s
mach/i86/libem/ngi.s
mach/i86/libem/nop.s
mach/i86/libem/print.s
mach/i86/libem/printf.s
mach/i86/libem/rck.s
mach/i86/libem/rmi.s
mach/i86/libem/rmi4.s
mach/i86/libem/rmu.s
mach/i86/libem/rmu4.s
mach/i86/libem/rol.s
mach/i86/libem/ror.s
mach/i86/libem/sar2.s
mach/i86/libem/sbi.s
mach/i86/libem/set.s
mach/i86/libem/sli.s
mach/i86/libem/sri.s
mach/i86/libem/sti.s
mach/i86/libem/stop.s
mach/i86/libem/strhp.s
mach/i86/libem/trp.s
mach/i86/libem/unknown.s
mach/i86/libem/xor.s
mach/i86/libsys/head_em.s

index 370909b..a94a4e3 100644 (file)
@@ -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
index 351b516..3dcf0e6 100644 (file)
@@ -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
index f1f0609..88f12a2 100644 (file)
@@ -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
index e77b09d..07e2c74 100644 (file)
@@ -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
index 4304a0e..4cf0cb3 100644 (file)
@@ -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
index cec20db..308d70a 100644 (file)
@@ -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
index 2e4bf94..fc14b4d 100644 (file)
@@ -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
index 23aee51..ea398d8 100644 (file)
@@ -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
index 60ef8ed..257f703 100644 (file)
@@ -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
index f49fe8a..bae8558 100644 (file)
@@ -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
index 7719f39..3d47d5f 100644 (file)
@@ -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
index 9634463..ba2c753 100644 (file)
@@ -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
index fd3daac..38cabc6 100644 (file)
@@ -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
         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
index e4c66ff..c9c9714 100644 (file)
@@ -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)
index b2bcdd6..71dcdfa 100644 (file)
@@ -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
        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
index fff547b..bc189ff 100644 (file)
@@ -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)
index 64354e6..dedc9df 100644 (file)
@@ -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
index 8b5bf4b..be2f6cb 100644 (file)
@@ -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
index df97bc2..5d6bb3c 100644 (file)
@@ -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
index 5a0dd07..0302552 100644 (file)
@@ -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
index 8fdb23b..b7c325b 100644 (file)
@@ -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)
index 4a2a92e..679c9b2 100644 (file)
@@ -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
index 11fbed5..a1de8be 100644 (file)
@@ -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
index ced6bbc..9b29e9f 100644 (file)
@@ -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
index 0fc130a..489eff7 100644 (file)
@@ -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
index 569bb77..af83d30 100644 (file)
@@ -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
index 58a7c3a..caa6575 100644 (file)
@@ -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
index c958d5e..b6c750d 100644 (file)
@@ -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:
index f143488..0fdf338 100644 (file)
@@ -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
index 36395fd..d3b87c6 100644 (file)
@@ -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
index 30dd48e..42cac7c 100644 (file)
@@ -1,5 +1,7 @@
+.sect .text; .sect .rom; .sect .data; .sect .bss
+.sect .text
 .define .mon
 
 .mon:
-        ! $Header$
+.extern .stop
        call    .stop
index 6a479f7..ce45895 100644 (file)
@@ -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
index 26aa071..62e861b 100644 (file)
@@ -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,' '
index bb8ea8a..5cb8c04 100644 (file)
@@ -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:
index 31ea794..83f1332 100644 (file)
@@ -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
index 5a01214..acc5330 100644 (file)
@@ -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
index 81fdc89..eda6ffd 100644 (file)
@@ -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
        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
index 6abaea1..cdfcf75 100644 (file)
@@ -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)
index 3e74de7..7b89c66 100644 (file)
@@ -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
        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
index 4a79fcf..4ef5dd2 100644 (file)
@@ -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)
index 6de420f..df86299 100644 (file)
@@ -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
index 5b98ec8..ea1183c 100644 (file)
@@ -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
index 8a317de..61205bf 100644 (file)
@@ -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
index 018f399..13018ff 100644 (file)
@@ -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
        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
index 0c5dabd..b5d4c05 100644 (file)
@@ -1,6 +1,7 @@
+.sect .text; .sect .rom; .sect .data; .sect .bss
+.sect .text
 .define .set
 
-        ! $Header$
        ! #bytes in cx
        ! bit # in ax
 .set:
        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
index 3d57008..b8b0f1e 100644 (file)
@@ -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
index 9cd9735..1566ac3 100644 (file)
@@ -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
index 9e2fcc6..eb49d2f 100644 (file)
@@ -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:
index 5aeaf51..fbf0e69 100644 (file)
@@ -1,4 +1,5 @@
+.sect .text; .sect .rom; .sect .data; .sect .bss
+.sect .text
 .define .stop
 .stop:
-        ! $Header$
        int     3
index e5e11bf..1dd17a9 100644 (file)
@@ -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
index 7f95dc2..1237395 100644 (file)
@@ -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
index 2da916e..a436afd 100644 (file)
@@ -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
index 913d342..093e9c3 100644 (file)
@@ -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
index d421e79..956765b 100644 (file)
@@ -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: