Advertisement

CS401 - Computer Architecture and Assembly Language Programming FAQ's

Question:

What is Computer Architecture

Answer:

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


Question:

Explain Segment Override prefix?

Answer:

To override the association for one instruction of one of the registers BX, BP, SI or DI, we use the segment override prefix. For example “mov ax, [cs:bx]” associates BX with CS for this one instruction. The processor places a special byte before the instruction called a prefix.No prefix is needed or placed for default association. Opcode has not changed, but the prefix byte has modified the default association to association with the desired segment register for this one instruction


Question:

What is offset?

Answer:

A distance from a given paragraph boundary in memory. The offset usually is given as a number of bytes


Question:

What is Subroutine?

Answer:

A self-contained coding segment designed to do a specific task, sometimes referred to as procedure


Question:

Explain Segmented memory model?

Answer:

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.

Question:

What is Address wraparound?

Answer:

In physical address calculation a carry if generated is dropped without being stored anywhere, for example BX=0100, DS=FFF0 and the access under consideration is [bx+0x0100]. The effective address will be 0200 and the physical address will be 100100. This is a 21bit answer and cannot be sent on the address bus which is 20 bits wide. The carry is dropped and just like the segment wraparound our physical memory has wrapped around at its very top.


Question:

Explain Linear memory model?

Answer:

In linear memory model the whole memory appears like a single array of data. 8080 and 8085 could access a total memory of 64K using the 16 lines of their address bus.


Question:

What's the difference between .COM and .EXE formats?

Answer:

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.


Question:

Is MS-DOS Dead?

Answer:

No. Though Microsoft may not be actively developing MS-DOS there are still many computers that are not capable of running Microsoft Windows. The current versions of Microsoft Windows will also run most MS-DOS programs; therefore, MS-DOS is not dead, and will most- likely never die just as Commodore-64s and Amigas have not completely died.
Indeed, DOS has found a new life in embedded systems. Other parties continue to develop MS-DOS compatible operating systems.
Windows NT, 2000, and XP all have a "Command Prompt" which is similar to the orignal MS-DOS command prompt.


Question:

How can I read a character without echoing it to the screen, and without waiting for the user to press the Enter key?

Answer:

In Assembly language, execute INT 21 AH=8; AL is returned with the character from standard input (possibly redirected). If you don't want to allow redirection, or you want to capture Ctrl-C and other special keys, use INT 16 AH=10; this will return the scan code in AH and ASCII code (if possible) in AL, but AL=E0 with AH nonzero indicates that one of the gray "extended" keys was pressed. (If your BIOS doesn't support the extended keyboard, use INT 16 AH=0 not 10.)

Question:

What is NASM?

Answer:

NASM, the Netwide Assembler, is a free assembler for Intel 80x86 series of microprocessors. Not only is the assembler compatible with MS-DOS, but it will also work under Windows 95, Linux, and OS/2.


Question:

How can my program tell if it's running under Windows?

Answer:

Execute INT 2F AX=4680. If AX returns 0, you're in Windows real mode or standard mode (or under the DOS shell). Otherwise, call INT 2F AX=1600. If AL returns something other than 0 or 80, you're in Windows 386 enhanced mode.


Question:What is Term CACHE?
Answer:Cache A small fast memory holding recently accessed data, designed to speed up subsequent access to the same data. Most often applied to processor-memory access but also used for a local copy of data accessible over a network etc. When data is read from, or written to, main memory a copy is also saved in the cache, along with the associated main memory address. The cache monitors addresses of subsequent reads to see if the required data is already in the cache. If it is (a cache hit) then it is returned immediately and the main memory read is aborted (or not started). If the data is not cached (a cache miss) then it is fetched from main memory and also saved in the cache. The cache is built from faster memory chips than main memory so a cache hit takes much less time to complete than a normal memory access. The cache may be located on the same integrated circuit as the CPU, in order to further reduce the access time. In this case it is often known as {primary cache} since there may be a larger, slower secondary cache outside the CPU chip. The most important characteristic of a cache is its hit rate - the fraction of all memory accesses which are satisfied from the cache. This in turn depends on the cache design but mostly on its size relative to the main memory. The size is limited by the cost of fast memory chips. The hit rate also depends on the access pattern of the particular program being run (the sequence of addresses being read and written). Caches rely on two properties of the access patterns of most programs: temporal locality - if something is accessed once, it is likely to be accessed again soon, and spatial locality - if one memory location is accessed then nearby memory locations are also likely to be accessed. In order to exploit spatial locality, caches often operate on several words at a time, a "cache line" or "cache block". Main memory reads and writes are whole cache lines. When the processor wants to write to main memory, the data is first written to the cache on the assumption that the processor will probably read it again soon. Various different policies are used. In a write-through cache, data is written to main memory at the same time as it is cached. In a write-back cache it is only written to main memory when it is forced out of the cache. If all accesses were writes then, with a write-through policy, every write to the cache would necessitate a main memory write, thus slowing the system down to main memory speed. However, statistically, most accesses are reads and most of these will be satisfied from the cache. Write-through is simpler than write-back because an entry that is to be replaced can just be overwritten in the cache as it will already have been copied to main memory whereas write-back requires the cache to initiate a main memory write of the flushed entry followed (for a processor read) by a main memory read. However, write-back is more efficient because an entry may be written many times in the cache without a main memory access.

Question:What is difference b/w assembler and disassembler?
Answer:Assembler An assembler is a program that takes basic computer instructions and converts them into a pattern of bits that the computer's processor can use to perform its basic operations. Some people call these instructions assembler language and others use the term assembly language. In programming terminology, to disassemble is to convert a program in its executable (ready-to-run) form (sometimes called object code) into a representation in some form of assembler language so that it is readable by a human. A program used to accomplish this is called a disassembler, because it performs the inverse of the task that an assembler does. Disassembly is a type of reverse engineering. Another such program, called a decompiler, converts object code back into the code of a higher-level language.

Question:What are the functions of Parity and Sign flag?
Answer:

Dear Student

P

Parity

Parity is the number of “one” bits in a binary number. Parity is either odd or even. This information is normally used in communications to verify the integrity of data sent from the sender to the receiver.

S

Sign Flag

A signed number is represented in its two’s complement form in the computer. The most significant bit (MSB) of a negative number in this representation is 1 and for a positive number it is zero. The sign bit of the last mathematical or logical operation’s destination is copied into the sign flag.

Thanks

0 Responses