Misplaced Pages

HDOS

Article snapshot taken from Wikipedia with creative commons attribution-sharealike license. Give it a read and then ask your questions in the chat. We can research this topic together.

HDOS is an early microcomputer operating system , originally written for the Heathkit H8 computer system and later also available for the Heathkit H89 and Zenith Z-89 computers. The author was Heath Company employee Gordon Letwin , who later was an early employee of Microsoft and lead architect of OS/2 .

#546453

65-413: HDOS originally came with a limited set of system software tools, including an assembler , but many commercial and large set of freeware programs from HUG (Heath User Group) became available for it eventually. HDOS 2.0 is notable because it was one of the first microcomputer operating systems to use loadable device drivers to achieve a degree of device independence and extensibility. Device names followed

130-432: A device driver for an operating system. Originally systems programmers invariably wrote in assembly language . Experiments with hardware support in high level languages in the late 1960s led to such languages as PL/S , BLISS , BCPL , and extended ALGOL for Burroughs large systems . Forth also has applications as a systems language. In the 1970s, C became widespread, aided by the growth of Unix . More recently

195-477: A register . The binary code for this instruction is 10110 followed by a 3-bit identifier for which register to use. The identifier for the AL register is 000, so the following machine code loads the AL register with the data 01100001. This binary computer code can be made more human-readable by expressing it in hexadecimal as follows. Here, B0 means "Move a copy of the following value into AL ", and 61

260-516: A higher-level language, for performance reasons or to interact directly with hardware in ways unsupported by the higher-level language. For instance, just under 2% of version 4.9 of the Linux kernel source code is written in assembly; more than 97% is written in C . Assembly language uses a mnemonic to represent, e.g., each low-level machine instruction or opcode , each directive , typically also each architectural register , flag , etc. Some of

325-478: A list of data, arguments or parameters. Some instructions may be "implied", which means the data upon which the instruction operates is implicitly defined by the instruction itself—such an instruction does not take an operand. The resulting statement is translated by an assembler into machine language instructions that can be loaded into memory and executed. For example, the instruction below tells an x86 / IA-32 processor to move an immediate 8-bit value into

390-717: A macro definition, e.g., MEXIT in HLASM , while others may be permitted within open code (outside macro definitions), e.g., AIF and COPY in HLASM. In assembly language, the term "macro" represents a more comprehensive concept than it does in some other contexts, such as the pre-processor in the C programming language , where its #define directive typically is used to create short single line macros. Assembler macro instructions, like macros in PL/I and some other languages, can be lengthy "programs" by themselves, executed by interpretation by

455-481: A mask of 0. Extended mnemonics are often used to support specialized uses of instructions, often for purposes not obvious from the instruction name. For example, many CPU's do not have an explicit NOP instruction, but do have instructions that can be used for the purpose. In 8086 CPUs the instruction xchg ax , ax is used for nop , with nop being a pseudo-opcode to encode the instruction xchg ax , ax . Some disassemblers recognize this and will decode

520-438: A mnemonic is a symbolic name for a single executable machine language instruction (an opcode ), and there is at least one opcode mnemonic defined for each machine language instruction. Each instruction typically consists of an operation or opcode plus zero or more operands . Most instructions refer to a single value or a pair of values. Operands can be immediate (value coded in the instruction itself), registers specified in

585-410: A move between a byte-sized register and either another register or memory, and the second byte, E0h, is encoded (with three bit-fields) to specify that both operands are registers, the source is AH , and the destination is AL . In a case like this where the same mnemonic can represent more than one binary instruction, the assembler determines which instruction to generate by examining the operands. In

650-522: A programmer, so that one program can be assembled in different ways, perhaps for different applications. Or, a pseudo-op can be used to manipulate presentation of a program to make it easier to read and maintain. Another common use of pseudo-ops is to reserve storage areas for run-time data and optionally initialize their contents to known values. Symbolic assemblers let programmers associate arbitrary names ( labels or symbols ) with memory locations and various constants. Usually, every constant and variable

715-400: A pseudoinstruction that expands to the machine's "set if less than" and "branch if zero (on the result of the set instruction)". Most full-featured assemblers also provide a rich macro language (discussed below) which is used by vendors and programmers to generate more complex code and data sequences. Since the information about pseudoinstructions and macros defined in the assembler environment

SECTION 10

#1732801533547

780-400: A second pass would require storing the symbol table in memory (to handle forward references ), rewinding and rereading the program source on tape , or rereading a deck of cards or punched paper tape . Later computers with much larger memories (especially disc storage), had the space to perform all necessary processing without such re-reading. The advantage of the multi-pass assembler is that

845-503: A service applications). Systems programming requires a great degree of hardware awareness. Its goal is to achieve efficient use of available resources, either because the software itself is performance-critical or because even small efficiency improvements directly transform into significant savings of time or money. The following attributes characterize systems programming: In systems programming, often limited programming facilities are available. The use of automatic garbage collection

910-521: A subset of C++ called Embedded C++ has seen some use, for instance it is used in the I/O Kit drivers of macOS . Engineers working at Google created Go in 2007 to address developer productivity in large distributed systems , with developer-focused features such as Concurrency , Garbage Collection , and faster program compilation than C and C++. In 2015 Rust came out, a general-purpose programming language often used in systems programming. Rust

975-408: A very strong correspondence between the instructions in the language and the architecture's machine code instructions . Assembly language usually has one statement per machine instruction (1:1), but constants, comments , assembler directives , symbolic labels of, e.g., memory locations , registers , and macros are generally also supported. The first assembly code in which a language

1040-403: Is a one-to-one correspondence between many simple assembly statements and machine language instructions. However, in some cases, an assembler may provide pseudoinstructions (essentially macros) which expand into several machine language instructions to provide commonly needed functionality. For example, for a machine that lacks a "branch if greater or equal" instruction, an assembler may provide

1105-447: Is a hexadecimal representation of the value 01100001, which is 97 in decimal . Assembly language for the 8086 family provides the mnemonic MOV (an abbreviation of move ) for instructions such as this, so the machine code above can be written as follows in assembly language, complete with an explanatory comment if required, after the semicolon. This is much easier to read and to remember. In some assembly languages (including this one)

1170-453: Is a key feature of assemblers, saving tedious calculations and manual address updates after program modifications. Most assemblers also include macro facilities for performing textual substitution – e.g., to generate common short sequences of instructions as inline , instead of called subroutines . Some assemblers may also be able to perform some simple types of instruction set -specific optimizations . One concrete example of this may be

1235-404: Is always completely unable to recover source comments. Each computer architecture has its own machine language. Computers differ in the number and type of operations they support, in the different sizes and numbers of registers, and in the representations of data in storage. While most general-purpose computers are able to carry out essentially the same functionality, the ways they do so differ;

1300-508: Is essential in assembly language programs, as the meaning and purpose of a sequence of binary machine instructions can be difficult to determine. The "raw" (uncommented) assembly language generated by compilers or disassemblers is quite difficult to read when changes must be made. Many assemblers support predefined macros , and others support programmer-defined (and repeatedly re-definable) macros involving sequences of text lines in which variables and constants are embedded. The macro definition

1365-401: Is given a name so instructions can reference those locations by name, thus promoting self-documenting code . In executable code, the name of each subroutine is associated with its entry point, so any calls to a subroutine can use its name. Inside subroutines, GOTO destinations are given labels. Some assemblers support local symbols which are often lexically distinct from normal symbols (e.g.,

SECTION 20

#1732801533547

1430-679: Is more than one assembler for the same architecture, and sometimes an assembler is specific to an operating system or to particular operating systems. Most assembly languages do not provide specific syntax for operating system calls, and most assembly languages can be used universally with any operating system, as the language provides access to all the real capabilities of the processor , upon which all system call mechanisms ultimately rest. In contrast to assembly languages, most high-level programming languages are generally portable across multiple architectures but require interpreting or compiling , much more complicated tasks than assembling. In

1495-442: Is most commonly a mixture of assembler statements, e.g., directives, symbolic machine instructions, and templates for assembler statements. This sequence of text lines may include opcodes or directives. Once a macro has been defined its name may be used in place of a mnemonic. When the assembler processes such a statement, it replaces the statement with the text lines associated with that macro, then processes them as if they existed in

1560-449: Is not common and debugging is sometimes hard to do. The runtime library , if available at all, is usually far less powerful, and does less error checking. Because of those limitations, monitoring and logging are often used; operating systems may have extremely elaborate logging subsystems. Implementing certain parts in operating systems and networking requires systems programming, for example implementing paging ( virtual memory ) or

1625-407: Is not present in the object program, a disassembler cannot reconstruct the macro and pseudoinstruction invocations but can only disassemble the actual machine instructions that the assembler generated from those abstract assembly-language entities. Likewise, since comments in the assembly language source file are ignored by the assembler and have no effect on the object code it generates, a disassembler

1690-576: Is the activity of programming computer system software . The primary distinguishing characteristic of systems programming when compared to application programming is that application programming aims to produce software which provides services to the user directly (e.g. word processor ), whereas systems programming aims to produce software and software platforms which provide services to other software, are performance constrained, or both (e.g. operating systems , computational science applications, game engines , industrial automation , and software as

1755-524: Is universally enforced by their syntax. For example, in the Intel x86 assembly language, a hexadecimal constant must start with a numeral digit, so that the hexadecimal number 'A' (equal to decimal ten) would be written as 0Ah or 0AH , not AH , specifically so that it cannot appear to be the name of register AH . (The same rule also prevents ambiguity with the names of registers BH , CH , and DH , as well as with any user-defined symbol that ends with

1820-483: Is used to represent machine code instructions is found in Kathleen and Andrew Donald Booth 's 1947 work, Coding for A.R.C. . Assembly code is converted into executable machine code by a utility program referred to as an assembler . The term "assembler" is generally attributed to Wilkes , Wheeler and Gill in their 1951 book The Preparation of Programs for an Electronic Digital Computer , who, however, used

1885-476: The xchg ax , ax instruction as nop . Similarly, IBM assemblers for System/360 and System/370 use the extended mnemonics NOP and NOPR for BC and BCR with zero masks. For the SPARC architecture, these are known as synthetic instructions . Some assemblers also support simple built-in macro-instructions that generate two or more machine instructions. For instance, with some Z80 assemblers

1950-471: The CPU pipeline as efficiently as possible. Assemblers have been available since the 1950s, as the first step above machine language and before high-level programming languages such as Fortran , Algol , COBOL and Lisp . There have also been several classes of translators and semi-automatic code generators with properties similar to both assembly and high-level languages, with Speedcode as perhaps one of

2015-460: The RSX-11 -style convention of DKn: where the first two letters were the device driver file name and n was a number (DK0:, DK1:, and so on would all be handled by DK.SYS). Other similarities to RSX included the use of PIP for file transfer, and the use of EOT for file termination. Similar to how Heath/Zenith published complete schematics and part lists for its computers, the company sold to users

HDOS - Misplaced Pages Continue

2080-440: The source code for HDOS. Item references (Heathkit part number) are HOS-1-SL part number 595–2466. The following list of commands are supported by HDOS. Assembly language In computer programming , assembly language (alternatively assembler language or symbolic machine code ), often referred to simply as assembly and commonly abbreviated as ASM or asm , is any low-level programming language with

2145-756: The 1950s and early 1960s. Some assemblers have free-form syntax, with fields separated by delimiters, e.g., punctuation, white space . Some assemblers are hybrid, with, e.g., labels, in a specific column and other fields separated by delimiters; this became more common than column-oriented syntax in the 1960s. An assembler program creates object code by translating combinations of mnemonics and syntax for operations and addressing modes into their numerical equivalents. This representation typically includes an operation code (" opcode ") as well as other control bits and data. The assembler also calculates constant expressions and resolves symbolic names for memory locations and other entities. The use of symbolic references

2210-544: The Intel 8080 family and the Intel 8086/8088. Because Intel claimed copyright on its assembly language mnemonics (on each page of their documentation published in the 1970s and early 1980s, at least), some companies that independently produced CPUs compatible with Intel instruction sets invented their own mnemonics. The Zilog Z80 CPU, an enhancement of the Intel 8080A , supports all the 8080A instructions plus many more; Zilog invented an entirely new assembly language, not only for

2275-527: The V20 and V30 actually wrote in NEC's assembly language rather than Intel's; since any two assembly languages for the same instruction set architecture are isomorphic (somewhat like English and Pig Latin ), there is no requirement to use a manufacturer's own published assembly language with that manufacturer's products. There is a large degree of diversity in the way the authors of assemblers categorize statements and in

2340-463: The Z80, NEC invented new mnemonics for all of the 8086 and 8088 instructions, to avoid accusations of infringement of Intel's copyright. (It is questionable whether such copyrights can be valid, and later CPU companies such as AMD and Cyrix republished Intel's x86/IA-32 instruction mnemonics exactly with neither permission nor legal penalty.) It is doubtful whether in practice many people who programmed

2405-402: The absence of errata makes the linking process (or the program load if the assembler directly produces executable code) faster. Example: in the following code snippet, a one-pass assembler would be able to determine the address of the backward reference BKWD when assembling statement S2 , but would not be able to determine the address of the forward reference FWD when assembling

2470-424: The architecture, these elements may also be combined for specific instructions or addressing modes using offsets or other data as well as fixed addresses. Many assemblers offer additional mechanisms to facilitate program development, to control the assembly process, and to aid debugging . Some are column oriented, with specific fields in specific columns; this was very common for machines using punched cards in

2535-513: The assembler during assembly. Since macros can have 'short' names but expand to several or indeed many lines of code, they can be used to make assembly language programs appear to be far shorter, requiring fewer lines of source code, as with higher level languages. They can also be used to add higher levels of structure to assembly programs, optionally introduce embedded debugging code via parameters and other similar features. Systems programming Systems programming , or system programming ,

2600-443: The assembler operates and "may affect the object code, the symbol table, the listing file, and the values of internal assembler parameters". Sometimes the term pseudo-opcode is reserved for directives that generate object code, such as those that generate data. The names of pseudo-ops often start with a dot to distinguish them from machine instructions. Pseudo-ops can make the assembly of the program dependent on parameters input by

2665-586: The better-known examples. There may be several assemblers with different syntax for a particular CPU or instruction set architecture . For instance, an instruction to add memory data to a register in a x86 -family processor might be add eax,[ebx] , in original Intel syntax , whereas this would be written addl (%ebx),%eax in the AT&;T syntax used by the GNU Assembler . Despite different appearances, different syntactic forms generally generate

HDOS - Misplaced Pages Continue

2730-674: The branch statement S1 ; indeed, FWD may be undefined. A two-pass assembler would determine both addresses in pass 1, so they would be known when generating code in pass 2. More sophisticated high-level assemblers provide language abstractions such as: See Language design below for more details. A program written in assembly language consists of a series of mnemonic processor instructions and meta-statements (known variously as declarative operations, directives, pseudo-instructions, pseudo-operations and pseudo-ops), comments and data. Assembly language instructions usually consist of an opcode mnemonic followed by an operand , which might be

2795-453: The corresponding assembly languages reflect these differences. Multiple sets of mnemonics or assembly-language syntax may exist for a single instruction set, typically instantiated in different assembler programs. In these cases, the most popular one is usually that supplied by the CPU manufacturer and used in its documentation. Two examples of CPUs that have two different sets of mnemonics are

2860-425: The first decades of computing, it was commonplace for both systems programming and application programming to take place entirely in assembly language. While still irreplaceable for some purposes, the majority of programming is now conducted in higher-level interpreted and compiled languages. In " No Silver Bullet ", Fred Brooks summarised the effects of the switch away from assembly language programming: "Surely

2925-480: The first example, the operand 61h is a valid hexadecimal numeric constant and is not a valid register name, so only the B0 instruction can be applicable. In the second example, the operand AH is a valid register name and not a valid numeric constant (hexadecimal, decimal, octal, or binary), so only the 88 instruction can be applicable. Assembly languages are always designed so that this sort of lack of ambiguity

2990-467: The following examples show. In each case, the MOV mnemonic is translated directly into one of the opcodes 88-8C, 8E, A0-A3, B0-BF, C6 or C7 by an assembler, and the programmer normally does not have to know or remember which. Transforming assembly language into machine code is the job of an assembler, and the reverse can at least partially be achieved by a disassembler . Unlike high-level languages , there

3055-459: The instruction ld hl,bc is recognized to generate ld l,c followed by ld h,b . These are sometimes known as pseudo-opcodes . Mnemonics are arbitrary symbols; in 1985 the IEEE published Standard 694 for a uniform set of mnemonics to be used by all assemblers. The standard has since been withdrawn. There are instructions used to define data elements to hold data and variables. They define

3120-526: The instruction or implied, or the addresses of data located elsewhere in storage. This is determined by the underlying processor architecture: the assembler merely reflects how this architecture works. Extended mnemonics are often used to specify a combination of an opcode with a specific operand, e.g., the System/360 assemblers use B as an extended mnemonic for BC with a mask of 15 and NOP ("NO OPeration" – do nothing for one step) for BC with

3185-403: The letter H and otherwise contains only characters that are hexadecimal digits, such as the word "BEACH".) Returning to the original example, while the x86 opcode 10110000 ( B0 ) copies an 8-bit value into the AL register, 10110001 ( B1 ) moves it into CL and 10110010 ( B2 ) does so into DL . Assembly language examples for these follow. The syntax of MOV can also be more complex as

3250-427: The mnemonics may be built-in and some user-defined. Many operations require one or more operands in order to form a complete instruction. Most assemblers permit named constants, registers, and labels for program and memory locations, and can calculate expressions for operands. Thus, programmers are freed from tedious repetitive calculations and assembler programs are much more readable than machine code. Depending on

3315-423: The most powerful stroke for software productivity, reliability, and simplicity has been the progressive use of high-level languages for programming. Most observers credit that development with at least a factor of five in productivity, and with concomitant gains in reliability, simplicity, and comprehensibility." Today, it is typical to use small amounts of assembly language code within larger systems implemented in

SECTION 50

#1732801533547

3380-463: The new instructions but also for all of the 8080A instructions. For example, where Intel uses the mnemonics MOV , MVI , LDA , STA , LXI , LDAX , STAX , LHLD , and SHLD for various data transfer instructions, the Z80 assembly language uses the mnemonic LD for all of them. A similar case is the NEC V20 and V30 CPUs, enhanced copies of the Intel 8086 and 8088, respectively. Like Zilog with

3445-400: The nomenclature that they use. In particular, some describe anything other than a machine mnemonic or extended mnemonic as a pseudo-operation (pseudo-op). A typical assembly language consists of 3 types of instruction statements that are used to define program operations: Instructions (statements) in assembly language are generally very simple, unlike those in high-level languages . Generally,

3510-405: The operation, and if necessary, pad it with one or more " no-operation " instructions in a later pass or the errata. In an assembler with peephole optimization , addresses may be recalculated between passes to allow replacing pessimistic code with code tailored to the exact distance from the target. The original reason for the use of one-pass assemblers was memory size and speed of assembly – often

3575-499: The same mnemonic is used for different instructions, that means that the mnemonic corresponds to several different binary instruction codes, excluding data (e.g. the 61h in this example), depending on the operands that follow the mnemonic. For example, for the x86/IA-32 CPUs, the Intel assembly language syntax MOV AL, AH represents an instruction that moves the contents of register AH into register AL . The hexadecimal form of this instruction is: The first byte, 88h, identifies

3640-489: The same mnemonic, such as MOV, may be used for a family of related instructions for loading, copying and moving data, whether these are immediate values, values in registers, or memory locations pointed to by values in registers or by immediate (a.k.a. direct) addresses. Other assemblers may use separate opcode mnemonics such as L for "move memory to register", ST for "move register to memory", LR for "move register to register", MVI for "move immediate operand to memory", etc. If

3705-415: The same numeric machine code . A single assembler may also have different modes in order to support variations in syntactic forms as well as their exact semantic interpretations (such as FASM -syntax, TASM -syntax, ideal mode, etc., in the special case of x86 assembly programming). There are two types of assemblers based on how many passes through the source are needed (how many times the assembler reads

3770-433: The source code file (including, in some assemblers, expansion of any macros existing in the replacement text). Macros in this sense date to IBM autocoders of the 1950s. Macro assemblers typically have directives to, e.g., define macros, define variables, set variables to the result of an arithmetic, logical or string expression, iterate, conditionally generate code. Some of those directives may be restricted to use within

3835-407: The source) to produce the object file. In both cases, the assembler must be able to determine the size of each instruction on the initial passes in order to calculate the addresses of subsequent symbols. This means that if the size of an operation referring to an operand defined later depends on the type or distance of the operand, the assembler will make a pessimistic estimate when first encountering

3900-456: The term to mean "a program that assembles another program consisting of several sections into a single program". The conversion process is referred to as assembly , as in assembling the source code . The computational step when an assembler is processing a program is called assembly time . Because assembly depends on the machine code instructions, each assembly language is specific to a particular computer architecture . Sometimes there

3965-496: The type of data, the length and the alignment of data. These instructions can also define whether the data is available to outside programs (programs assembled separately) or only to the program in which the data section is defined. Some assemblers classify these as pseudo-ops. Assembly directives, also called pseudo-opcodes, pseudo-operations or pseudo-ops, are commands given to an assembler "directing it to perform operations other than assembling instructions". Directives affect how

SECTION 60

#1732801533547

4030-414: The ubiquitous x86 assemblers from various vendors. Called jump-sizing , most of them are able to perform jump-instruction replacements (long jumps replaced by short or relative jumps) in any number of passes, on request. Others may even do simple rearrangement or insertion of instructions, such as some assemblers for RISC architectures that can help optimize a sensible instruction scheduling to exploit

4095-591: The use of "10$ " as a GOTO destination). Some assemblers, such as NASM , provide flexible symbol management, letting programmers manage different namespaces , automatically calculate offsets within data structures , and assign labels that refer to literal values or the result of simple computations performed by the assembler. Labels can also be used to initialize constants and variables with relocatable addresses. Assembly languages, like most other computer languages, allow comments to be added to program source code that will be ignored during assembly. Judicious commenting

4160-409: The writing of custom assembler code ( IBM's Basic Assembly Language (BAL)), which integrated with the operating system such as OS/MVS , DOS/VSE or VM/CMS . Indeed, some IBM software products had substantial code contributions from customer programming staff. This type of programming is progressively less common, and increasingly done in C rather than Assembly, but the term systems programmer

4225-530: Was designed with memory safety in mind and to be as performant as C and C++. For historical reasons, some organizations use the term systems programmer to describe a job function which would be more accurately termed systems administrator . This is particularly true in organizations whose computer resources have historically been dominated by mainframes , although the term is even used to describe job functions which do not involve mainframes. This usage arose because administration of IBM mainframes often involved

#546453