for more help leave a text on 0333-8586638
What is a
Stack? 5
Stack is a data structure
that behaves in a first in last out manner. It can contain many elements and
there is only one way in and out of the container. When an element is inserted
it sits on top of all other elements and when an element is removed the one
sitting at top of all others is removed first. To visualize the structure
consider a test tube and put some balls in it. The second ball will come above
the first and the third will come above the second. When a ball is taken out
only the one at the top can be removed. The operation of placing an element on
top of the stack is called pushing the element and the operation of removing an
element from the top of the stack is called popping the element. The last thing
pushed is popped out first; the last in first out behavior.
What is Virtual Machine?
Answer
Virtual machine is a term
used by Sun Microsystems, developers of the Java programming language and
runtime environment, to describe software that acts as an interface between
compiler Java binary code and the microprocessor (or "hardware
platform") that actually performs the program's instructions. Once a Java
virtual machine has been provided for a platform, any Java program (which,
after compilation, is called bytecode) can run on that platform. Java was
designed to allow application programs to be built that could be run on any
platform without having to be rewritten or recompiled by the programmer for
each separate platform. Java's virtual machine makes this possible.
The Java virtual machine specification defines an abstract rather than a real "machine" (or processor) and specifies an instruction set, a set of registers, a stack, a "garbage heap," and a method area. The real implementation of this abstract or logically defined processor can be in other code that is recognized by the real processor or be built into the microchip processor itself.
The output of "compiling" a Java source program (a set of Java language statements) is called bytecode. A Java virtual machine can either interpret the bytecode one instruction at a time (mapping it to a real microprocessor instruction) or the bytecode can be compiled further for the real microprocessor using what is called a just-in-time compiler.
The Java virtual machine specification defines an abstract rather than a real "machine" (or processor) and specifies an instruction set, a set of registers, a stack, a "garbage heap," and a method area. The real implementation of this abstract or logically defined processor can be in other code that is recognized by the real processor or be built into the microchip processor itself.
The output of "compiling" a Java source program (a set of Java language statements) is called bytecode. A Java virtual machine can either interpret the bytecode one instruction at a time (mapping it to a real microprocessor instruction) or the bytecode can be compiled further for the real microprocessor using what is called a just-in-time compiler.
What's the
difference between .COM and .EXE formats?
|
To oversimplify: a .COM file is
a direct image of how the program will look in main memory, and a .EXE file
will undergo some further relocation when it is run (and so it begins with a
relocation header). A .COM file is limited to 64K for all segments combined,
but a .EXE file can have as many segments as your linker will handle and be
as large as RAM can take. The actual file extension doesn't matter. DOS knows
that a file being loaded is in .EXE format if its first two bytes are MZ or
ZM; otherwise it is assumed to be in .COM format. Actually they must be less
than 0xFF00 bytes long, since the PSP, which isn't included in the COM file
but is within those 64K, is 256 bytes long. Then CAN use many segments, but
they don't have to. In particular, any .COM file can be converted to an .EXE
file by adding an appropriate header to it. There are some other differences
between a .COM file and a single segment .EXE file (both of which must be
smaller than 64K).The entry point of the .COM file is _always_ 0x100, while
the entry point of the .EXE file can be at any address. The stack size of the
.COM file is the remainder of those 64K which isn't used by the code image,
while the stack size if the single segment .EXE file can be set at any size
as long as it fits within those 64K.Thus the stack can be smaller in the .EXE
file.
|
Define the following terms:
1.
Base + Index + Offset Addressing
The values
of the base register, the index register, and the constant offset are all added
together to get the effective address. For example “mov [bx+si+300], ax” moves
the word contents of the AX register to the word in memory starting at offset
attained by adding BX, SI, and 300 in the current data segment. Default segment
association is again based on the base register.
2.
Base + Index Addressing
The value of the base
register and the index register are added together to get the effective
address. For example “mov [bx+si], ax” moves the word contained in the AX
register to offset attained by adding BX and SI in the current data segment.
3.
Based Register Indirect + Offset Addressing
A base register is used
with a constant offset in this addressing mode. The value contained in the base
register is added with the constant offset to get the effective address. For
example “mov [bx+300], ax” stores the word contained in AX at the offset
attained by adding 300 to BX in the current data segment.
4.
Indexed Register Indirect + Offset Addressing
An index register is
used with a constant offset in this addressing mode. The value contained in the
index register is added with the constant offset to get the effective address.
For example “mov [si+300], ax” moves the word contained in AX to the offset
attained by adding 300 to SI in the current data segment
5.
Indexed Register Indirect Addressing
An index register is
used in brackets and the actual address accessed depends on the value contained
in that register. For example “mov [si], ax” moves the contents of the AX
register to the word starting at address contained in SI in the current data
segment.
How
we calculate Physical Address?
Answer
for
the whole megabyte we need 20 bits while CS and IP are both 16bit registers. We
need a mechanism to make a 20bit number out of the two 16bit numbers. Consider
that the segment value is stored as a 20 bit number with the lower four bits
zero and the offset value is stored as another 20 bit number with the upper
four bits zeroed. The two are added to produce a 20bit absolute address. A
carry if generated is dropped without being stored anywhere and the phenomenon
is called address wraparound. The process is explained with the help of the
following diagram.
Therefore
memory is determined by a segment-offset pair and not alone by any one register
which will be an ambiguous reference. Every offset register is assigned a
default segment register to resolve such ambiguity. For example the program we
wrote when loaded into memory had a value of 0100 in IP register and some value
say 1DDD in the CS register. Making both 20 bit numbers, the segment base is
1DDD0 and the offset is 00100 and adding them we get the physical memory address
of 1DED0 where the opcode B80500 is placed.
Interrupts
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.
Mnemonic
A word, abbreviation, or acronym
that replaces something too complex to remember or type easily. For example,
ADC is the mnemonic for the 8086’s add-with-carry instruction. The assembler
converts it into machine (binary) code, so it is not necessary to remember or
calculate the binary form.
Segmented
memory model :
The segmented memory model allows
multiple functional windows into the main memory, a code window, a data window
etc. The processor sees code from the code window and data from the data
window. The size of one window is restricted to 64K. However the maximum memory
iAPX88 can access is 1MB which can be accessed with 20 bits.
What is
Computer Architecture
Computer Architecture is the
science and art of selecting and interconnecting hardware components to create
computers that meet functional, performance and cost goals. Computer
architecture is not about using computers to design buildings. OR The set of layers
and protocols (including formats and standards that different hardware/software
must comply with to achieve stated objectives) which define a computer system.
Computer architecture features can be available to application programs and
system programmers in several modes, including a protected mode. For example,
the system-level features of computer architecture may include: (1) memory
management, (2) protection, (3) multitasking, (4) input/output, (5) exceptions
and multiprocessing, (6) initialization, (7) co processing and multiprocessing,
(8) debugging, and (9) cache management
