corrected .s files

This commit is contained in:
ceriel 1988-04-20 16:47:41 +00:00
parent 536716ba84
commit 379101461e
4 changed files with 53 additions and 42 deletions

View file

@ -1,4 +1,5 @@
.define _brksize
.globl endbss, _brksize
.data
_brksize: .word endbss
.sect .text; .sect .rom; .sect .data
.extern endbss, _brksize
.sect .data
_brksize: .data2 endbss

View file

@ -1,9 +1,11 @@
.define _begsig
.globl _begsig
.globl _vectab, _M
mtype = 2 | M+mtype = &M.m_type
.sect .text; .sect .rom; .sect .data
.extern _begsig
.extern _vectab, _M
mtype = 2 ! M+mtype = &M.m_type
.sect .text
_begsig:
push ax | after interrupt, save all regs
push ax ! after interrupt, save all regs
push bx
push cx
push dx
@ -13,18 +15,18 @@ _begsig:
push ds
push es
mov bx,sp
mov bx,18(bx) | bx = signal number
mov ax,bx | ax = signal number
dec bx | vectab[0] is for sig 1
add bx,bx | pointers are two bytes on 8088
mov bx,_vectab(bx) | bx = address of routine to call
push _M+mtype | push status of last system call
push ax | func called with signal number as arg
mov bx,18(bx) ! bx = signal number
mov ax,bx ! ax = signal number
dec bx ! vectab[0] is for sig 1
add bx,bx ! pointers are two bytes on 8088
mov bx,_vectab(bx) ! bx = address of routine to call
push (_M+mtype) ! push status of last system call
push ax ! func called with signal number as arg
call (bx)
back:
pop ax | get signal number off stack
pop _M+mtype | restore status of previous system call
pop es | signal handling finished
pop ax ! get signal number off stack
pop (_M+mtype) ! restore status of previous system call
pop es ! signal handling finished
pop ds
pop bp
pop di
@ -33,8 +35,8 @@ back:
pop cx
pop bx
pop ax
pop dummy | remove signal number from stack
pop (dummy) ! remove signal number from stack
iret
.data
dummy: .word 0
.sect .data
dummy: .data2 0

View file

@ -1,10 +1,17 @@
.define endtext, enddata, endbss, _end, _edata
.globl endtext, enddata, endbss, _end, _edata
.text
.sect .text; .sect .rom; .sect .data; .sect .bss
.define endtext,enddata,endbss
.define _end,_etext,_edata
! $Header$
.sect .text
endtext:
.data
_etext:
.align 2
.sect .data
enddata:
_edata:
.bss
endbss:
.align 2
.sect .endsect
_end:
endbss:
.align 2

View file

@ -1,32 +1,33 @@
.sect .text; .sect .rom; .sect .data
.define _send, _receive, _sendrec
.globl _send, _receive, _sendrec
| See ../h/com.h for C definitions
.extern _send, _receive, _sendrec
! See ../h/com.h for C definitions
SEND = 1
RECEIVE = 2
BOTH = 3
SYSVEC = 32
|*========================================================================*
| send and receive *
|*========================================================================*
| send(), receive(), sendrec() all save bp, but destroy ax, bx, and cx.
!*========================================================================*
! send and receive *
!*========================================================================*
! 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
_receive:
mov cx,*RECEIVE | receive(src, ptr)
mov cx,RECEIVE ! receive(src, ptr)
jmp L0
_sendrec:
mov cx,*BOTH | sendrec(srcdest, ptr)
mov cx,BOTH ! sendrec(srcdest, ptr)
jmp L0
L0: push bp | save bp
mov bp,sp | can't index off sp
mov ax,4(bp) | ax = dest-src
mov bx,6(bp) | bx = message pointer
int SYSVEC | trap to the kernel
pop bp | restore bp
ret | return
L0: push bp ! save bp
mov bp,sp ! can't index off sp
mov ax,4(bp) ! ax = dest-src
mov bx,6(bp) ! bx = message pointer
int SYSVEC ! trap to the kernel
pop bp ! restore bp
ret ! return