make trap handling more consistent
This commit is contained in:
parent
be1e3440b7
commit
87e020db8a
16 changed files with 29 additions and 20 deletions
|
@ -24,5 +24,5 @@
|
||||||
.extern EODDZ
|
.extern EODDZ
|
||||||
.extern .trp
|
.extern .trp
|
||||||
mov ax,EODDZ
|
mov ax,EODDZ
|
||||||
push ax
|
push bx
|
||||||
jmp .trp
|
jmp .trp
|
||||||
|
|
|
@ -35,5 +35,5 @@
|
||||||
.extern EODDZ
|
.extern EODDZ
|
||||||
.extern .trp
|
.extern .trp
|
||||||
mov ax,EODDZ
|
mov ax,EODDZ
|
||||||
push ax
|
push bx
|
||||||
jmp .trp
|
jmp .trp
|
||||||
|
|
|
@ -35,5 +35,5 @@
|
||||||
.extern EODDZ
|
.extern EODDZ
|
||||||
.extern .trp
|
.extern .trp
|
||||||
mov ax,EODDZ
|
mov ax,EODDZ
|
||||||
push ax
|
push bx
|
||||||
jmp .trp
|
jmp .trp
|
||||||
|
|
|
@ -1,5 +1,6 @@
|
||||||
.sect .text; .sect .rom; .sect .data; .sect .bss
|
.sect .text; .sect .rom; .sect .data; .sect .bss
|
||||||
.define .error
|
.define .error
|
||||||
|
.define .Xtrp
|
||||||
|
|
||||||
! ax is trap number
|
! ax is trap number
|
||||||
! all registers must be saved
|
! all registers must be saved
|
||||||
|
@ -31,3 +32,11 @@
|
||||||
pop si
|
pop si
|
||||||
pop bp
|
pop bp
|
||||||
ret
|
ret
|
||||||
|
|
||||||
|
.Xtrp:
|
||||||
|
cmp ax,16
|
||||||
|
jge 1f
|
||||||
|
call .error
|
||||||
|
ret
|
||||||
|
1:
|
||||||
|
jmp .trp
|
||||||
|
|
|
@ -35,5 +35,4 @@
|
||||||
.cmf4:
|
.cmf4:
|
||||||
.cmf8:
|
.cmf8:
|
||||||
mov ax,18 ! illegal instruction EILLINS
|
mov ax,18 ! illegal instruction EILLINS
|
||||||
call .trp
|
jmp .trp
|
||||||
ret
|
|
||||||
|
|
|
@ -38,5 +38,5 @@
|
||||||
.extern EODDZ
|
.extern EODDZ
|
||||||
.extern .trp
|
.extern .trp
|
||||||
mov ax,EODDZ
|
mov ax,EODDZ
|
||||||
push ax
|
push bx
|
||||||
jmp .trp
|
jmp .trp
|
||||||
|
|
|
@ -26,5 +26,5 @@
|
||||||
.extern EODDZ
|
.extern EODDZ
|
||||||
.extern .trp
|
.extern .trp
|
||||||
mov ax,EODDZ
|
mov ax,EODDZ
|
||||||
push ax
|
push bx
|
||||||
jmp .trp
|
jmp .trp
|
||||||
|
|
|
@ -35,5 +35,5 @@
|
||||||
.extern EODDZ
|
.extern EODDZ
|
||||||
.extern .trp
|
.extern .trp
|
||||||
mov ax,EODDZ
|
mov ax,EODDZ
|
||||||
push ax
|
push bx
|
||||||
jmp .trp
|
jmp .trp
|
||||||
|
|
|
@ -35,5 +35,5 @@
|
||||||
.extern EODDZ
|
.extern EODDZ
|
||||||
.extern .trp
|
.extern .trp
|
||||||
mov ax,EODDZ
|
mov ax,EODDZ
|
||||||
push ax
|
push bx
|
||||||
jmp .trp
|
jmp .trp
|
||||||
|
|
|
@ -32,5 +32,5 @@
|
||||||
.extern EODDZ
|
.extern EODDZ
|
||||||
.extern .trp
|
.extern .trp
|
||||||
mov ax,EODDZ
|
mov ax,EODDZ
|
||||||
push ax
|
push dx
|
||||||
jmp .trp
|
jmp .trp
|
||||||
|
|
|
@ -33,5 +33,5 @@
|
||||||
.extern EODDZ
|
.extern EODDZ
|
||||||
.extern .trp
|
.extern .trp
|
||||||
mov ax,EODDZ
|
mov ax,EODDZ
|
||||||
push ax
|
push dx
|
||||||
jmp .trp
|
jmp .trp
|
||||||
|
|
|
@ -26,5 +26,5 @@
|
||||||
.extern EODDZ
|
.extern EODDZ
|
||||||
.extern .trp
|
.extern .trp
|
||||||
mov ax,EODDZ
|
mov ax,EODDZ
|
||||||
push ax
|
push bx
|
||||||
jmp .trp
|
jmp .trp
|
||||||
|
|
|
@ -35,7 +35,6 @@
|
||||||
.extern .trp
|
.extern .trp
|
||||||
pop di
|
pop di
|
||||||
mov ax,ESET
|
mov ax,ESET
|
||||||
push ax
|
|
||||||
jmp .trp
|
jmp .trp
|
||||||
|
|
||||||
.sect .data
|
.sect .data
|
||||||
|
|
|
@ -31,5 +31,5 @@
|
||||||
.extern EODDZ
|
.extern EODDZ
|
||||||
.extern .trp
|
.extern .trp
|
||||||
mov ax,EODDZ
|
mov ax,EODDZ
|
||||||
push ax
|
push dx
|
||||||
jmp .trp
|
jmp .trp
|
||||||
|
|
|
@ -31,5 +31,5 @@
|
||||||
.extern EODDZ
|
.extern EODDZ
|
||||||
.extern .trp
|
.extern .trp
|
||||||
mov ax,EODDZ
|
mov ax,EODDZ
|
||||||
push ax
|
push dx
|
||||||
jmp .trp
|
jmp .trp
|
||||||
|
|
|
@ -12,14 +12,16 @@
|
||||||
add ax,02000
|
add ax,02000
|
||||||
and ax,~0777
|
and ax,~0777
|
||||||
mov (.limhp),ax
|
mov (.limhp),ax
|
||||||
|
push bx
|
||||||
push ax
|
push ax
|
||||||
call _brk
|
call _brk
|
||||||
or ax,ax
|
pop cx
|
||||||
jne 2f
|
pop bx
|
||||||
|
cmp ax,-1
|
||||||
|
je 2f
|
||||||
1:
|
1:
|
||||||
jmp bx
|
jmp bx
|
||||||
2:
|
2:
|
||||||
mov ax,EHEAP
|
mov ax,EHEAP
|
||||||
push ax
|
push bx
|
||||||
call .trp
|
jmp .trp
|
||||||
jmp bx
|
|
||||||
|
|
Loading…
Add table
Reference in a new issue