Computer Architecture II Cte 412 Presentation
Computer Architecture II Cte 412 Presentation
A
PRESENTATION
ON
PENTIUM PC
ASSEMBLLY LANGUAGE & DATATYPES
TYPES OF OPERATION
LECTURER
ENGR. OLOYEDE. A. O.
STUDENT
NAME MATRIC. No:
AREAGO TOMIWA SAMUEL F/HD/19/3410003
ADERONKE ABIMBOLA OSUNLOLA F/HD/19/3410006
Fig: -The three personal computers referred to by Byte Magazine as the "1977 Trinity" of
home computing: The Commodore PET, the Apple II, and the TRS-80 Model I.
ASSEMBLY LANGUAGE
What is Assembly Language?
Every personal computer has a microprocessor that manages the computer's arithmetical,
logical, and control activities. Each family of processors has its own set of instructions for
handling various operations such as getting input from keyboard, displaying information on
screen and performing various other jobs. These set of instructions are called 'machine
language instructions'.
An assembly language is a type of low-level programming language that is intended to
communicate directly with a computer’s hardware. Unlike machine language, which consists
of binary and hexadecimal characters, assembly languages are designed to be readable by
humans. A processor understands only machine language instructions, which are strings of
1's and 0's. However, machine language is too obscure and complex for using in software
development. So, the low-level assembly language is designed for a specific family of
processors that represents various instructions in symbolic code and a more understandable
form.
Low-level programming languages such as assembly language are a necessary bridge
between the underlying hardware of a computer and the higher-level programming languages
such as Python or JavaScript, in which modern software programs are written.
Definition of Assembly Language
An assembly language can be defined as a programming language made up of operation
mnemonics and symbolic data locations. The assembly language programmer makes use of
instruction mnemonics and symbolic names of addresses rather than work with operation
codes and operand addresses.
DATA TYPES
Unlike humans, a computer does not know the difference between "1234" and "abcd." A data
type is a classification that dictates what a variable or object can hold in computer
programming. Data types are an important factor in virtually all computer programming
languages, including C#, C++, JavaScript, and Visual Basic. When programmers create
computer applications, both desktop and web-based, data types must be referenced and used
correctly to ensure the proper result and an error-free program.
Common examples of data types includes: -
Boolean (e.g., True or False)
Character (e.g., a)
Date (e.g., 03/01/2016)
Double (e.g., 1.79769313486232E308)
Floating-point number (e.g., 1.234)
Integer (e.g., 1234)
Long (e.g., 123456789)
Short (e.g., 0)
String (e.g., abcd)
Void (e.g., no data)
TYPES OF OPERATION
The number of different opcodes varies widely from machine to machine. However, the same
general types of operations are found on all machines. A useful and typi¬cal categorization is
the following:
1. Data transfer
2. Arithmetic
3. Logical
4. Conversion
5. I/O
6. System control
7. Transfer of control
1) Data transfer:
The most fundamental type of machine instruction is the data transfer instruction. The data
transfer instruction must specify several things. The location of the source and destination
operands must be specified. Each location could be memory. a register, or the lop of the
stack. The length of data to be transferred must be indicated. As with all instructions with
operands, the mode of addressing for each operand must be specified.
In term of CPU action, data transfer operations are perhaps the simplest type. If both source
and destination are registers, then the CPU simply causes data to be transferred from one
register to another; this is an operation internal to the CPU. If one or both operands are in
memory, then (the CPU must perform some or all of following actions:
Calculate the memory address, based on the address mode
If the address refers to virtual memory, translate from virtual to actual mem¬ory
address.
Determine whether the addressed item is in cache.
If not, issue a command lo the memory module.
2) Arithmetic:
Most machines provide the basic arithmetic operations of add, subtract, multiply, and divide.
These are invariably provided for signed integer (fixed-point) numbers, Often they are also
provided for floating-point and packed decimal numbers.
Other possible operations include a variety of single-operand instructions: for example.
Absolute: Take the absolute value of the operand.
Negate: Negate the Operand.
Increment.: Add 1 to the operand.
Decrement: Subtract 1 from the operand.
3) Logical:
Most machines also provide a variety of operations for manipulating individual bits of a word
or other addressable units, often referred to as "bit twiddling." They are based upon Boolean
operations. Some of the basic logical operations that can be performed on Boolean or binary
data are AND, OR, NOT, XOR, etc. These logical operations can be applied bitwise to n-bit
logical data units. Thus, if two registers contain the data
(R1) - 10100101 (R2) - 00001111
then
(R1) AND (R2) – 00000101
In addition of bitwise logical operations, most machines provide a variety of shifting and
rotating functions such as shift left, shift right, right rotate, left rotate.
5) Input/Output:
There are a variety of approaches taken, including isolated programmed IO, memory-mapped
programmed I/O, DMA, and the use of an I/O processor. Many implementations provide only
a few I/O instructions, with the specific actions specified by parameters, codes, or command
words.
6) System Controls:
System control instructions are those that can be executed only while the processor is in a
certain privileged state or is executing a program in a special privileged area of memory,
typically, these instructions are reserved for the use of the operating system. Some examples
of system control operations are as follows. A system control instruction may read or alter a
control register. Another example is an instruction to read or modify a storage protection key,
such is used in the S/390 memory system. Another example is access to process control
blocks in a multiprogramming system.
7) Transfer of control:
For all of the operation types discussed so far. The next instruction to be performed is the one
that immediately follows, in memory, the current instruction. However, a significant fraction
of the instructions in any program has as their function changing the sequence of instruction
execution. For these instructions, the operation performed by the CPU is to update the
program counter to contain the address of some instruction in memory.
There are a number of reasons why transfer-of-control operations are required. Among the
most important are the following:
1. In the practical use of computers, it is essential to be able to execute each instruction
more than once and perhaps many thousands of times. It may require thousands or
perhaps millions of instructions to implement an application. This would be
unthinkable if each instruction had to be written out separately. If a table or a list of
items is to be processed, a program loop is needed. One sequence of instructions is
executed repeatedly to process all the data.