3. • Machine Instructions are commands or programs written in machine code of
a machine (computer) that it can recognize and execute.
• A machine instruction consists of several bytes in memory that tells the
processor to perform one machine operation.
• The processor looks at machine instructions in main memory one after
another, and performs one machine operation for each machine instruction.
• The collection of machine instructions in main memory is called a machine
language program.
3
LECTURE-1.2
MACHINE INSTRUCTIONS
4. [Label:] Mnemonic [Operand, Operand] [; Comments]
• Brackets indicate that a field is optional
• Label is an identifier that is assigned the address of the first byte of the
instruction in which it appears. It must be followed by “:”
• Inclusion of spaces is arbitrary, except that at least one space must be
inserted; no space would lead to an ambiguity.
• Comment field begins with a semicolon “ ; ”
Example:
Here: MOV R5, #25H ; load 25H into R5
4
MACHINE INSTRUCTIONS
FORMAT
7. 7
COMPUTER FUNCTION
• The basic function performed by a computer is execution of a program, which
consists of a set of instructions stored in memory.
• Two steps of Instructions Cycle:
o Fetch
o Execute
8. 8
BASIC INSTRUCTION CYCLE
Fetch Cycle
• Program Counter (PC) holds address of next instruction to fetch
• Processor fetches instruction from memory location pointed to by PC
• Increment PC
Unless told otherwise
• Instruction loaded into Instruction Register (IR) Computer Organization and Architecture
Execute Cycle
• Processor interprets instruction and performs required actions, such as:
• Processor - memory
Data transfer between CPU and main memory
• Processor - I/O
Data transfer between CPU and I/O module
• Data processing
Some arithmetic or logical operation on data
• Control
Alteration of sequence of operations o e.g. jump
• Combination of above
10. • Bus cycle
The bus cycle is the cycle or time required to make a single read or write
transaction between the cpu and an external device such as external
memory.
• Machine cycle
The machine cycle is the amount of cycles needed to do either a fetch, read
or write operation. more. The read or write may be more than a single bus
cycle if the transaction between the CPU and memory is longer than the
data width fetched or written. For example, on an 8080 machine, the data
width is 8 bits. If the CPU needs to fetch or write 16 bits of data, that will
require two bus cycles.
10
11. Q1. A basic instruction that can be interpreted by computer has
A. Operand and opcode
B. Decoder and Accumulator
C. Sequence register and decoder
D. None of the above
Q2. In a program using subroutine call instruction, it is necessary
initialize program counter
Clear the accumulator
Reset the microprocessor
Clear the instruction register
11
HOMEWORK
12. Q3. In generic microprocessor instruction time is
A. Shorter than machine cycle time
B. Larger than machine cycle time
C. Ten times machine cycle time
D. Exactly same as machine cycle time
Answers:1.A,2.D,3.D
12
HOMEWORK
13. REFERENCES
Reference Books:
1. J.P. Hayes, “Computer Architecture and Organization”, Third Edition.
2. Mano, M., “Computer System Architecture”, Third Edition, Prentice Hall.
3. Stallings, W., “Computer Organization and Architecture”, Eighth Edition, Pearson
Education.
Text Books:
1. Carpinelli J.D,” Computer systems organization &Architecture”, Fourth Edition,
Addison Wesley.
2. Patterson and Hennessy, “Computer Architecture” , Fifth Edition Morgaon
Kauffman.
Reference Website
1. https://www.geeksforgeeks.org/computer-organization-and-architecture-tutorials/
2. https://www.eventhelix.com/RealtimeMantra/FaultHandling/bus_cycles.htm
3. https://stackoverflow.com/questions/10383354/difference-between-machine-
cycle-bus-cycle-and-execution-
cycle#:~:text=The%20bus%20cycle%20is%20the,more%20here.
13