Glossary of Terms
This glossary defines some of the terms, symbols, and expressions used in computer architecture and assembly language programming. Terms in italic refer exclusively to 68000-family concepts.
| # | The # symbol indicates that the following value is an immediate or literal value; for example, #1234, #Monday. See immediate. | |||||||||||||||
| $ | The $ symbol indicates that the following number is a hexadecimal value; for example, $12, $12345678, and $00FE. Note that #$0AF2 indicates a literal hexadecimal value. See hexadecimal. | |||||||||||||||
| % | The % symbol indicates that the following number is a binary value; for example %00001111. See binary. | |||||||||||||||
| * | The asterisk is used in 68000 assembly language programs
in three circumstances. When located in the first column of a line, the asterisk
indicates a comment field. The assembler ignores anything on this line. A second use of
the asterisk is to indicate the current value of the location counter (i.e., the current
memory location into which code or data is to be loaded by the assembler). The third use
is as the conventional multiplier symbol. Consider the following example that illustrates
all three applications.
The 68000 assembler directive ORG (which resets the location counter) cannot take a label. However, we can use the directive EQU to equate a symbolic name to a value. In this case, the symbolic name Here is equated to the asterisk that is, of course, the current value of the location counter (i.e., $400). |
|||||||||||||||
ABSOLUTE ADDRESSING The address field of the instruction provides the actual or absolute address of the operand. For example, the MOVE 1000,D0 instruction means copy the contents of memory location 1000 into data register D0. Similarly, ADD Val6,D3 means add the contents of the memory location called Val6 to the contents of D3. Absolute addressing is used to access variables (e.g., expressions in the form A := B + C in a high-level language). Since absolute addressing does not yield position independent code, it is often avoided by the programmer.
ACTIVE-LOW A signal is called active-low if it is asserted by putting it into a low voltage state. An active-low signal is sometimes indicated by an asterisk as a suffix (e.g., RESET*, BERR*). For example, the signal RESET* is active-low and must be approximately 0V to cause a reset to take place. An active-high signal is one that is asserted by putting it into high voltage state.
ACTUAL PARAMETER See formal parameter.
ADDRESS ERROR EXCEPTION The 68000 must read word and longword operands from an even address boundary. If you attempt to read a .W or a .L operand at an odd boundary, an address error exception will occur. A word or a longword located at an odd boundary is called a misaligned operand. Note that the 68020 is able to handle misaligned operands.
ADDRESS REGISTER The 68000 has eight 32-bit special purpose address registers, A0 to A7. An address register is so called because it is used to hold the address of an operand. An operation on an address register always yields a 32-bit result. Even if a 16-bit operation is applied to the contents of an address register, the result is sign-extended to 32 bits. Operations on the contents of an address register (with the exception of CMPA) do not modify the CCR. Address registers are intended to be used in conjunction with the address register indirect addressing mode; for example, MOVE D0,(A2). Address register A7 is also used as a stack pointer by the 68000.
ADDRESSING MODE An addressing mode represents the way in which the location of an operand is expressed. Typical addressing modes are literal, absolute (memory direct), register indirect, and indexed.
ARRAY An array (also called a matrix) is a type of data structure. A two-dimensional n-column by m-row array consists of n x m elements. The 68000s indexed addressing mode makes it easy to access array elements.
ASCII The American Standard Code for Information Interchange provides a means of representing the common alphanumeric symbols by a 7-bit code. The ASCII code also includes special codes for nonprinting characters (such as carriage return or back space), and for communications control characters (such as ENQ, SYN, and NUL).
ASSEMBLE TIME Assemble time describes events that take place during the assembly of a program. That is, assemble time contrasts with run time. For example, symbolic expressions in the assembly language are evaluated at assemble time and not run time. Note that an assemble time operation is performed once only. For example, the expression ARRAY DS.B ROWS*COLS+1 is evaluated by the assembler, and the result of ROWS*COLS+1 is used to reserve the appropriate number of bytes of storage. By way of contrast, the address of the source operand 8+[A0]+[D3] in the instruction MOVE (8,A0,D3),D6 is evaluated at run time, because the contents of registers A0 and D0 are not known at assemble time and because the contents of these registers may change as the program is executed.
ASSEMBLER DIRECTIVE An assembler directive is a statement in an assembly language program that provides the assembler with some information it requires to assemble a source file into an object file. Typical assembler directives tell the assembler where to locate a program and data in memory and equate symbolic names to actual values. The most important assembler directives are: ORG, EQU, DS, and DC.
ASSEMBLY LANGUAGE An assembly language is a symbolic or human-readable form of a computers machine code. An assembly language is normally the most primitive language in which the programmer can write programs.
ASSERTED Digital systems use a high voltage and a low voltage to represent the two logical states. Sometimes a high level represents the active or true state, and sometimes a low level represents the active state. To avoid confusion, we use the term asserted to mean that a signal is put in a true or active state.
ATOMIC OPERATION An atomic operation is one that cannot be interrupted or subdivided in any way. Such an operation is also called indivisible.
AUTO-DECREMENTING A register is said to be auto-decrementing if its contents are automatically decremented before or after it is used. The 68000 implements address register indirect addressing with pre-decrementing. The effective address is expressed as -(Ai), and the contents of address register Ai are decremented before the address register is employed to access an operand. The size of the decrement depends on the operand (1 for a byte, 2 for a word, and 4 for a longword). For example, if address register A0 initially contains the value 12, the operation MOVE.B -(A0),D0 would decrement the contents of register A0 by 1 to get 11, read the byte in memory location 11, and deposit this byte in data register D0. This addressing mode makes it easy to step through tables and to implement stacks.
AUTO-INCREMENTING A register is said to be auto-incrementing if its contents are automatically incremented before or after it is used. The 68000 implements address register indirect addressing with post-incrementing. The effective address is expressed as (Ai)+, and the contents of address register Ai are incremented after the address register is employed to access an operand. The size of the increment depends on the operand (1 for a byte, 2 for a word, and 4 for a longword). For example, if address register A0 initially contains the value 12, the operation MOVE.B (A0)+,D0 would copy the byte in location 12 into D0, and then increase the contents of A0 by 1 to get 13. This addressing mode makes it easy to step through tables and to implement stacks. The 68000 uses address register indirect with pre-decrementing to implement push operations and address register indirect with post-incrementing to implement push operations.
BASE In positional notation each digit in a number has a weighting determined by the location of the digit within the number. We can express the integer N in base b as: N = dm-1 bm-1 + dm-2bm-2 + ... + d1b1 + d0b0 , where the di represents the ith digit of the number. Assembly language programmers work with three number bases: 10 (decimal), 2 (binary), and 16 (hexadecimal). Base 8 (octal) was once common but is rarely used today. By convention, a number on its own (e.g., 1234) is regarded as a decimal number. If it is prefixed by % it is a binary number, and if it is prefixed by $ it is a hexadecimal number. Programmers choose the most suitable base when writing programs. For example, you might write:
| MOVE.W | #365,D0 | Set up this years array | |
| LEA | Year,A0 | ||
| LOOP | ANDI.W | #$FF00,(A0) | Clear the most-significant byte of each entry |
| ORI.W | #%1010,(A0)+ | Set bits 1 and 3 of the entry | |
| SUBQ.W | #1,D0 | Repeat until all days processed | |
| BNE LOOP |
In this example, we use three bases (decimal 365, hexadecimal $FF00, binary %1010). Although there is no technical reason for choosing these bases, we use decimal to express the number of days in a year, hexadecimal to show that we wish to clear the upper byte of a word, and binary to show that we wish to clear bits 1 and 3 of a byte.
BAUD RATE The baud rate of a signal is a measure of the number of times at which it can change state per second. For example, a modem that transmits at 2400 baud causes the data to change state (i.e., to switch between two frequencies) 2400 times a second. If the signal being transmitted is binary (i.e., two-state), the data is being transmitted at 2400 bits per second. However, if the signal is transmitted as 4 levels, each signal element carries two bits of information, and therefore the data is transmitted at 4800 bits per second.
BINARY A binary number is expressed in the base two. A binary value is indicated to the assembler by prefixing it with "%". For example, we can write AND.B %00010110,D0 to mask out bits 1, 2, and 4 of D0.
BINARY FILE An assembler takes a source file and produces two new files. One is an optional listing file and the other is the binary file, containing object code, that can be executed by the target processor. Some operating systems apply the extension .BIN to binary files.
BINDING When a symbolic name is attached to a memory location it is said to be bound to that location. For example, the operations
| ORG $1000 | |
| Vector | DS.B 6 |
bind the name Vector to the memory location 100016.
BIT FIELD The 68020 can operate on a group of consecutive bits, called a bit field, falling anywhere in memory (i.e., the bit field need not lie on a byte-boundary). A bit field may be 1 to 32 bits long and is specified by <ea>{offset:width}, where offset is the distance of the bit field from the most-significant bit of the effective address, and width is the size of the bit field. Consider the three consecutive bytes in locations $2000, $2001, and $2002 with the values 11001100 10101001 11011001, respectively. The 12-bit bit field represented by the address $2000{7:12} crosses two byte boundaries and is: 11001100 10101001 11011001.
BOUND An array of n elements extends from address N to address N+n-1. These two addresses are the upper and lower bounds of the array, respectively. When accessing an array you can (should?) check that the element does not lie outside these bounds.
BRANCH A branch instruction has the format Bcc Branch_target_address, and forces the processor to take one of two courses of action: either to execute the next instruction immediately following the branch instruction (i.e., branch not taken), or to execute the instruction at the branch target address (i.e., branch taken). The branch is taken or not taken depending on the outcome of the condition specified by cc (e.g. BEQ = branch on carry clear). Note that the 68000s branch instructions employ relative addressing when the branch instruction is encoded by the assembler, its operand is not the actual or absolute branch target address but the location of the branch target address relative to the current contents of the program counter.
BREAKPOINT A breakpoint is a point in a program at which the execution of the program is stopped and the contents of the processors registers displayed on the console. Breakpoints are used to debug programs. Software breakpoints are often implemented by replacing an instruction in a program with a code that forces an exception (e.g., ILLEGAL or TRAP #i). You can also use the 68000s trace facility to implement a breakpoint (i.e., generate a trace exception after each instruction and then break when a certain point is reached).
BUFFER In the context of serial and parallel input/output systems, a buffer is a storage system arranged as a first-in-first-out queue. The buffer is part of the interface device and allows data to enter and leave the chip at different rates (at least over a short period of time). For example, a serial interface may receive a burst of data and store the data in its buffer until the processor is ready to read it.
BUS CYCLE The 68000 executes three types of cycle (clock cycle, bus cycle, and instruction cycle). A clock cycle is the smallest event in which the 68000 can participate. Only hardware systems designers are interested in clock cycles. A bus cycle involves a read or write access to external memory. The 68000 requires a minimum of four clock cycles to perform a bus cycle. An instruction cycle involves the execution of an instruction and may require several bus cycles.
BUS ERROR The 68000 has a BERR* (i.e., bus error) input pin. When this pin is asserted by user-supplied hardware, the 68000 executes a bus error exception. The bus error exception is used to handle accesses to illegal memory locations or accesses to protected regions of memory.
BYTE A byte is a unit of 8 bits, and is the smallest quantity of data that can be transferred into and out of the 68000. The 68000 can also perform operations on bytes. An operation on a byte is generally indicated by appending the suffix .B to a mnemonic (e.g., ADD.B, MOVE.B). The 68000 is byte-addressed in the sense that consecutive bytes have consecutive addresses (i.e., 0,1,2,3,...).
C-BIT The C-bit is a carry bit in the condition code register. It is the least-significant bit of the CCR. The C-bit is set if an operation results in a carry-out from the most-significant bit position of the operand. The C-bit is also set by a shift out of the least-significant bit during right shift operations. The 68000 provides two instructions that branch on the value of the C-bit (i.e., BCC = branch if C = 0 and BCS = branch if C = 1). There are two other branch conditions that test the carry bit, but these also test the Z-bit.
CASE-SENSITIVE The letters of the Roman alphabet may be uppercase or lowercase. Programming languages are said to be case-sensitive if they distinguish between upper- and lowercase letters. For example, a case-sensitive language would regard the symbolic names Day_One and DAY_ONE as different. A case-insensitive language would regard these two names as identical. The 68000 assembler used in this text is case-insensitive.
CCR The condition code register records the state of status flags after an operation is carried out by the 68000. The 68000s CCR has a C-bit (carry), an N-bit (negative, i.e., the most-significant bit), a Z-bit (zero), a V-bit (overflow), and an X-bit (extend bit). Some instructions set or clear one or more of these bits, some instructions leave one of more bits unchanged, and some instructions have an indeterminate effect on one or more of these bits. You have to look up the 68000s instruction set to determine how a particular instruction affects the CCR. The order of the CCRs bits is 000XNZVC (the three most-significant bits are zeros).
COMMENT A comment field in either a low-level or a high-level language is a text string that is ignored by the assembler or compiler, respectively. The only purpose of the comment field is to permit the programmer to describe some aspect of the program (i.e., to make a comment). In 68000 assembly language, any text following the instruction or assembly directive is regarded as a comment. Any line that begins with an asterisk, *, in column one is also treated as a comment. The following example demonstrates two types of comment.
| * | This is a comment because the line starts with an "*" | |
| MOVE.B D1,D2 | The MOVE instruction gets executed - but this comment doesnt | |
COMMON INSTRUCTIONS You can write 68000 assembly language programs with very few instructions. The following list provides a subset of 68000 basic instructions.
COMPILER A compiler is a program that translates or maps a high-level language into machine code.
COPROCESSOR A coprocessor is an auxiliary processor that performs certain functions not implemented by the CPU itself. Typical coprocessors are floating point units and memory management units. You can also design coprocessors to manage graphics operations or string handling. Members of the 68000 family use line F exceptions to communicate with the coprocessor. When a coprocessor is fitted, it appears to the programmer as an extension of the CPU itself.
CPU SPACE The 68000 divides memory into three types: user space, supervisor space, and CPU space. The type of memory being accessed is indicated by a three-bit value on the 68000s function code output pins, FC2, FC1, FC0. CPU space is used by the 68000 to indicate an interrupt acknowledge cycle or a coprocessor access. That is, a CPU access is a special operation that should not be interpreted by the rest of the system as a normal memory access.
DATA REGISTER A data register is a 32-bit on-chip register used to hold information being processed by the 68000. Most of the 68000s instructions operate on the contents of a data register and the contents of a memory location (e.g., ADD D0,$1234). The 68000 has eight data registers, D0 to D7, and they all behave identically. An operation on a data register may be applied to bits 0 to 7 (.B), bits 0 to 15 (.W), or 0 to 31 (.L). An operation on a byte does not modify bits of the register not taking part in the operation. For example, CLR.B D0 sets bits 0 to 7 to zero and does not affect bits 8 to 31.
DATA TYPE All information stored in a digital computer is stored in binary form. However, it is possible to assign a type to a data element. For example, an element may be a 16-bit integer, an IEEE format floating point number, or a two-dimensional array of vectors. In a strongly typed language, a data element may take part only in operations appropriate to its type.
DEBUGGING Debugging is the process of removing bugs (i.e., errors) from a program. Debugging is normally performed by using breakpoints and single stepping through a program to locate errors.
DFC The destination function code, DFC, indicates the destination address space being currently accessed. Members of the 68000 family put out a code on function control pins, FC0 to FC2, whenever they access memory. The function code indicates the type of memory access (user/supervisor, program/data). The 68020 has a destination function code register, DFC, that permits a user-determined code to be placed on FC0 to FC2 when the privileged instruction MOVES Rn,<ea> is executed. This operation is used by the operating system (running in the supervisor mode) when it needs to access user space.
DISASSEMBLER A disassembler reads object code (i.e., binary code) and converts it into mnemonic form. That is, it performs the inverse function of an assembler. Most disassemblers are unable to provide symbolic addresses, and the disassembled code uses absolute addresses expressed in hexadecimal form.
DEQUE A deque, pronounced "deck," is a double-ended queue. Items can be added to or removed from a deque at either end.
DIRECT MEMORY ACCESS (DMA) Direct memory access is a mechanism whereby information is transferred directly between a peripheral like a disk drive and the system memory without the active intervention of the processor. DMA requires special purpose hardware and a dedicated logic element called a DMA controller, DMAC. The DMAC keeps track of the source or destination of the data in memory and controls the port through which the transfer is taking place.
DYADIC An operator is said to be dyadic if it requires two operands. The following operators are dyadic: AND, OR, EOR, addition, subtraction, multiplication, division. Operations with a single operand such as 1/x, -x, sqrt(x) are said to be monadic.
EDGE-SENSITIVE Digital systems operate with signals that have two states: electrically low or electrically high. For most of the time, digital systems are concerned only with whether a signal is in a high state or a low state. However, the input circuit of some systems can be configured to detect the change of state of a signal rather than its actual value. Such an input is called edge-sensitive. For example, you might wish a peripheral to interrupt the processor only when the voltage it is monitoring changes.
EFFECTIVE ADDRESS The effective address of an operand is a generic term that stands for all the various ways of calculating an address. We often write an effective address as <ea> to stand for all the legal addressing modes that can be used. For example, we might express the clear instruction as CLR <ea>. When we use this instruction, we might write CLR 1000 to clear the location at the effective address 1000, or CLR (12,A0) to clear the location at the address given by the contents of A0 plus 12, and so on.
EQUIVALENT INSTRUCTIONS The following operations demonstrate instruction "equivalences." Note that some operations are not entirely identical because they affect the CCR in different ways, or they handle sign-extension differently.
|
|
|
|
|
|
|
|
|
|
|
|
ERROR Programmers can make many types of error. An assembly error (or syntax error) occurs when you write an illegal instruction (e.g., CLR A2), or employ the same label twice, etc. Even if your program is syntactically correct, it may not do what you wish it to do. In this case it has a semantic error; that is, the program does not carry out the actions you intended. This type of error is normally found by debugging the program.
EXCEPTION An exception is an event that causes a change in the flow of control of a program by calling the operating system. An interrupt is an externally generated exception whose origin lies in hardware. A software exception is caused by certain events some of them are programmed and some are due to certain types of error. The 68000 responds to an exception by entering its supervisor state, pushing the program counter and status word on the stack, and jumping to the appropriate exception handler.
EXCEPTION VECTOR TABLE The 68000 maintains a table of 256 longwords from 00000016 to 0003FF16. Each longword is a pointer to an exception handler. When an exception occurs, the appropriate vector is loaded into the program counter to start exception processing. Note that the first two longwords in this table are used by a special exception the reset (the first longword is the initial value of the stack pointer, and the second is the location of the reset vector).
EXPONENT The decimal number 1.234 x 1012 has an exponent of 12. The exponent is the power or index of the base used to scale the mantissa. A 32-bit IEEE floating point number is scaled by 2E-127. The 8-bit stored exponent is said to be biased because it is 127 larger than the true exponent. For example, the actual scale factor 215 would use a stored exponent of 15 + 127 = 142 = 100011102.
FIELD When a unit of data can be subdivided, the individual subdivisions are known as fields. For example, an instruction might have an op-code field and an operand field. An IEEE floating point number has a sign field, an exponent field, and a mantissa field.
FIFO A first-in-first-out buffer, FIFO, is a form of queue in which new items join the queue at its back and oldest items leave the queue at its front. That is, the next item to leave is the oldest item in the queue. A FIFO is the opposite of a LIFO (i.e., a last-in-first-out buffer or stack).
FLOATING POINT Large and small numbers are represented in floating point format. A decimal floating point number might be represented by 1.234 x 10-3. Most computers now represent floating point numbers in the IEEE format. A 32-bit floating point value is represented by (-1)S x 1.F x 2 E-127, where S is the sign bit, F the fractional mantissa, and E the biased exponent. Members of the 68000 family cannot operate on floating point numbers directly. You must either write appropriate software or use a floating point coprocessor.
FORMAL PARAMETER When a procedure (or a macro) is written, the actual parameters it uses might not be known by the programmer. The programmer therefore employs formal parameters that are later replaced by the actual parameters used when the procedure is executed. For example, the high-level language procedure PutChar(x) may display a character called x on the display device. When the programmer calls the procedure with the statement PutChar(p), the actual value of p replaces the formal parameter x during the execution of the procedure. The concept of a formal parameter is encountered by the assembler programmer when dealing with macros. The parameters used by the programmer when writing the body of the macro are the formal parameters (i.e., \1, \2, \3 ... in the case of the 68000) that are replaced by the actual parameters when the macro is called.
FRAME POINTER A subroutine might require workspace for any temporary values it creates. By using the top of the stack as a workspace, it is possible to make the program re-entrant (i.e., it can be interrupted and re-used without corrupting the current workspace). This workspace is called a stack frame. You can use an address register to point to this frame and then access all data with respect to this register (called a frame pointer). The 680000s LINK instruction is used to create a stack frame, and an UNLK instruction to remove it.
FUNCTION CODE Whenever the 68000 accesses memory it puts out a three-bit code on function control outputs FC0, FC1, and FC2. The function code indicates whether the 68000 is accessing user memory space or supervisor memory space, and whether it is accessing program space or data space. The function code also indicates accesses to CPU space when the processor executes an interrupt acknowledge cycle or a coprocessor access. Basic 68000 systems do not make use of the function code outputs (other than to detect an interrupt acknowledge). The function code outputs are normally used in systems with memory management e.g., workstations running Unix.
GLOBAL A global variable is one that can be accessed from all parts of a program. Contrast this with a local variable that is private to a particular subroutine. The range over which a variable or a parameter is used is called its scope.
GRAMMAR The grammar of a language comprises the set of rules that allow the construction of a legal sentence in the language.
HARD RESET A hard reset occurs when the 68000s RESET* input is asserted (i.e., pulled low). A hard reset takes place when the system is switched on. It is also performed after a total system failure. Full system initialization (re-booting) is performed during a hard reset. A soft reset shares some of the characteristics of a hard reset, except that only part of the initialization process is performed.
HANDSHAKE Data may be transferred from one device to another synchronously or asynchronously. In a synchronous transfer (or open-loop transfer), data is transmitted and its reception assumed. In an asynchronous data transfer (or closed-loop transfer) a signal, called a strobe, is transmitted from the data source to the data destination. This signal indicates that a data transfer is underway. The data destination responds to the strobe by sending a reply indicating that the data has been received. This reply or acknowledgment is called a handshake.
HEXADECIMAL The base 16 is called the hexadecimal base and uses the digits 0,1,2,3,4,5,6,7,8,9,A,B,C,D,E,F to represent the decimal values 0 to 15. For example, the hexadecimal value 23416 = 2x256 + 3x16 + 4 = 564. Hexadecimal representation is used because a binary number can be converted into a hexadecimal value by dividing the number into groups of four bits (starting at the right), and then converting each binary group into the corresponding hexadecimal character. For example, 0010111000111010 is equivalent to 2E3A16.
IDENTIFIER An identifier is a name given to a variable or a label by the programmer. A legal 68000 assembly language identifier must begin with an alphabetic character. Only the first eight alphanumeric characters of the identifier are recognized by the assembler. For example, both DateOfMonth and DateOfMo are regarded by the 68000 assembler as the same identifier.
IEEE FORMAT See floating point.
ILLEGAL INSTRUCTION The 68000 uses 16-bit operation codes. Theoretically, there are 65,536 possible op-codes. Not all these possible op-codes are assigned to actual 68000 instructions. If the 68000 reads a 16-bit op-code that does not correspond to a legal op-code, the 68000 generates an illegal op-code exception. The 68000 has a special instruction, ILLEGAL, that can be used to force an illegal instruction exception.
IMMEDIATE An immediate operand is one that forms part of an instruction and is indicated by the prefix #. For example, the immediate operand 5 in the instruction MOVE.W #5,D0 is part of the instruction. When the instruction is executed, the operand 5 is immediately available, since the CPU does not have to read memory again to obtain it. Immediate addressing is also referred to as literal addressing, because the operand is a literal or a constant.
INDIRECT ADDRESSING In indirect addressing, the address of the required operand is not provided directly by the instruction. Instead, the instruction tells the processor where to find the address. That is, indirect addressing gives the address of the address. The 68000 uses address register indirect addressing in which the address of an operand is in an address register. This addressing mode is specified by enclosing the address register in round brackets. For example, MOVE (A3),D2 means move the contents of the memory location whose address is in address register A3 into D2. The computer must then use A3 to locate the actual operand that is to take part in the instruction. The 68000 does not support memory indirect addressing but the 68020 does.
INDIVISIBLE An operation is said to be indivisible if it must be completed without any form of interruption. A 68000 instruction is indivisible in the sense that it cannot be interrupted by either a hardware or a software exception until after it has been executed. A segment of code can be made indivisible by turning off the 68000s interrupt handling mechanism until it has been executed (although level-7 interrupts cannot be turned off). The 68000 has a special indivisible test and set, TAS, instruction that reads an operand, tests it, and sets it in one complete indivisible action. This instruction is used to reliably synchronize processors in a multiprocessor system.
INTERLOCKED A sequence of actions is said to be interlocked if each action can continue only when the previous action has been completed. For example, a data transfer may employ an interlocked handshake. That is, the transmitter first sends a data available strobe to the receiver. The receiver detects this strobe and responds by sending its own data acknowledge strobe back to the transmitter. The transmitter then negates its data available strobe when it detects the receivers data acknowledge strobe, and so on.
INTERRUPT An interrupt is a request for service from an external device seeking attention. The external device requests service by asserting an interrupt request line connected to the processor. The processor may or may not deal with the interrupt depending on whether the interrupt is masked (i.e., ignored). If the interrupt is not masked, the processor deals with it by executing a piece of code called an interrupt handler. Once this handler has been executed, the processor returns to the point that it had reached immediately before the interrupt.
INTERRUPT ACKNOWLEDGE CYCLE The 68000 executes an IACK or interrupt acknowledge cycle after it accepts an interrupt request on one of the seven interrupt request lines, IRQ1* to IRQ7*, from an external device. During the IACK cycle the 68000 informs peripherals that an interrupt acknowledge is in progress and indicates the level of the interrupt request (1 to 7) by placing the number on the address bus. The device that requested the interrupt at the same level as the interrupt acknowledge places its 8-bit interrupt vector number on the data bus. The 68000 reads the interrupt vector number, multiplies it by four, and uses the result to index into a table of interrupt vectors in the 256-longword region of memory 00000016 to 0003FF16. The longword accessed in this table is the address of the interrupt handler and is loaded into the 68000s program counter.
INTERRUPT-DRIVEN I/O In interrupt-driven I/O, the processor normally carries out a background task until an input or output device is ready to be serviced. When the device is ready, it generates an interrupt and the processor deals with it by performing the appropriate data transfer. Interrupt-driven I/O is much more efficient than programmed I/O using polling, because the processor takes part in the data transaction only when the peripheral is ready.
INTERRUPT HANDLER An interrupt handler is a piece of code, rather like a subroutine or procedure, that deals with the cause of an interrupt. Interrupt handlers are invariably part of a computers operating system.
INTERRUPT LATENCY The period between the generation of an interrupt and the time at which the processor begins to process the interrupt.
INTERRUPT MASK When the 68000 receives an interrupt request on IRQ1* to IRQ7*, it checks the interrupt level against the three bits of its interrupt mask in the status byte of its status register. If the incoming interrupt has a level i and the interrupt mask is set to level j, the interrupt will be serviced if i > j. That is, the interrupt must be at a higher level than that reflected in the interrupt mask. When an interrupt is serviced, the value of the interrupt mask is set to the level of the current interrupt. Consequently, if an interrupt at level i is serviced, only an interrupt at level i+1 or greater can interrupt the servicing of the interrupt at level i. Note that a level-7 interrupt is a special case. A new level-7 interrupt can always interrupt the processing of an existing level-7 interrupt.
I/O STRATEGY An input/output strategy describes the way in which a system goes about performing I/O transactions. The three basic I/O strategies are programmed I/O, interrupt-driven I/O, and DMA (direct memory access).
JUMP In 68000 terminology, a jump is a change of flow of program (like an unconditional branch, an RTS, or an RTE). The jump, JMP, instruction is equivalent to a GOTO in a high-level language. An important form of JMP (or JSR) is JMP (Ai) (or JSR (Ai) ) that permits you to compute a variable destination at run time.
LABEL A label is a symbolic name that identifies a particular line in an assembly language program. In 68000 assembly language programs, a label is any valid identifier that begins in column one. A label permits a programmer to refer to a line without having to know its actual (i.e., numeric) address. It is illegal to employ the same label to identify two different lines in the same program.
LINK The 68000s LINK instruction is used to support stack frames by creating a region of work space on the top of the current stack. This instruction is widely used by compilers. The UNLK instruction undoes the work of a link instruction by collapsing the stack.
LINKED LIST A (singly) linked list is a data structure in which each element has two parts, the actual data and a pointer to the next element in the list.
LINKER An assembly language program may be written as a number of separately assembled modules. A linker combines the modules into a single program.
LIST A list is a sequence of elements that are arranged according to some algorithm. For example, a queue, a deque, and a stack are all types of list. A linked list is a list in which each element points to the next element in the list.
LISTING FILE When an assembler assembles a source file into object code (i.e., binary code), it may also produce a listing file. The listing file is the assembled source file complete with line numbers, the instruction opcodes (in hexadecimal form), plus any error messages or warnings. You use the listing file to help you to debug a program if it does not function correctly. Since the listing file contains the address of both instructions and operands, you can readily trace through the program and set breakpoints.
LITERAL A literal is an operand that is directly used by the computer, as opposed to a reference to a memory location. In an arithmetic expression like X := Y + 5, the 5 is a literal value. In 68000 assembler language a literal is indicated by prefixing it with a # symbol. ADD #5,D0 means add the literal value 5 to the contents of data register D0. The terms literal and immediate are interchangeable.
LOCAL A local variable is a variable that belongs to a subroutine. and cannot be accessed from any other part of the program. The variable is therefore private to the subroutine and is used for the subroutines working storage. A local variable can be contrasted with a global variable that can be accessed from other parts of the program. The 68000 implements the special instructions LINK and UNLK to manage a subroutines local variables.
LOCATION COUNTER The location counter is a variable maintained by an assembler. When an assembly language program is assembled, the location counter keeps track of where information is to be located in memory when the assembled program is loaded in a real computer. For example, if the location counter is currently pointing at memory location $001234, the effect of the assembler directive DS.B $100 is to change the location counter to $001334.
LOGICAL ADDRESS The address of an operand generated by the CPU is called a logical address. The logical address is mapped onto the actual address (physical address) of an operand by a memory management unit. In systems without an MMU, there is no difference between a logical and a physical address.
LOGICAL OPERATION A logical operation operates on the bits of one or two operands but does not produce carry bits from one position (i.e., column) into another. That is, an operation involving bits ai and bi does not affect the i+1th bit position. The 68000s logical operations are AND, OR, NOT, EOR, and logical shifts left and right.
LONGWORD A longword, in the context of the 68000 family, is a 32-bit unit of data. The 68000s address and data registers can all hold a longword. The 68000 is able to perform operations on longwords (that is, it is a 32-bit computer).
MACHINE LANGUAGE The binary language that is actually executed by a computer. The human-readable form of this language is called assembly language.
MACRO A macro is a symbolic name given to a sequence of instructions. If you are going to use a certain sequence of instructions frequently, you can create a named macro that is equivalent to these instructions. Whenever you use this macro in the assembly language program, the assembler expands it into the instructions it represents.
MANTISSA A floating point number represents a number in the form of mantissa x 2exponent. In the IEEE floating point format, the mantissa lies in the range 1.000...0 to 1.111...1. Note that the IEEE mantissa is stored in memory in a fractional form (i.e., the leading 1 is not stored).
MASK In computer terms the word mask means to hide or to cover one or more bits of a word. The logical AND is frequently used as a mask operator. For example, if we have 8 bits in D0 and are only interested in bits 4, 5, and 6, we can mask all other bits to zero by AND.B #%01110000,D0.
MEMORY MANAGEMENT UNIT A memory management unit, MMU, is used in sophisticated computer systems to map a logical address generated by the CPU onto the address of data in the physical (i.e., real) memory system. MMUs support virtual memory systems and also free the programmer from worrying about where to locate programs and data. The operating system uses the MMU to map programs onto whatever physical (i.e., actual) memory is currently available.
MEMORY MAP The 68000's memory can be represented as a linear list of memory elements from $00 0000 to $FF FFFF. This arrangement is called a memory map. It is used by programmers to show how data structures are arranged, and by hardware designers to show how the various memory elements are arranged. Throughout this text the memory map is drawn conventionally with low addresses at the top of the diagram and high addresses at the bottom. This splendidly confusing convention means that up on the page means down (i.e., toward lower addresses) in memory.
MEMORY-MAPPED Since the 68000 has no special hardware or software devoted to performing I/O operations, all I/O must be performed via the 68000s existing memory interface. I/O ports are arranged by the hardware systems designer so that they look like normal memory locations. These ports are said to be memory-mapped because they appear as part of the systems memory space.
METALANGUAGE A metalanguage is one used to describe another language. Most of this text uses English as a metalanguage to describe the 68000 assembly language. However, since English sometimes lacks precision, special-purpose metalanguages have been designed. A popular metalanguage is BNF (Backus-Naur Form).
MISALIGNED OPERAND The 68000 supports byte, word, and longword operands. A byte may be stored at any location. A word or a longword must be located at an even address. If you attempt to read a word or longword operand at an odd address, the 68000 generates an address error exception. The 68020 and the 68030 can access misaligned operands.
MNEMONIC The symbolic representation of an assembly level instruction. For example, the mnemonic for the operation that adds two values is ADD. The mnemonic for the operation that forces a change of program flow if the overflow bit in the CCR is set is BVS Branch on oVerflow bit Set.
MODEM A modem is a MODulator DEModulator and is used to transmit digital signals over the public switched telephone network, PSTN.
MONADIC An operator is said to be monadic if it operates on a single value. The following operators are monadic: logical NOT, negate, sign-extension, reciprocal, square root.
N-BIT The N-bit is the negative bit of the CCR and is set if the most-significant bit of the result is 1 (i.e., the operand is negative when interpreted as a twos complement number). Programmers can use the most-significant bit of an operand as a general flag bit. If you set this bit (or clear it), you can later employ a branch on negative (or branch on positive) instruction to test the state of the flag.
NONMASKABLE INTERRUPT An interrupt that cannot be turned off or otherwise disabled is called nonmaskable. Nonmaskable interrupts (IRQ7*, in the case of the 68000) are used for interrupts that must never be missed.
OBJECT CODE The machine code output of an assembler or a compiler is called object code. An object file holds this code. Object code can be executed.
OFFSET In 68000 terminology an offset is a literal value that forms part of an instruction used in conjunction with address register indirect addressing. For example, the operation CLR.B (12,A0) clears the memory location that is offset by 12 bytes from the address pointed at by address register A0.
OP-CODE The op-code or operation code is the binary pattern that represents an instruction.
OPERAND The operand of an instruction is the data used by that instruction. For example, the instruction MOVE.B #5,(A0)+ has two operands. The source operand is the literal value 5, and the destination operand is the memory location pointed at by address register A0.
OVERFLOW Arithmetic overflow occurs when a twos complement number goes outside its permitted range. This results in the V-bit of the CCR being set. Note that exponent overflow occurs in floating point arithmetic when the exponent becomes too large or small to represent. The 68000s division instruction can give rise to overflow if the result is too large to fit in the operand.
PARALLEL In the context of input/output operations, a parallel data transfer moves two or more bits between a peripheral and the CPU (or its memory) in a single operation. Most parallel interface devices move 8 or 16 bits at a time.
PARITY A parity bit is an additional bit appended to a word to make the total number of 1s in the word including the parity bit even (even parity) or odd (odd parity). The purpose of the parity bit is to detect errors (usually in storage or transmission). If one or an odd number of bits in a word is corrupted and the parity bit is re-computed, it will differ from the actual parity bit.
PATCH A patch is a modification to object code (i.e., machine code) made by hand. For example, a program might use two NOPs (no operation) op-codes that can later be replaced by a patch to fix an error. The NOPs might later be replaced by a BSR FIX instruction to perform the necessary operation. The use of a patch to modify a program is as near to a criminal offense as you can get. Only other programmers employ a patch to correct an error. A program should be modified by rewriting its source code and then reassembling it.
PERIPHERAL The term peripheral is somewhat ambiguous. It is used to describe external devices like disk drives, keyboards, mouses (mice?), and displays. It is also used to describe the hardware that interfaces these devices to the processor. For example, both the floppy disk controller chip that interfaces a floppy disk drive to a processor and the floppy disk drive itself are often called peripherals. Fortunately, the context of the word peripheral usually indicates its actual meaning.
PHYSICAL ADDRESS The address of an operand generated by the CPU is called a logical address. The logical address is mapped onto the actual, or physical, address of an operand by a memory management unit. In systems without an MMU, there is no difference between a logical and a physical address.
POINTER A pointer is a variable that provides the location of an operand. The 68000 uses its address registers as pointers because they point to operands in memory. Pointers are necessary to implement data structures.
POLLING LOOP A polling loop is a programmed loop that continually asks a question until it gets an answer. For example, a polling loop in a program performing programmed I/O continually tests whether a device is ready or not. Such a loop usually takes the form:
| REPEAT | ||
| Test device status | ||
| UNTIL device is ready | ||
However, it is also possible to have polling loops in other situations. For example, suppose that several peripherals share the same level of interrupt and the processor cannot directly identify the device that generated the interrupt. A polling loop can be used to ask each of the devices in turn:
| i = 0 | ||
| REPEAT | ||
| i := i + 1 | ||
| Ask device i if it interrupted | ||
| UNTIL an interrupter is found | ||
PORT A port is a device that interfaces the processor to external systems. Since the 68000 uses memory-mapped I/O, a port usually refers to a location in memory used to write data to an external peripheral or to read data from the peripheral.
POSITION INDEPENDENT CODE If you write a program or a subroutine in such a way that all the addresses of operands are expressed by means of relative addressing, the code is said to be position independent. That is, all addresses in the instructions are independent of the actual location of the code in memory. Position independent code is written by using relative branches and program counter relative addressing, rather than jump instructions and absolute addresses. Position independent code, PIC, is normally regarded as a good thing.
PRIORITIZED INTERRUPTS The 68000 supports seven levels of interrupt request, IRQ1* to IRQ7*. These interrupt requests are said to be prioritized because a higher-numbered interrupt will always be accepted in preference to a lower-numbered interrupt (if they occur at the same time).
PRIVILEGED INSTRUCTION A privileged instruction is an instruction that cannot be executed when the 68000 is running in the user mode. Attempting to execute a privileged instruction causes an exception. Privileged instructions are those that operate on the 68000s supervisor state registers, plus STOP and RESET.
PROGRAM COUNTER The program counter contains the address of the next instruction to be executed. The program counter is incremented after each instruction is executed. It is altered by jump and branch instructions, RTS and RTE instructions, and by all exception calls.
PROCEDURE See subroutine.
PSEUDOCODE Pseudocode provides a semi-formal method of expressing algorithms before they are translated into assembly language. A typical pseudocode borrows the constructs of a high-level language like Pascal, without importing all its complexities. Some of the pseudocode conventions used in this text are as follows.
| IF L THEN S |
| IF L THEN S1 ELSE S2 |
|
|
|
|
Pseudocode Notation
QUEUE A type of two-ended list, or data structure, whose elements are added at one end and removed from the other. It is sometimes called a FIFO (first-in-first-out) queue.
RECURSION Recursion means defining something in terms of itself. For example, the value of 2n can be defined recursively by stating that 2n = 2 x 2n-1 (you also need to state that 20 = 1 to terminate the recursive procedure). A subroutine can be written in such a way that it can be called recursively. That is, it can call itself. Recursive procedures make use of the stack to store their return addresses and any working data.
RE-ENTRANT Code is said to be re-entrant if it can be interrupted and called by another procedure.
RELATIVE ADDRESS An absolute address provides the actual location of an operand. A relative address (e.g., MOVE.B (Data,PC),D3) is an address that is specified with respect to the program counter or to an address register. Relative addressing is used to create position independent code in which the program can be relocated in memory without having to recalculate the addresses of operands.
RELOCATABLE CODE Code is relocatable if it can be moved from one location in memory to another without modifying the address of operands. In order to write relocatable code, you have to use program counter relative addressing for both branch instructions and operands. The following code is relocatable.
| LEA (Table,PC),A0 | A0 points to the data source | ||
| LEA (Dest,PC),A1 | A1 points to the data destination | ||
| MOVE.W #5,D1 | Six bytes to move | ||
| Next | MOVE.B (A0)+,D2 | FOR i = 0 to 5 | |
| ADD.B #2,D2 | Get element from TABLE and add 2 | ||
| MOVE.B D2,(A1)+ | Store the element in DEST | ||
| DBRA D1,Next | END_FOR | ||
RETURN ADDRESS The address of the next instruction after a subroutine call instruction is called the return address, because this is the address of the instruction that will be executed after the subroutine has been executed. This address is saved on the stack (automatically) when the subroutine is called, and is removed from the stack at the end of a subroutine by an RTS instruction.
RS232C This is a standard that specifies the interface between DCE (data communications equipment) and DTE (data terminal equipment). It is frequently used to connect a computer's serial port to a modem.
RUN TIME Run time describes the period during which a program is being executed (i.e., when it is running). A run time operation is performed each time it is encountered during the execution of the program. For example, the source address in the assembly language instruction MOVE.B (12,A6,D3.W),D4 is evaluated at run time. The source address (12,A6,D3.W) is evaluated by adding 12 to the contents of A6 plus the low-order word of D3. The actual result obtained depends on the contents of A6 and D3 at the time the calculation is performed and can change as the program is executed. Contrast run time with assemble time. The source address in the operation MOVE.B 3*TEMP+6,D0 is evaluated once during the assembly process. For example, if the symbolic name TEMP has the value 20, the assembler treats the instruction as MOVE.B 66,D0.
SCOPE A symbolic name may be bound to a variable or a constant. The region over which the name is visible is called its scope. For example, a name may be declared in a subroutine and its scope may extend only to the subroutine (i.e., it is a local name). The scope of a name may be global and be visible to all subroutines.
SELF-MODIFYING CODE Programs that actually change or modify their own code at run-time are said to be self-modifying. For example,
| MODLINE | ADD.W #TEMP,D3 |
| MOVE.W D6,MODLINE+2 |
is an example of self-modifying code. The first instruction appears to add a literal to D3. However, the second instruction writes data to the constant field of the first instruction (it modifies the instruction itself). Programmers have done things like this to save storage space. Although occasionally employed to overcome the restrictions of first-generation microprocessors, self-modifying code should never ever be used today it is difficult to read and nearly impossible to debug.
SEPARATE ASSEMBLY When writing a large program, it is possible to divide the task into several modules. These modules can be assembled independently of each other (i.e., separate assembly). In order to do this, the assembler has to be told which variables are defined outside a module and which variables have to be exported from the module. The modules are then put together by a linker.
SERIAL In the context of input/output operations, a serial data transfer moves data between a microprocessor system and a peripheral a bit at a time. Serial data transfer is associated with communications links.
SERIALLY REUSABLE A serially reusable procedure may be called by a program and then called again at any time after it has been executed. That is, it must be executed to completion without interruption. Any procedure is serially reusable as long as its code is not modified when it is run. A serially reusable procedure is to be contrasted with reusable procedures and re-entrant procedures.
SFC The source function code, SFC, defines the type of address space from which the 68000 is currently accessing an operand user program, user data, supervisor program, or supervisor data. The 68020 puts out the source function code on its function control output pins, FC0 to FC2, whenever it reads from memory. The 68020 has a source function code register, SFC, that permits a user-determined code to be placed on FC0 to FC2 when the privileged instruction MOVES <ea>,Rn is executed. This function code override the 68020's normal function code. For example, you can load the SFC with a suitable source function code using the MOVEC D0,SFC instruction and then access an operand using MOVES (A0),D2.
SHIFT A shift operation moves the bits of a memory location or a data register one or more places left or right. There are three types of shift (logical, arithmetic, and rotate). In a logical shift, a zero enters the bit at the end that is vacated. In an arithmetic operation, the sign bit is replicated during a shift right. In a rotate operation, the bit that falls off one end is copied to the vacated bit.
SIGN-EXTENSION The 68000 represents negative numbers by their twos complement. One of the properties of a twos complement number is that a number in m bits can be represented in m+1 bits by replicating the most-significant bit. For example, if the two 4-bit twos complement numbers 0011 and 1011 are converted to a 6-bit format, they become 000011 and 111011, respectively. The process of increasing the number of bits while preserving the correct twos complement value is called sign-extension. In the context of the 68000, sign-extension means extending an 8-bit value to 16 bits or a 16-bit value to 32 bits. Sign-extension is important because the 68000 treats addresses as signed values.
SOURCE CODE The program as written by the programmer is in source code. If the source code is written in assembly language, an assembler translates it into machine code. If the source code is in high-level language, a compiler translates it into machine code.
S-RECORD Binary (object) data is often stored or transmitted in the form of hexadecimal code in the range $00 to $FF. One such code is represented by S-records. There are several types of S-record (S0, S3, S8). An S3 record consists of the header S3, a four-character address, a byte count, up to 16 bytes of data, and a check sum.
STATUS REGISTER The 68000 has a 16-bit status register, subdivided into an 8-bit system byte and an 8-bit condition code register. The system byte includes the S-bit (user/supervisor mode), the T-bit (trace on/off), and the interrupt mask level (0 to 7). Programs running in the user mode can't modify the status register.
STACK A stack is a data structure in the form of a first-in-last-out queue. A stack is so-called because it behaves like a stack of papers on a desk. Items are added to the top of the stack and bury those below. When items are removed from the top of the stack, they are removed in the reverse order to which they were entered. For example, the last sheet of paper added to the stack is the first sheet removed from it. Data stacks are used to implement a subroutine return mechanism. The 68000 can support up to eight stacks simultaneously using A0 to A7 as a stack pointers. Although a true stack can be accessed only at one end (its top), you can access any element in a real stack. For example, the word below the top of the stack pointed at by A7 can be accessed by: MOVE.W (2,A7),D0.
STACK POINTER The 68000 implements a stack in external memory. The top item on the stack is pointed at by the stack pointer, which may be any one of address registers A0 to A7. However, address register A7 is always used by the 68000 to point at the stack used to store subroutine return addresses. Since the 68000s stack pointer points at the item on top of the stack, it must be pre-decremented to put a new item on the stack, and post-incremented to remove one. For example, MOVE.W (A7)+,D0 pulls a word off the stack, and MOVE.W D0,-(A7) pushes a word on the stack.
STRONG TYPING A language is said to be strongly typed when the operations that can be performed on data are strictly governed by their type. For example, floating point operations might not be permitted on numbers of type integer. Strong typing helps to prevent the programmer performing inappropriate or illegal operations on data. Assembly languages are not strongly typed.
SUBROUTINE A unit of code (or a fragment of a program) that can be called from a point in a program and executed, and a return made to the instruction after the calling point. You call a subroutine to perform some task or function that is used frequently in the program.
SUPERVISOR STATE The 68000 operates in its supervisor state when the S-bit is 1, and in its user state when S = 0. User programs run in the user state and the operating system runs in the supervisor state. The supervisor state has its own stack pointer, A7 (or SSP). All exception and interrupt handling takes place in the supervisor state.
SYMBOL TABLE An assembler uses a source file to produce a listing file and a binary file. The listing file may contain an optional symbol table giving the address of each symbol (i.e., symbolic name) in the program. The symbol table is helpful in debugging an assembly language program (in particular, large programs). Most assemblers provide an option that suppresses the listing of the symbol table. The 68000 assembler can be forced to produce a cross-referenced symbol table by including the assembler directive OPT CRE.
SYMBOLIC NAME A symbolic name is the name given to a variable, a constant, or a line of a program by the programmer.
SYNTAX The set of rules that govern what constitutes a legal program is the syntax of a language. If a statement in a program breaks one of these rules, it is said to have a syntax error. Syntax errors are discovered by the assembler before the program can be run, since a program with syntax errors cannot be translated into machine code. Note that a program can be syntactically correct and yet not function correctly. The meaning of a program is called its semantics.
SYSTEMS PROGRAMMER For the purpose of this text we define the systems programmer as someone who writes the operating system (including the exception processing routines). Systems programmer is to be contrasted with applications programmer (i.e., someone who writes applications programs running under the control of an operating system). This distinction is important in 68000-based systems because the operating system runs in the supervisor mode, and applications programs run in the user mode.
TRAP In the context of a 68000, a trap is a call to the exception handling system. 16 trap instructions TRAP #0 to TRAP #15 are provided. Systems designers may employ the trap in any way they wish (e.g., for device-independent I/O).
TWOS COMPLEMENT A method of representing a negative number is by means of its twos complement. In n-bit arithmetic, a number -N is represented by 2n - N. You can also form the twos complement of N by inverting all the bits of N and adding 1. When using twos complement arithmetic, the most-significant bit of a number is a sign bit (0 = positive and 1 = negative). If two positive numbers are added and the resulting sign bit is 1, arithmetic overflow has occurred and the result is out of range. Similarly, if two negative numbers are added and the resulting sign bit is 0, arithmetic overflow has occurred. Addition and subtraction operations are the same for signed and unsigned arithmetic. However, you have to use the appropriate multiplication or division instructions for signed and unsigned arithmetic.
TWO-PASS ASSEMBLER Many assemblers operate in a two-pass (or two-phase) mode. During the first pass, the source code is read and mnemonics and addressing modes checked against all legal combinations. Symbolic names (variables and labels) are stored in an internal table. On the second pass, the op-codes and symbols are translated into binary form. A two-pass assembler is needed to resolve forward references that cannot be translated on the first pass.
USER STATE The 68000 operates in its supervisor state when the S-bit in the status register is 1, and in its user state when S = 0. In general, user programs run in the user state and the operating system runs in the supervisor state. The user state has its own stack pointer, A7 (or USP). Instructions that modify the state of the 68000s status byte cannot be executed in the user state.
V-BIT The V-bit or overflow bit of the 68000s condition code register is set if the result of an operation leads to arithmetic overflow. For example, if the most-significant bits of the two source operands taking part in an addition are both 0 and the most-significant bit of the result is 1, the V-bit is set to indicate arithmetic overflow. Similarly, the V-bit is set if the two most-significant bits are 1 and the most-significant bit of the result is 0.
VBR The 68020 and later processors have a vector base register, VBR, that can be used to relocate the processors exception vector table anywhere in memory. When the 68020 is reset, the VBR is cleared and the exception vector table is located in the address range $000000 to $0003FF. If the VBR is loaded with the value N, the exception vector table is relocated to the address range N to N+$3FF. The VBR is loaded in the supervisor state by means of the privileged instruction MOVEC Ri,VBR.
VECTORED-INTERRUPT When an external device interrupts the 68000, the CPU executes an IACK (interrupt acknowledge) cycle. During the IACK cycle, the interrupting device supplies a vector number to the 68000 which is used to identify the appropriate interrupt handling routine. The 8-bit vector number is multiplied by four and used to index into the exception vector table. The 68000 is said to have a vectored-interrupt mechanism because the interrupting device identifies itself to the processor.
VOLATILE PORTION When a task (i.e., program) is running, its state is described by the program counter, status register, and address and data registers. This information is said to comprise a tasks volatile portion or context.
WEIGHTING In the positional notation, the value of each digit depends on its weighting. Consider the decimal number 276. The weighting of the 6 is one, the weighting of the 7 is ten, and the weighting of the 2 is one hundred. The weightings used in this text are 10 (decimal), 2 (binary), and 16 (hexadecimal). These weightings are sometimes referred to as natural weightings because they define the positional notation system employed in conventional arithmetic. However, you can define other weightings. For example, if a 3-digit number has a weighting of 6, 3, 5, the number 123 would be equal to 1x6 + 2x3 + 3x5 = 2710.
WORD A word is the basic unit of data processed by a computer. 68000 texts use the word to refer to a 16-bit value, which is the width of the 68000s data bus.
X-BIT The X-bit, or extend bit, of the condition code register is, essentially, the same as the C-bit (carry bit). Some operations that generate a carry bit also set the X-bit to the same value as the carry bit. Many operations that clear the carry bit do not affect the X-bit. Unlike other bits in the CCR, the X-bit is not used to determine the outcome of a conditional branch. The X-bit is used in chain arithmetic with the ADDX, SUBX, NEGX, ABCD, and SBCD instructions. Note that the X-bit is used as an extension bit in ROXL and ROXR instructions. That is, the X-bit is considered to be part of the operand and is shifted into one end of the operand, while the bit moved out of the other is shifted into the X-bit.
Z-BIT The Z-bit is the zero bit in the 68000's condition code register. The Z-bit is set to 1 if an operation yields a zero result, and cleared to 0 if the result is nonzero.