-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathsyscall.s
74 lines (63 loc) · 760 Bytes
/
syscall.s
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
.define _exit
.define _yield
.define _create_proc
.define _receive
.define _invoke
.define _send
.extern _printk
.extern _printx
_exit:
push bp
push ds
mov ax, #0x8000
mov ds, ax
mov ax, #0
int 0x80
pop bp
ret
_yield:
push bp
mov ax, #1
mov bx, #0
mov cx, #0
mov dx, #0
int 0x80
pop bp
ret
_create_proc: ! bx: seg; cs: ip; dx: sp; ah: pri
movb al, #2
push bp
mov bp, sp
mov bx, 4(bp)
mov cx, 6(bp)
mov dx, 8(bp)
movb ah, 10(bp)
int 0x80
pop bp
ret
_receive:
movb al, #3
push bp
mov bp, sp
mov bx, 4(bp)
int 0x80
pop bp
ret
_invoke:
movb al, #4
push bp
mov bp, sp
mov cx, 4(bp)
mov bx, 6(bp)
int 0x80
pop bp
ret
_send:
movb al, #5
push bp
mov bp, sp
mov cx, 4(bp)
mov bx, 6(bp)
int 0x80
pop bp
ret