Parcourir la source

make trap handling more consistent

ceriel il y a 36 ans
Parent
commit
c259e2c9f8

+ 1 - 1
mach/i86/libem/adi.s

@@ -24,5 +24,5 @@
 .extern	EODDZ
 .extern .trp
 	mov     ax,EODDZ
-	push    ax
+	push	bx
 	jmp     .trp

+ 1 - 1
mach/i86/libem/dvi.s

@@ -35,5 +35,5 @@
 .extern EODDZ
 .extern .trp
         mov     ax,EODDZ
-        push    ax
+        push    bx
         jmp     .trp

+ 1 - 1
mach/i86/libem/dvu.s

@@ -35,5 +35,5 @@
 .extern EODDZ
 .extern .trp
 	mov     ax,EODDZ
-	push    ax
+	push    bx
 	jmp     .trp

+ 9 - 0
mach/i86/libem/error.s

@@ -1,5 +1,6 @@
 .sect .text; .sect .rom; .sect .data; .sect .bss
 .define .error
+.define .Xtrp
 
 	! ax is trap number
 	! all registers must be saved
@@ -31,3 +32,11 @@
 	pop  si
 	pop  bp
 	ret
+
+.Xtrp:
+	cmp	ax,16
+	jge	1f
+	call	.error
+	ret
+1:
+	jmp	.trp

+ 1 - 2
mach/i86/libem/fakfp.s

@@ -35,5 +35,4 @@
 .cmf4:
 .cmf8:
 	mov	ax,18	! illegal instruction EILLINS
-	call	.trp
-	ret
+	jmp	.trp

+ 1 - 1
mach/i86/libem/mli.s

@@ -38,5 +38,5 @@
 .extern EODDZ
 .extern .trp
 	mov     ax,EODDZ
-	push    ax
+	push    bx
 	jmp     .trp

+ 1 - 1
mach/i86/libem/ngi.s

@@ -26,5 +26,5 @@
 .extern EODDZ
 .extern .trp
 	mov     ax,EODDZ
-	push    ax
+	push    bx
 	jmp     .trp

+ 1 - 1
mach/i86/libem/rmi.s

@@ -35,5 +35,5 @@
 .extern EODDZ
 .extern .trp
 	mov     ax,EODDZ
-	push    ax
+	push    bx
 	jmp     .trp

+ 1 - 1
mach/i86/libem/rmu.s

@@ -35,5 +35,5 @@
 .extern EODDZ
 .extern .trp
 	mov     ax,EODDZ
-	push    ax
+	push    bx
 	jmp     .trp

+ 1 - 1
mach/i86/libem/rol.s

@@ -32,5 +32,5 @@
 .extern EODDZ
 .extern .trp
 	mov     ax,EODDZ
-	push    ax
+	push    dx
 	jmp     .trp

+ 1 - 1
mach/i86/libem/ror.s

@@ -33,5 +33,5 @@
 .extern EODDZ
 .extern .trp
 	mov     ax,EODDZ
-	push    ax
+	push    dx
 	jmp     .trp

+ 1 - 1
mach/i86/libem/sbi.s

@@ -26,5 +26,5 @@
 .extern EODDZ
 .extern .trp
 	mov     ax,EODDZ
-	push    ax
+	push    bx
 	jmp     .trp

+ 0 - 1
mach/i86/libem/set.s

@@ -35,7 +35,6 @@
 .extern .trp
 	pop	di
 	mov     ax,ESET
-	push    ax
 	jmp     .trp
 
 	.sect .data

+ 1 - 1
mach/i86/libem/sli.s

@@ -31,5 +31,5 @@
 .extern EODDZ
 .extern .trp
 	mov     ax,EODDZ
-	push    ax
+	push    dx
 	jmp     .trp

+ 1 - 1
mach/i86/libem/sri.s

@@ -31,5 +31,5 @@
 .extern EODDZ
 .extern .trp
 	mov     ax,EODDZ
-	push    ax
+	push    dx
 	jmp     .trp

+ 7 - 5
mach/i86/libem/strhp.s

@@ -12,14 +12,16 @@
 	add	ax,02000
 	and	ax,~0777
 	mov	(.limhp),ax
+	push	bx
 	push	ax
 	call	_brk
-	or	ax,ax
-	jne	2f
+	pop	cx
+	pop	bx
+	cmp	ax,-1
+	je	2f
 1:
 	jmp	bx
 2:
 	mov	ax,EHEAP
-	push	ax
-	call	.trp
-	jmp	bx
+	push	bx
+	jmp	.trp