Monday, September 30, 2024

Addressing Modes of 8080 / 8085 MicroProcessor

Hi,
 
In this post I am going to talk about different addressing modes of 8080/8085...without much talking let us get into the topic.
 
There are five different addressing modes in 8080/8085...namely
 
Addressing modes of 8080/8085

Immediate Addressing Mode

Register Addressing Mode

Direct Addressing Mode

Indirect Addressing Mode

Implied/Implicit Addressing Mode
 
Well before we proceed further...let us ask a question to ourself, what do you mean by Addressing Mode in the first place?
 
To put in simple terms, the word Addressing Mode refers to the way in which one of the operands is referred in 8080/8085 instruction(s).

The following discussion would detail more about each of the addressing modes...

Immediate Addressing Mode
     
In this addressing mode, the data that is referred in the instruction is directly transfered to the register...

Eg :- MVI C, 50H
Consider the instruction above, in this the value 50H is mentioned as the source which has to be copied directly to the register C and this copy is not through other available register or from a specified memory location.

Consider an other instruction of loading data like the one given below....

LXI B, 1000H
the above instruction loads the BC register pair with the value 1000H, since the value 1000H is a 16-bit value, it requires 16-bit place holder to resider. Picking up BC register pair is up to us...the same can be done done using DE register pair as well...

Register Addressing Mode
     
In this addressing mode, the data is transferred/copied from one register to another register. i.e the source and destination should both be of type registers

Eg :- MOV B, C
From the above instruction, both the operands of type registers(8-bit),the value of the source i.e C is moved to the destination i.e B

Consider an other instruction of transferring data between registers...

INR D
the above instruction does a simple operation of incrementing the value of D by one and stores the result in the same register...

Direct Addressing Mode
     
In this addressing mode, the address of the memory location is used directly to store and retrive the value into a register...

Eg :- LDA 1000H
the above instruction would load the value resides at the memory location 1000H into the register A i.e the accumulator

Consider an other instruction which stores the register value into the memory location at the specified memory address

STA 1000H
the above instruction does store the value accumulated/contained in the accumulator or register A into the memory location at the address 1000H

Indirect Addressing Mode
     
In this addressing mode, the address of the memory location is used indirectly via a register pair to retrive and store the value into a register...

Eg :- STAX B
the above instruction would store the accumulater value into the memory address contained in the register pair B and C

Consider an other instruction which stores the register value into the memory location at the specified memory address

INR M
the above instruction increment the value which is residing at the memory location whose address is contained in register pair H and L

Implicit/Implied Addressing Mode
      In this addressing mode, the operand is implied in the instruction itself...

Eg :- STC
In the above instruction the register C is implied/implicit in the instruction itself and would set the carry flag to '1' irrespective of the current value of the carry flag

Consider an other instruction...

CMC
the above instruction would complement the value of the carry flag...i.e if the present value of the carry flag is '1' the instruction would complements it to '0' and vice versa.

Sunday, September 29, 2024

Instruction Set of 8080 / 8085 MicroProcessor

In this post I am going to list out the detailed instruction set available for 8080 and 8085
 
There isn't much difference between the instruction set of 8080 and 8085.
 
The purpose of writing this post is to have a kick start on programming 8080 / 8085 Microprocessor.
 
The main purpose is to set the fundamentals right for those who wants to know how actually the operations are going on in a microprocessor in a detailed manner.

The following sections would debrief you on the instructions used to program 8080 / 8085 microprocessor...there is no need to memorize it....these sections are provided for you to refer in case if there is any need.
 
Frequently Used Instructions / Op-Codes
Instruction / Op-CodeMeaning
ADC, ACIAdd with Carry
ADD, ADIAdd
ANA, ANILogical AND
CALLCall Subroutine
CMP, CPICompare
DCRDecrement
INInput
INRIncrement
INXIncrement 16 Bits
JCJump on Carry
JMPJump
JNCJump on Not Carry
JNZJump on Not Zero
JZJump on Zero
LDALoad Accumulator
LXILoad 16 Bits
MOVMove
MVIMove Immediate
OUTOutput
RALRotate with Carry Left
RARRotate with Carry Right
RETReturn from SubRoutine
STAStore Accumulator
SUB, SUISubtract

Occasionally Used Instructions / Op-Codes
Instruction / Op-CodeMeaning
CMAComplement Accumulator
DAADecimal Adjust
DAD16-Bit Add
DCX16-Bit Decrement
DIDisable Interrupts
EIEnable Interrupts
HLTHalt
JMJump on Minus
JPJump on Positive
LDAXLoad Accumulator Indirect
LHLDLoad H and L Direct
NOPNo Operation
ORA, ORILogical OR
POPRemove from Stack
PUSHEnter into Stack
RMI(8085 Only)Reset Interrupt Mask
RLCRotate Left
RRCRotate Right
SHLDStore H and L Direct
SIM(8085 Only)Set Interrupt Mask
STAXStore Accumulator InDirect
XCHGExchange D and E, H and L
XRA, XRILogical Exclusive OR

Seldom Used Instructions / Op-Codes
Instruction / Op-CodeMeaning
CCCall on Carry
CMCall on Minus
CMCComplement Carry
CNCCall on No Carry
CNZCall on Not Zero
CPCall on Positive
CPECall on Parity Even
CPOCall on Parity Odd
CZCall on Zero
JPEJump on Parity Even
JPOJump on Parity Odd
PCHLH and L to Program Counter
RCReturn on carry
RMReturn on Minus
RNCReturn on No Carry
RNZReturn on Not Zero
RPReturn on Positive
RPEReturn on Parity Even
RPOReturn on Parity Odd
RSTRestart
RZReturn on Zero
SBB, SBISubtract With Borrow
SPHLH and L to Stack Pointer
STCSet Carry
XTHLExchange Top of Stack, H and L

General Purpose and Flag Registers of 8080/8085 MicroProcessor

Hi,

In this post/chapter I would like to discuss about the general purpose and flag registers of 8080/8085... the following diagram would give you the big picture of the general purpose and flag registers of 8080/8085 micro processor.

General Pupose and Flag Registers of 8080/8085 MicroProcessor
Accumulator (8-bit)
7
S
6
Z
5
X
4
AC
3
X
2
P
1
X
0
C
B (8-bit)C (8-bit)
D (8-bit)E (8-bit)
H (8-bit)L (8-bit)
Stack Pointer(SP) (16-bit)
Program Counter(PC) (16-bit)

A small note on registers...
1 an 8-bit Accumulator
2 7 8-bit general purpose registers including accumulator
3 16-bit general purpose register pairs namely BC, DE, and HL
4 A Stack Pointer
5 A Program Counter
6
An 8-bit flag register...
SSign Flag7If the result is positive the SF=0 else SF=1
ZZero Flag6if the result is Zero then ZF=1 else ZF=0
ACAuxiliary Carry Flag4If carry Auxilliary Carry generated then AC=1
PParity Flag2If the number of one bits of the result is even then PF=1 else PF=0
CCarry Flag0If the operation resulted in a carry then CF=1 else CF=0
XPositions 1, 3, and 5 are reserved

Programming 8080/8085 MicroProcessor

Hi All,
 
Well I did not think that I would be writing such a post on a very old topic...some might think that it's outdated and some it's irrelevant...but as I was reading on the architecture and programming in 8080 and 8085, I thought it would be interesting to write some series of post right from the discussion of architecture to complex programing of the 8080/8085 microprocessors.
 
Definitely yes, it is a very old story to be told again, but for new comers this is yet an other spot to hear the story of 8080/8085 microprocessors.
 
I am not going to talk about history/geography of 8080/8085, the intention is to have a detailed talk on the technical aspect of fore mentioned microprocessors and programming the same at the assembly language level.
 
Well with that said, let us dive in to the world of 8080/8085 to understand it better...
 
The following sections gives the pin and architecture diagram of 8080 and 8085
 
Intel 8080
Pin Diagram of 8080
 
Architecture Diagram of 8080
 
 
Intel 8085
Pin Diagram of 8085
 
Architecture Diagram of 8085
 
 
Though we have a lot of changes at the architecture level between 8080 and 8085, the instruction set between these two would not differ that much except few additions in 8085 than 8080.

The instruction set of both of these microprocessors are detailed in the next chapter. For details please do check the link below...

Wednesday, September 11, 2024

Upgrading Ubuntu from Current Version to Next Higher Version

Hi,

In this post I am going to talk about upgrading ubuntu from its current version to the next higher version...recently I have made a upgrade of my personal OS Ubuntu 22.04 LTS to 24.04 LTS
 
This post is going to be very generic, which means that the procedure description here can be applied on any version of ubuntu to be upgraded to its higher version.
 
Updating the current version of ubuntu...
Open up a terminal and start firing the commands given below to update your current version of Ubuntu to its recent state...
 
$ sudo apt update
The above command would prompt you to key in the password...please provide the one associated with the user.
 
$ sudo apt list --upgradable | more
$ sudo apt upgrade
 
Wait till the update process is completed...
 
Rebooting the system...
Now its time to reboot the system, use the following command in the terminal to reboot.
 
$ sudo reboot
 
Actual Upgrade
Soon after the reboot...use the following command to upgrade the current version of Ubuntu to the recent version...

$ sudo apt install ubuntu-release-upgrader-core
 
this command is the starting point of the upgrade process...this would popup a window for the series of the actions to be made manually and approximately the time taken would be 60 minutes....mine was little shorter for upgrade completion...
 
Confirmation...
The above upgrade process completion would be confirmed successful by checking the release upgrade...
 
use the following command(s) for your confirmation...
 
$ grep 'lts' /etc/update-manager/release-upgrades 
or
$ cat /etc/update-manager/release-upgrades
either case...you would find the following line in the release upgrade...
 
Prompt=lts
 

Saturday, January 28, 2023

How to change the root password in linux when it is forgotten/to change

This blog is all about changing the root password of the Linux system when it is forgotten or to reset the password...
 
Let's get it started...
 
1. Shutdown the sytem
 
2. Start the system
 
3. When you see the GRUB Menu press the 'e' key before the operating system boots...
 
4. In the GRUB boot options...
   4.1. scroll down and locate the line that begins with ‘linux’
 
   4.2. In this line move the cursor to the end of the line after "ro quiet"
 
   4.3 Append the parameter init=/bin/bash
 
5. Press Ctrl+ x or F10 to boot
 
6. Now you would see the root prompt
 
7. In the command line type the following command
 
mount -n -o remount,rw /
 
the above command would mount the system in ReadWrite mode against the default mode i.e Read
 
8. Now you can change the password for any user by using the following command...
 
:# passwd <username>
 
9. Press Ctrl + D or Ctrl + Alt + Del to exit
 
Now the new password which is set for the appropriate user should work now....
 
 
 

Tuesday, December 14, 2021

NMAP - Network Mapper : Scanning Localhost

I am going to use localhost to scan for the ports and the applications that uses...
 
Use the following command to scan localhost
 
$ nmap localhost
 
The result of the execution would be summarized as the image given below...
 

As you can see from the image the list of open ports and the services that uses it....other applications can connect through the port to access the required services...

Addressing Modes of 8080 / 8085 MicroProcessor

Hi,   In this post I am going to talk about different addressing modes of 8080/8085...without much talking let us get into the topic.   Ther...