Open main menu
Home
Random
Recent changes
Special pages
Community portal
Preferences
About Wikipedia
Disclaimers
Incubator escapee wiki
Search
User menu
Talk
Dark mode
Contributions
Create account
Log in
Editing
Forth (programming language)
(section)
Warning:
You are not logged in. Your IP address will be publicly visible if you make any edits. If you
log in
or
create an account
, your edits will be attributed to your username, along with other benefits.
Anti-spam check. Do
not
fill this in!
=== Operating system, files, and multitasking === Most Forth systems run under a host operating system such as [[Microsoft Windows]], [[Linux]] or a version of [[Unix]] and use the host operating system's file system for source and data files; the ANSI Forth Standard describes the words used for I/O. All modern Forth systems use normal text files for source, even if they are embedded. An embedded system with a resident compiler gets its source via a serial line. Classic Forth systems traditionally use neither [[operating system]] nor [[file system]]. Instead of storing code in files, source code is stored in disk blocks written to physical disk addresses. The word <code>BLOCK</code> is employed to translate the number of a 1K-sized block of disk space into the address of a buffer containing the data, which is managed automatically by the Forth system. Block use has become rare since the mid-1990s. In a hosted system those blocks too are allocated in a normal file in any case. [[Computer multitasking|Multitasking]], most commonly [[Computer multitasking#Cooperative multitasking/time-sharing|cooperative]] [[round-robin scheduling]], is normally available (although multitasking words and support are not covered by the ANSI Forth Standard). The word <code>PAUSE</code> is used to save the current task's execution context, to locate the next task, and restore its execution context. Each task has its own stacks, private copies of some control variables and a scratch area. Swapping tasks is simple and efficient; as a result, Forth multitaskers are available even on very simple [[microcontroller]]s, such as the [[Intel MCS-51|Intel 8051]], [[Atmel AVR]], and [[TI MSP430]].<ref name="nxtDb">{{cite web | last = Rodriguez | first = Brad | url = https://www.bradrodriguez.com/papers/8051task.pdf | title = Multitasking 8051 CamelForth | access-date = 2023-04-29}}</ref> Other non-standard facilities include a mechanism for issuing [[system call|call]]s to the host OS or [[windowing system]]s, and many provide extensions that employ the scheduling provided by the operating system. Typically they have a larger and different set of words from the stand-alone Forth's <code>PAUSE</code> word for task creation, suspension, destruction and modification of priority.
Edit summary
(Briefly describe your changes)
By publishing changes, you agree to the
Terms of Use
, and you irrevocably agree to release your contribution under the
CC BY-SA 4.0 License
and the
GFDL
. You agree that a hyperlink or URL is sufficient attribution under the Creative Commons license.
Cancel
Editing help
(opens in new window)