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

Philippine College of Science and Technology: Assignment 2 Assembly Language Programming Building Microprocessor

The document discusses assembly language programming and the 8085 microprocessor instruction set. It begins by defining assembly language and how it corresponds closely to machine code. It then explains the different types of instructions including data transfer, data manipulation, and program control instructions. Next, it classifies the 8085 instructions into five functional categories and describes the different addressing modes used in 8085 including immediate, register, direct, indirect, and implied addressing. Finally, it provides information on the instruction set of the Z80 microprocessor, grouping the instructions into categories like arithmetic, logic, load, jump, and input/output instructions.
Copyright
© © All Rights Reserved
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
51 views

Philippine College of Science and Technology: Assignment 2 Assembly Language Programming Building Microprocessor

The document discusses assembly language programming and the 8085 microprocessor instruction set. It begins by defining assembly language and how it corresponds closely to machine code. It then explains the different types of instructions including data transfer, data manipulation, and program control instructions. Next, it classifies the 8085 instructions into five functional categories and describes the different addressing modes used in 8085 including immediate, register, direct, indirect, and implied addressing. Finally, it provides information on the instruction set of the Z80 microprocessor, grouping the instructions into categories like arithmetic, logic, load, jump, and input/output instructions.
Copyright
© © All Rights Reserved
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
You are on page 1/ 3

PHILIPPINE COLLEGE OF SCIENCE AND TECHNOLOGY

Old Nalsian Road, Nalsian, Calasiao, Pangasinan, Philippines 2418


Tel. No. (075)522-8032/Fax No. (075)523-0894/Website: www.philcst.edu.ph
ISO 9001:2015 CERTIFIED, Member: Philippine Association of Colleges and Universities (PACU),
Philippine Association of Maritime Institutions (PAMI)

Assignment 2

Assembly Language Programming Building Microprocessor


1. What is assembly language programming?

In computer programming, assembly language (or assembler language),[1] often abbreviated asm, is any low-


level programming language in which there is a very strong correspondence between the instructions in the
language and the architecture's machine code instructions.[2] Because assembly depends on the machine code
instructions, every assembly language is designed for exactly one specific computer architecture. Assembly
language may also be called symbolic machine code.[3][4]
Assembly code is converted into executable machine code by a utility program referred to as an assembler. The
conversion process is referred to as assembly, as in assembling the source code. Assembly language usually has
one statement per machine instruction (1:1), but comments and statements that are assembler directives,
[5] macros,[6][1] and symbolic labels of program and memory locations are often also supported.

2. Explain the types of instructions.


Types of Instructions:
Data Transfer Instructions: Data transfer instructions cause transfer of data from one location to another
without changing the information content.
The common transfers may be between memory and processor registers, between processor registers and
input/output.
Data Manipulation Instructions: Data manipulation instructions perform operations on data and provide the
computational capabilities for the computer. There are three types of data manipulation instructions:
Arithmetic instructions, Logical and bit manipulation instructions, and Shift instructions.
Program Control Instructions
Program control instructions specify conditions for altering the content of the program counter, while data
transfer and manipulation instructions specify conditions for data processing operations. The change in value of
a program counter as a result of the execution of a program control instruction causes a break in the sequence
of instruction execution.

3. Explain the classification of 8085 instructions.

An instruction is a binary pattern designed inside a microprocessor to perform a specific function. The entire
group of instructions, called the instruction set, determines what functions the microprocessor can perform.
These instructions can be classified into the following five functional categories: data transfer (copy) operations,
arithmetic operations, logical operations, branching operations, and machine-control operations.

1. Data Transfer Croup:


-The data transfer instructions move data between registers or between memory and registers.

2. Arithmetic Group
-The arithmetic instructions add, subtract, increment, or decrement data in registers or memory.

3.Logical Group
-This group performs logical (Boolean) operations on data in registers and memory and on condition flags. The
logical AND, OR, and Exclusive OR instructions enable you to set specific bits in

4. Explain the different types of addressing modes.


Types of addressing modes –
In 8085 microprocessor there are 5 types of addressing modes:
 Immediate Addressing Mode –
In immediate addressing mode the source operand is always data. If the data is 8-bit, then the
instruction will be of 2 bytes, if the data is of 16-bit then the instruction will be of 3 bytes.
Examples:
MVI B 45 (move the data 45H immediately to register B)
LXI H 3050 (load the H-L pair with the operand 3050H immediately)
JMP address (jump to the operand address immediately)

 Register Addressing Mode –


In register addressing mode, the data to be operated is available inside the register(s) and register(s)
is(are) operands. Therefore the operation is performed within various registers of the microprocessor.
Examples:
MOV A, B (move the contents of register B to register A)
ADD B (add contents of registers A and B and store the result in register A)
INR A (increment the contents of register A by one)
 Direct Addressing Mode –
In direct addressing mode, the data to be operated is available inside a memory location and that
memory location is directly specified as an operand. The operand is directly available in the instruction
itself.
Examples:
LDA 2050 (load the contents of memory location into accumulator A)
LHLD address (load contents of 16-bit memory location into H-L register pair)
IN 35 (read the data from port whose address is 01)
 Register Indirect Addressing Mode –
In register indirect addressing mode, the data to be operated is available inside a memory location and
that memory location is indirectly specified by a register pair.
Examples:
MOV A, M (move the contents of the memory location pointed by the H-L pair to the accumulator)
LDAX B (move contents of B-C register to the accumulator)
LXIH 9570 (load immediate the H-L pair with the address of the location 9570)

 Implied/Implicit Addressing Mode –


In implied/implicit addressing mode the operand is hidden and the data to be operated is available in
the instruction itself.
Examples:
CMA (finds and stores the 1’s complement of the contains of accumulator A in A)
RRC (rotate accumulator A right by one bit)
RLC (rotate accumulator A left by one bit)

5. Find for the instruction set for 8085 and Z80 microprocessor. This is needed for you to hand
assemble a given program in the 8085 and Z80 instruction and be able to determine the
Machine code of each instruction.
The Z80 uses 252 out of the available 256 codes as single byte opcodes ("root instruction"); the four remaining
codes are used extensively as opcode prefixes:[30] CB and ED enable extra instructions and DD or FD selects
IX+d or IY+d respectively (in some cases without displacement d) in place of HL. This scheme gives the Z80 a
large number of permutations of instructions and registers; Zilog categorizes these into 158 different
"instruction types", 78 of which are the same as those of the Intel 8080[30] (allowing operation of most 8080
programs on a Z80). The Zilog documentation further groups instructions into the following categories:
 8-bit arithmetic and logic operations
 16-bit arithmetic
 8-bit load
 16-bit load
 Bit set, reset, and test
 Call, return, and restart
 Exchange, block transfer, and search
 General purpose arithmetic and CPU control
 Input and output
 Jump
 Rotate and shift
The index registers, IX and IY, were intended as flexible 16 bit pointers, enhancing the ability to manipulate
memory, stack frames and data structures. Officially, they were treated as 16-bit only. In reality they were
implemented as a pair of 8-bit registers,[33] in the same fashion as the HL register, which is accessible either as
16 bits or separately as the High and Low registers. The binary opcodes (machine language) were identical, but
preceded by a new opcode prefix.[34] Zilog published the opcodes and related mnemonics for the intended
functions, but did not document the fact that every opcode that allowed manipulation of the H and L registers
was equally valid for the 8 bit portions of the IX and IY registers. For example, the opcode 26h followed by an
immediate byte value (LD H,n) will load that value into the H register. Preceding this two-byte instruction with
the IX register's opcode prefix, DD, would instead result in the most significant 8 bits of the IX register being
loaded with that same value. A notable exception to this would be instructions similar to LD H,(IX+d) which
make use of both the HL and IX or IY registers in the same instruction;[34] in this case the DD prefix is only
applied to the (IX+d) portion of the instruction. The halves of the XY registers could also hold operands for 8-bit
arithmetic, logical and compare instructions, sparing the regular 8-bit registers for other use. The
undocumented ability to increment and decrement the upper half of an index register made it easy to expand
the range of the normal indexed instructions, without having to resort to the legal ADD/SBC XY,DE or ADD/SBC
XY,BC.
There are several other undocumented instructions as well.[35] Undocumented or illegal opcodes are not
detected by the Z80 and have various effects, some of which are useful. However, as they are not part of the
formal definition of the instruction set, different implementations of the Z80 are not guaranteed to work the
same way for every undocumented opcode.

You might also like