0% found this document useful (0 votes)
2 views

Lab 1

The document provides instructions on how to invoke the debug tool in Windows, detailing commands and their functions. It explains the differences between registers and flags, as well as the purpose of various types of registers, including the Instruction Register, Status Register, and Accumulator Register. Additionally, it describes how the Accumulator Register is used for arithmetic operations in the CPU.

Uploaded by

Syed Wahab
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
2 views

Lab 1

The document provides instructions on how to invoke the debug tool in Windows, detailing commands and their functions. It explains the differences between registers and flags, as well as the purpose of various types of registers, including the Instruction Register, Status Register, and Accumulator Register. Additionally, it describes how the Accumulator Register is used for arithmetic operations in the CPU.

Uploaded by

Syed Wahab
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
You are on page 1/ 6

Lab 1:

Q: Show how you can invoke debug?


Ans: To invoke debug Press WIN + R Button for Run interface after that type Debug in Windows
7 But in My case I have windows 11 So, I install debug64bit for invoke that open run interface
through Win + R and type C:\Debug64bit\Run.bat

And press ok button the debug will open like that:


Q2: How can you show commands also show the list of command displayed?
Ans: To showing all the commands type ? in debug the debugger show all the commands. ?
mark is the help command the list of command shown below:

After that Press Enter For more commands:

Q3: What information displayed on R command?


Ans: The R command Displayed like that:
Q4: Show R Command in different format?
Ans: The R command is register command they show the information about Registers
forexample RM is for MMX Register and other shown below:

Run RM command:
Write RM on debug:

But this command show nothing.


Run RN Command:
Write RNon debug and this command shown like that:

Run RX Command:
Write RX on debug and this command shown like that:

Q5: What is register different between register and flag?


Ans: Register: Registers are a type of computer memory used to quickly accept, store, and
transfer data and instructions that are being used immediately by the CPU. The registers used
by the CPU are often termed as Processor registers.

A processor register may hold an instruction, a storage address, or any data (such as bit
sequence or individual characters).

The computer needs processor registers for manipulating data and a register for holding a
memory address. The register holding the memory location is used to calculate the address of
the next instruction after the execution of the current instruction is completed.

Different between register and flag:


Register:
A register is typically one word (i.e. could be 8, 16, 32, 64 bits) in length and is used as a handy
data location for the CPU. It's typically the data location that can be accessed the fastest by the
CPU. Some architectures declare all the registers to be the same and others (e.g. Intel) have
different registers that are supposed to be for certain operations (e.g. the AX register is for
accumulating values after a math operation). Some architectures do not use registers at all
(they use only the stack... notable examples are the RS600 and the JVM).

Flag:

A Flag is a data location similar to a register but is used differently. Rather than the CPU using
all (or sometimes half) of the register, only one bit at a time is used when a certain event occurs
(e.g. addition overflow).

Q6: Briefly explain the purpose of each Register?

Ans: Types of Register are:

Instruction Register (IR)


The Instruction Register (IR) stores the instruction currently being executed. In simple
processors each instruction to be executed is loaded into the instruction register which holds it
while it is decoded, prepared and ultimately executed.
BRANCH (unconditional), BRANCH IF ZERO (conditional) takes the place of the instruction
register in the LMC.
Status register
A Status register or flag register or condition code register is a collection of status flags based
on a processor. Status register is also a hardware register that contains the information about
the state of the processor.
This register has a size of 16 bits with each bit having a flag. Status register is used in different
conditions like if the result is negative, result is zero etc. There are different types of status
registers such as Program Status registers is the register which holds the status of current
execution of the program.
It also controls the enabling and disabling of interrupts and sets the processor operating mode.
Program status register is divided into following −
 Application program status registers (APSR)
 Interrupt program status registers (IPSR)
 Execution program status registers (EPSR)
If the flag is Z − It indicates that the result of the arithmetic operations which were loaded is
zero.
If the flag is N − It indicates that the result of mathematical operation is negative.
If the flag is V/O − It indicates that the result of the operation is too large to fit in the register.
That is the reason it overflows the result.
If the flag is P − It indicates that the number of sets of bits the last result is odd or even.
Shift register
A Shift Register is a kind of sequential logic circuit that have ability of both storing and
transferring data, made up of flip-flops and connected in such manner that the output of one
flip-flop will work as the input of other flip-flop (depending upon which type of shift register is
used)
There are six types of shift register which are as follows −
 Serial in - Serial out Shift Register − It streams-in data serially one after the other and
streams-out in similar manner.
 Serial in - Parallel Out Shift Register − It converts the data in serial manner and out the
data in parallel manner
 Parallel in - Serial Out Shift Register − It takes data in parallel and streamsout in serial
manner (one after other).
 Parallel in - Parallel Out Shift Register − Input data fed-in parallel and output data is
streams-out simultaneously parallel.
 Bidirectional Shift Register − This shift register can perform either right or left data shift
or could perform in both directions.
 Counters − It feedbacks their output into the device as input in such a manner that
creates a particular pattern or sequence.
Accumulator Register (AC)
It is used for storing the results that are produced by the system. When the CPU gives the
results after the executing then all the results are Stored into the AC Register.
Memory Address Register (MAR)
It is used to hold the memory addresses of data and instructions. It accesses data and
instructions from memory during the execution phase of an instruction. For example, the CPU
wants to store some data in the memory or to read the data from the memory. It places the
address of the-required memory location in the MAR.
Program Counter (PC)
It contains the address of the next instruction to be executed. In other words, it holds the
address of the memory location of the next instruction when the current instruction is
executed by the microprocessor.

Q7: Execute Accumulator used for arithmetic operator?


Ans: Accumulator Register: An accumulator is a type of register for short-term, intermediate
storage of arithmetic and logic data in a computer's central processing unit (CPU). However, the
term is rarely used in reference to contemporary CPUs, having been replaced around the turn
of the millennium by the term register. In a computer's central processing unit (CPU),
the accumulator is a register in which intermediate arithmetic logic unit results are stored.
Without a register like an accumulator, it would be necessary to write the result of each
calculation (addition, multiplication, shift, etc.) to main memory, perhaps only to be read right
back again for use in the next operation.

You might also like