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
MBASIC
(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!
== PEEKs, POKEs, and user functions == No discussion of BASICs on the [[8-bit computing|8-bit]] computers of the late '70s and early '80s would be complete without mentioning the importance of the [[PEEK and POKE]] functions for directly reading and writing to memory. Since these systems typically had no [[memory protection]], this allowed a programmer to access portions of the operating system, or functions that would not otherwise be available. This also provided opportunities for user programs to hang the system (by accident, usually). For example, a CP/M programmer might use a <code> POKE </code> function to allow BASIC to switch the console device to the serial port, if the system [[BIOS]] supported this. For machines with real-time clocks, a set of <code>PEEK</code> instructions might have been used to access the time. For more complex operations, MBASIC allowed user-defined functions that could be called from a BASIC program. These were typically placed in a reserved area of memory, or POKEd into string constants, as a series of [[Machine language|machine codes]] ([[opcodes]]). MBASIC also provided hardware <code>INP</code> and <code>OUT</code> instructions that read and wrote directly to the 8080 hardware input/output ports. This could be used to control peripheral devices from a BASIC program if the system hardware permitted. Any MBASIC programs that made use of <code>PEEK</code> and <code>POKE</code>, and of machine code user functions, were not portable between machines without modifications.
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)