1 ;; Native x86 GNU/Linux Forth System, Direct Threaded Code
3 ;; Copyright (C) 2020 Ketmar Dark // Invisible Vector
5 ;; This program is free software: you can redistribute it and/or modify
6 ;; it under the terms of the GNU General Public License as published by
7 ;; the Free Software Foundation, version 3 of the License ONLY.
9 ;; This program is distributed in the hope that it will be useful,
10 ;; but WITHOUT ANY WARRANTY; without even the implied warranty of
11 ;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
12 ;; GNU General Public License for more details.
14 ;; You should have received a copy of the GNU General Public License
15 ;; along with this program. If not, see <http://www.gnu.org/licenses/>.
18 ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
21 urword_uses par_ttylow_flush
28 urword_code
"N-BYE",nbye
30 urword_uses par_ttylow_flush
39 ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
40 urword_code
"(SYSCALL-0)",par_syscall_0
43 push EIP ; just in case
50 urword_code
"(SYSCALL-1)",par_syscall_1
51 ;; ( arg0 num -- res )
54 push EIP ; just in case
61 urword_code
"(SYSCALL-2)",par_syscall_2
62 ;; ( arg0 arg1 num -- res )
66 push EIP ; just in case
73 urword_code
"(SYSCALL-3)",par_syscall_3
74 ;; ( arg0 arg1 arg2 num -- res )
79 push EIP ; just in case
86 urword_code
"(SYSCALL-4)",par_syscall_4
87 ;; ( arg0 arg1 arg2 arg3 num -- res )
88 ; this cannot be called recursively anyway
89 ld
[fword_syscall4_eip_store
],EIP
96 ld
EIP,[fword_syscall4_eip_store
]
99 fword_syscall4_eip_store: dd 0
102 urword_code
"(SYSCALL-5)",par_syscall_5
103 ;; ( arg0 arg1 arg2 arg3 arg4 num -- res )
104 ; this cannot be called recursively anyway
105 ld
[fword_syscall5_eip_store
],EIP
113 ld
EIP,[fword_syscall5_eip_store
]
116 fword_syscall5_eip_store: dd 0
120 urword_code
"(BRK)",par_sbrk
121 ;; ( newaddr -- newaddr )
122 ;; returns current address if the request is invalid
123 push EIP ; just in case
125 ld
ebx,TOS
; new address
132 urword_forth
"(BRK?)",par_brkq