corrected .s files
This commit is contained in:
parent
536716ba84
commit
379101461e
4 changed files with 53 additions and 42 deletions
|
@ -1,4 +1,5 @@
|
||||||
.define _brksize
|
.define _brksize
|
||||||
.globl endbss, _brksize
|
.sect .text; .sect .rom; .sect .data
|
||||||
.data
|
.extern endbss, _brksize
|
||||||
_brksize: .word endbss
|
.sect .data
|
||||||
|
_brksize: .data2 endbss
|
||||||
|
|
|
@ -1,9 +1,11 @@
|
||||||
.define _begsig
|
.define _begsig
|
||||||
.globl _begsig
|
.sect .text; .sect .rom; .sect .data
|
||||||
.globl _vectab, _M
|
.extern _begsig
|
||||||
mtype = 2 | M+mtype = &M.m_type
|
.extern _vectab, _M
|
||||||
|
mtype = 2 ! M+mtype = &M.m_type
|
||||||
|
.sect .text
|
||||||
_begsig:
|
_begsig:
|
||||||
push ax | after interrupt, save all regs
|
push ax ! after interrupt, save all regs
|
||||||
push bx
|
push bx
|
||||||
push cx
|
push cx
|
||||||
push dx
|
push dx
|
||||||
|
@ -13,18 +15,18 @@ _begsig:
|
||||||
push ds
|
push ds
|
||||||
push es
|
push es
|
||||||
mov bx,sp
|
mov bx,sp
|
||||||
mov bx,18(bx) | bx = signal number
|
mov bx,18(bx) ! bx = signal number
|
||||||
mov ax,bx | ax = signal number
|
mov ax,bx ! ax = signal number
|
||||||
dec bx | vectab[0] is for sig 1
|
dec bx ! vectab[0] is for sig 1
|
||||||
add bx,bx | pointers are two bytes on 8088
|
add bx,bx ! pointers are two bytes on 8088
|
||||||
mov bx,_vectab(bx) | bx = address of routine to call
|
mov bx,_vectab(bx) ! bx = address of routine to call
|
||||||
push _M+mtype | push status of last system call
|
push (_M+mtype) ! push status of last system call
|
||||||
push ax | func called with signal number as arg
|
push ax ! func called with signal number as arg
|
||||||
call (bx)
|
call (bx)
|
||||||
back:
|
back:
|
||||||
pop ax | get signal number off stack
|
pop ax ! get signal number off stack
|
||||||
pop _M+mtype | restore status of previous system call
|
pop (_M+mtype) ! restore status of previous system call
|
||||||
pop es | signal handling finished
|
pop es ! signal handling finished
|
||||||
pop ds
|
pop ds
|
||||||
pop bp
|
pop bp
|
||||||
pop di
|
pop di
|
||||||
|
@ -33,8 +35,8 @@ back:
|
||||||
pop cx
|
pop cx
|
||||||
pop bx
|
pop bx
|
||||||
pop ax
|
pop ax
|
||||||
pop dummy | remove signal number from stack
|
pop (dummy) ! remove signal number from stack
|
||||||
iret
|
iret
|
||||||
|
|
||||||
.data
|
.sect .data
|
||||||
dummy: .word 0
|
dummy: .data2 0
|
||||||
|
|
|
@ -1,10 +1,17 @@
|
||||||
.define endtext, enddata, endbss, _end, _edata
|
.sect .text; .sect .rom; .sect .data; .sect .bss
|
||||||
.globl endtext, enddata, endbss, _end, _edata
|
.define endtext,enddata,endbss
|
||||||
.text
|
.define _end,_etext,_edata
|
||||||
|
|
||||||
|
! $Header$
|
||||||
|
.sect .text
|
||||||
endtext:
|
endtext:
|
||||||
.data
|
_etext:
|
||||||
|
.align 2
|
||||||
|
.sect .data
|
||||||
enddata:
|
enddata:
|
||||||
_edata:
|
_edata:
|
||||||
.bss
|
.align 2
|
||||||
endbss:
|
.sect .endsect
|
||||||
_end:
|
_end:
|
||||||
|
endbss:
|
||||||
|
.align 2
|
||||||
|
|
|
@ -1,32 +1,33 @@
|
||||||
|
.sect .text; .sect .rom; .sect .data
|
||||||
.define _send, _receive, _sendrec
|
.define _send, _receive, _sendrec
|
||||||
.globl _send, _receive, _sendrec
|
.extern _send, _receive, _sendrec
|
||||||
| See ../h/com.h for C definitions
|
! See ../h/com.h for C definitions
|
||||||
SEND = 1
|
SEND = 1
|
||||||
RECEIVE = 2
|
RECEIVE = 2
|
||||||
BOTH = 3
|
BOTH = 3
|
||||||
SYSVEC = 32
|
SYSVEC = 32
|
||||||
|
|
||||||
|*========================================================================*
|
!*========================================================================*
|
||||||
| send and receive *
|
! send and receive *
|
||||||
|*========================================================================*
|
!*========================================================================*
|
||||||
| send(), receive(), sendrec() all save bp, but destroy ax, bx, and cx.
|
! send(), receive(), sendrec() all save bp, but destroy ax, bx, and cx.
|
||||||
|
|
||||||
_send: mov cx,*SEND | send(dest, ptr)
|
_send: mov cx,SEND ! send(dest, ptr)
|
||||||
jmp L0
|
jmp L0
|
||||||
|
|
||||||
_receive:
|
_receive:
|
||||||
mov cx,*RECEIVE | receive(src, ptr)
|
mov cx,RECEIVE ! receive(src, ptr)
|
||||||
jmp L0
|
jmp L0
|
||||||
|
|
||||||
_sendrec:
|
_sendrec:
|
||||||
mov cx,*BOTH | sendrec(srcdest, ptr)
|
mov cx,BOTH ! sendrec(srcdest, ptr)
|
||||||
jmp L0
|
jmp L0
|
||||||
|
|
||||||
L0: push bp | save bp
|
L0: push bp ! save bp
|
||||||
mov bp,sp | can't index off sp
|
mov bp,sp ! can't index off sp
|
||||||
mov ax,4(bp) | ax = dest-src
|
mov ax,4(bp) ! ax = dest-src
|
||||||
mov bx,6(bp) | bx = message pointer
|
mov bx,6(bp) ! bx = message pointer
|
||||||
int SYSVEC | trap to the kernel
|
int SYSVEC ! trap to the kernel
|
||||||
pop bp | restore bp
|
pop bp ! restore bp
|
||||||
ret | return
|
ret ! return
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue