Machine code monitor
A machine code monitor is a programming tool or a primitive operating system that provides basic functionality on a computer . It is typically very small and can be used to start or debug other programs .
Machine code monitors were typically used as a replacement for a full operating system on very early home computers (e.g. the Apple I ) and embedded systems, or as a BIOS equivalent on workstations . Functionally only just above the machine console, the monitor allows at least to read and write data from memory cells and to execute a program from any memory address . The data entry and display is typically hexadecimal , but may well also in binary or octal done.
Some later home computers (e.g. Apple II , Commodore 16 ) also offered a built-in monitor as a low-level addition to the higher-level operating system that was also built in. On other computers (e.g. Commodore 64 ) a monitor could be loaded as a normal program from a mass storage device into the main memory, if required.
Monitors usually only offer a simple command line for operation .
Commands in a machine language monitor can look something like this:
200: 4C 00 02
This would write the three specified hexadecimally coded bytes to the memory locations starting at $ 0200 (i.e. hexadecimal 200), which means a jump to address $ 0200 on a 6502 -based computer (e.g. Commodore 64), i.e. an endless loop. After that, a command like
G 0200
(G for “Go”) this loop can then be executed. This is why there is always the option of canceling a running program in the monitor, usually with the Ctrl+ key combination C.
Simple monitors require no more than 200–300 bytes of memory , depending on the code density of the CPU used . More comfortable monitors sometimes have the option of disassembling the program code from the memory in assembly language or even accepting individual commands in assembler notation and then writing them to the memory as machine code . Compared to a real assembler, however, there is almost always no possibility of using symbolic addresses, so that longer programs can hardly be meaningfully written with a monitor.
Other possible functionalities that are otherwise found in debuggers are single-step operation with the option of displaying changes in the processor registers , as well as displaying the results of these address calculations, i.e. the effective address , in more complex addressing types.