-
Notifications
You must be signed in to change notification settings - Fork 0
/
arch.S
44 lines (28 loc) · 756 Bytes
/
arch.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
//------------------------------------------------------------------------------
// SYS86 project
// Miscellaneous architecture specifics
//------------------------------------------------------------------------------
.code16
.text
//------------------------------------------------------------------------------
// Halt processor and wait for interrupt
.global halt
halt:
hlt
ret
//------------------------------------------------------------------------------
// I/O helpers
.global inw
inw:
mov %sp,%bx
mov 2(%bx),%dx
in %dx,%ax
ret
.global outw
outw:
mov %sp,%bx
mov 2(%bx),%dx
mov 4(%bx),%ax
out %ax,%dx
ret
//------------------------------------------------------------------------------