From c259e2c9f82d76338d8533722394098526ba888d Mon Sep 17 00:00:00 2001 From: ceriel Date: Wed, 13 Jul 1988 14:29:32 +0000 Subject: [PATCH] make trap handling more consistent --- mach/i86/libem/adi.s | 2 +- mach/i86/libem/dvi.s | 2 +- mach/i86/libem/dvu.s | 2 +- mach/i86/libem/error.s | 9 +++++++++ mach/i86/libem/fakfp.s | 3 +-- mach/i86/libem/mli.s | 2 +- mach/i86/libem/ngi.s | 2 +- mach/i86/libem/rmi.s | 2 +- mach/i86/libem/rmu.s | 2 +- mach/i86/libem/rol.s | 2 +- mach/i86/libem/ror.s | 2 +- mach/i86/libem/sbi.s | 2 +- mach/i86/libem/set.s | 1 - mach/i86/libem/sli.s | 2 +- mach/i86/libem/sri.s | 2 +- mach/i86/libem/strhp.s | 12 +++++++----- 16 files changed, 29 insertions(+), 20 deletions(-) diff --git a/mach/i86/libem/adi.s b/mach/i86/libem/adi.s index 88f12a29..b76949ae 100644 --- a/mach/i86/libem/adi.s +++ b/mach/i86/libem/adi.s @@ -24,5 +24,5 @@ .extern EODDZ .extern .trp mov ax,EODDZ - push ax + push bx jmp .trp diff --git a/mach/i86/libem/dvi.s b/mach/i86/libem/dvi.s index 9fa84705..e09c98d6 100644 --- a/mach/i86/libem/dvi.s +++ b/mach/i86/libem/dvi.s @@ -35,5 +35,5 @@ .extern EODDZ .extern .trp mov ax,EODDZ - push ax + push bx jmp .trp diff --git a/mach/i86/libem/dvu.s b/mach/i86/libem/dvu.s index ba563156..45f73a1d 100644 --- a/mach/i86/libem/dvu.s +++ b/mach/i86/libem/dvu.s @@ -35,5 +35,5 @@ .extern EODDZ .extern .trp mov ax,EODDZ - push ax + push bx jmp .trp diff --git a/mach/i86/libem/error.s b/mach/i86/libem/error.s index dedc9df0..49194d65 100644 --- a/mach/i86/libem/error.s +++ b/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 diff --git a/mach/i86/libem/fakfp.s b/mach/i86/libem/fakfp.s index f3a62a35..bffaea36 100644 --- a/mach/i86/libem/fakfp.s +++ b/mach/i86/libem/fakfp.s @@ -35,5 +35,4 @@ .cmf4: .cmf8: mov ax,18 ! illegal instruction EILLINS - call .trp - ret + jmp .trp diff --git a/mach/i86/libem/mli.s b/mach/i86/libem/mli.s index a8dbe3d5..eb0b800c 100644 --- a/mach/i86/libem/mli.s +++ b/mach/i86/libem/mli.s @@ -38,5 +38,5 @@ .extern EODDZ .extern .trp mov ax,EODDZ - push ax + push bx jmp .trp diff --git a/mach/i86/libem/ngi.s b/mach/i86/libem/ngi.s index ce458951..49061e16 100644 --- a/mach/i86/libem/ngi.s +++ b/mach/i86/libem/ngi.s @@ -26,5 +26,5 @@ .extern EODDZ .extern .trp mov ax,EODDZ - push ax + push bx jmp .trp diff --git a/mach/i86/libem/rmi.s b/mach/i86/libem/rmi.s index e3c50879..43bde9f3 100644 --- a/mach/i86/libem/rmi.s +++ b/mach/i86/libem/rmi.s @@ -35,5 +35,5 @@ .extern EODDZ .extern .trp mov ax,EODDZ - push ax + push bx jmp .trp diff --git a/mach/i86/libem/rmu.s b/mach/i86/libem/rmu.s index a026148d..4ed99722 100644 --- a/mach/i86/libem/rmu.s +++ b/mach/i86/libem/rmu.s @@ -35,5 +35,5 @@ .extern EODDZ .extern .trp mov ax,EODDZ - push ax + push bx jmp .trp diff --git a/mach/i86/libem/rol.s b/mach/i86/libem/rol.s index df862991..2b2af4f8 100644 --- a/mach/i86/libem/rol.s +++ b/mach/i86/libem/rol.s @@ -32,5 +32,5 @@ .extern EODDZ .extern .trp mov ax,EODDZ - push ax + push dx jmp .trp diff --git a/mach/i86/libem/ror.s b/mach/i86/libem/ror.s index ea1183c1..d92069c2 100644 --- a/mach/i86/libem/ror.s +++ b/mach/i86/libem/ror.s @@ -33,5 +33,5 @@ .extern EODDZ .extern .trp mov ax,EODDZ - push ax + push dx jmp .trp diff --git a/mach/i86/libem/sbi.s b/mach/i86/libem/sbi.s index 13018ff3..f5c81ebe 100644 --- a/mach/i86/libem/sbi.s +++ b/mach/i86/libem/sbi.s @@ -26,5 +26,5 @@ .extern EODDZ .extern .trp mov ax,EODDZ - push ax + push bx jmp .trp diff --git a/mach/i86/libem/set.s b/mach/i86/libem/set.s index 4bc68327..2a030b8f 100644 --- a/mach/i86/libem/set.s +++ b/mach/i86/libem/set.s @@ -35,7 +35,6 @@ .extern .trp pop di mov ax,ESET - push ax jmp .trp .sect .data diff --git a/mach/i86/libem/sli.s b/mach/i86/libem/sli.s index b8b0f1ef..4c4f98c2 100644 --- a/mach/i86/libem/sli.s +++ b/mach/i86/libem/sli.s @@ -31,5 +31,5 @@ .extern EODDZ .extern .trp mov ax,EODDZ - push ax + push dx jmp .trp diff --git a/mach/i86/libem/sri.s b/mach/i86/libem/sri.s index 1566ac3b..e3e623a9 100644 --- a/mach/i86/libem/sri.s +++ b/mach/i86/libem/sri.s @@ -31,5 +31,5 @@ .extern EODDZ .extern .trp mov ax,EODDZ - push ax + push dx jmp .trp diff --git a/mach/i86/libem/strhp.s b/mach/i86/libem/strhp.s index 601f4676..c8898f05 100644 --- a/mach/i86/libem/strhp.s +++ b/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