forked from hcchengithub/eforth-x86-64bits
-
Notifications
You must be signed in to change notification settings - Fork 0
/
03_codewords.f
41 lines (29 loc) · 1.47 KB
/
03_codewords.f
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
.( including 03_codewords.f ) cr
mywords definitions
\ STC doesn't need following words. They are all CPU instructions, use them directly in colon definitions. Then are
\ immediate compiling commands.
\ When used in interprete state, we need following words to execute them.
\ {hlt} ( -- )
\ CPU instruction. Halt when nothing to do, QEMU save power.
\ "d:\Learnings\CPU\IA-32 Software Developer's Manual Volume 2 Instruction Set Reference 2002.pdf" page 3-316
: {hlt}
hlt
;
\ {cli} ( -- )
\ CPU instruction. Clear Interrupt flag, disable interrupt.
\ "d:\Learnings\CPU\IA-32 Software Developer's Manual Volume 2 Instruction Set Reference 2002.pdf" page 3-316
: {cli}
cli
;
\ {sti} ( -- )
\ CPU instruction. Set Interrupt flag, enable interrupt.
\ "d:\Learnings\CPU\IA-32 Software Developer's Manual Volume 2 Instruction Set Reference 2002.pdf" page 3-316
: {sti}
sti nop nop
;
\ {nop} ( -- )
\ CPU instruction. Do nothing.
\ "d:\Learnings\CPU\IA-32 Software Developer's Manual Volume 2 Instruction Set Reference 2002.pdf" page 3-316
: {nop}
nop
;