Tuesday, August 21, 2007

Exer1 Pre Finals

* Memory Allocation

In computer science, dynamic memory allocation is the allocation of memory storage for use in a computer program during the runtime of that program. It is a way of distributing ownership of limited memory resources among many pieces of data and code. Importantly, the amount of memory allocated is determined by the program at the time of allocation and need not be known in advance. A dynamic allocation exists until it is explicitly released, either by the programmer or by a garbage collector; this is notably different from automatic and static memory allocation, which require advance knowledge of the required amount of memory and have a fixed duration. It is said that an object so allocated has dynamic lifetime.

- Memory Segmentation

Is one of the most common ways to achieve memory protection; another common one is paging. Segmentation means that a part or parts of the memory will be sealed off from the currently running process, through the use of hardware registers. If the data that is about to be read or written to is outside the permitted address space of that process, a segmentation fault will result.
This usage should not be confused with that of the memory segments used by early x86 processor architectures.
For details of x86's implementation of segmentation in both 16-bit and 32-bit mode, please see the article on memory segments.
Segmentation is a memory-management scheme that supports this user view of memory. A logical address space is actually a collection of segments. Each segment has a name and a length. The address specifies both the segment name and the offset within the segment. The user therefore specifies each address by 2 parameters: a segment name and an offset.

- Input/Output Ports

Port located on the outside of a computer that allows for an input or output device to be connected to it.


* Interrupt Vectors

Is the memory address of an interrupt handler, or an index into an array called an interrupt vector table or dispatch table. Interrupt vector tables contain the memory addresses of interrupt handlers. When an interrupt is generated, the processor saves its execution state via a context switch, and begins execution of the interrupt handler at the interrupt vector.

- BIOS

(pronounced [ˈbaɪoʊs]), in computing, stands for Basic Input/Output System.
The term is incorrectly known as Binary Input/Output System, Basic Integrated Operating System and occasionally Built In Operating System for example in Neal Stephenson's novel Snow Crash.
BIOS refers to the firmware code run by an IBM compatible PC when first powered on. The primary function of the BIOS is to prepare the machine so other software programs stored on various media (such as hard drives, floppies, and CDs) can load, execute, and assume control of the PC. This process is known as booting up.
BIOS can also be said to be a coded program embedded on a chip that recognizes and controls various devices that make up the PC. The term BIOS is specific to personal computer vendors. Among other classes of computers, the generic terms boot monitor, boot loader or boot ROM are commonly used. Boot is short for bootstrapping.
The term first appeared in the CP/M operating system, describing the part of CP/M loaded during boot time that interfaced directly with the hardware (CP/M machines usually had a simple boot loader in ROM, and nothing else). Most versions of DOS have a file called "IBMBIO.COM" or "IO.SYS" that is analogous to the CP/M disk BIOS.

- DOS

(short for Microsoft Disk Operating System) is an operating system commercialized by Microsoft. It was the most commonly used member of the DOS family of operating systems and was the dominant operating system for the PC compatible platform during the 1980s. It has gradually been replaced on consumer desktop computers by various generations of the Windows operating system.
MS-DOS was originally released in 1981 and had eight major versions released before Microsoft stopped development in 2000. It was the key product in Microsoft's growth from a programming languages company to a diverse software development firm, providing the company with essential revenue and marketing resources.

* Instruction Sets

Is (a list of) all instructions, and all their variations, that a processor can execute.
Instructions include:
arithmetic such as add and subtract
logic instructions such as and, or, and not
data instructions such as move, input, output, load, and store
control flow instructions such as goto, if ... goto, call, and return.
An instruction set, or instruction set architecture (ISA), is the part of the computer architecture related to programming, including the native data types, instructions, registers, addressing modes, memory architecture, interrupt and exception handling, and external I/O. An ISA includes a specification of the set of opcodes (machine language), the native commands implemented by a particular CPU design.
This concept can be extended to unique ISAs like TIMI (Technology-Independent Machine Interface) present in the IBM System/38 and IBM AS/400. TIMI is an ISA that is implemented as low-level software and functionally resembles what is now referred to as a virtual machine.

- Data Transfer Instruction
When stored memory the bytes, words, and doublewords in the packed data types are stored in consecutive addresses, with the least significant byte, word, or doubleword being stored in the lowest address and the more significant bytes, words, or doubleword being stored at consecutively higher addresses. The ordering of bytes, words, or doublewords in memory is always little endian: the bytes with the lower addresses are less significant than the bytes with the higher addresses.

- Branch Instructions

A branch (or jump on some computer architectures, such as the PDP-8 and Intel x86) is a point in a computer program where the flow of control is altered. The term branch is usually used when referring to a program written in machine code or assembly language; in a high-level programming language, branches usually take the form of conditional statements, subroutine calls or GOTO statements. An instruction that causes a branch, a branch instruction, can be taken or not taken: if a branch is not taken, the flow of control is unchanged and the next instruction to be executed is the instruction immediately following the current instruction in memory; if taken, the next instruction to be executed is an instruction at some other place in memory. There are two usual forms of branch instruction: a conditional branch that can be either taken or not taken, depending on a condition such as a CPU flag, and an unconditional branch which is always taken.

a.) Conditional Jumps

This ternary operator can also be used (though less commonly) in conditional jump statements, as in Linoleum:? logical comparison -> code label;
Although the usage and format are different, it's still a ternary operator (used as a conditional expression) because the three arguments come from the code label and from the two arguments in the logical comparison. (The -> operator, which signifies an unconditional jump, takes the place of the : operator.)

b.) Unconditional Jumps

Another way to break a loop is the goto statement. For example, we can modify the example above as follows: do :: count = count + 1 :: count = count - 1 :: (count == 0) -> goto done od done: skip;
The goto in this example jumps to a label named done. A label can only appear before a statement. If we might want to jump at the end of the program, for example, a dummy statement skip is useful: it is a place holder that is always executable and has no effect.

No comments: