In 8085 Instruction set, we are having a set of instructions to perform compare operation where we shall compare two operands, and which will affect the status flags values depending on the result of the comparison. In this operation, 8085 imposes the restriction that one of the operands must be in the Accumulator. The other operand can be one of the following –ClassificationsExamplesThe other operand can be kept in 8-bit immediate data in the instruction.CPI 43HCPI FFHThe other 8-bit operand can be kept in a memory location and whose memory address will be pointed by HL register pair.CMP MThe other ... Read More
Use the ‘C’ date conversion character to display two digits of year −System.out.printf("Two-digit Year (Century Name) = %tC/%TC", d, d);Above, d is a date object −Date d = new Date();The following is an example −Example Live Demoimport java.util.Date; import java.text.DateFormat; import java.text.SimpleDateFormat; public class Demo { public static void main(String[] args) throws Exception { Date d = new Date(); DateFormat dateFormat = new SimpleDateFormat("dd/MM/yyyy hh:mm:ss a"); String format = dateFormat.format(d); System.out.println("Current date and time = " + format); System.out.printf("Localized day name = %tA/%TA", d, d); ... Read More
Use the ‘Y’ date conversion character to display four-digit year.System.out.printf("Four-digit Year = %TY",d);Above, d is a date object −Date d = new Date();The following is an example −Example Live Demoimport java.util.Date; import java.text.DateFormat; import java.text.SimpleDateFormat; public class Demo { public static void main(String[] args) throws Exception { Date d = new Date(); DateFormat dateFormat = new SimpleDateFormat("dd/MM/yyyy hh:mm:ss a"); String format = dateFormat.format(d); System.out.println("Current date and time = " + format); System.out.printf("Four-digit Year = %TY",d); } }OutputCurrent date and time = 26/11/2018 11:56:26 AM Four-digit Year = 2018
Use the ‘y’ date conversion character to display two-digit year.System.out.printf("Two-digit Year = %TY", d);Above, d is a date object −Date d = new Date();The following is an example −Example Live Demoimport java.util.Date; import java.text.DateFormat; import java.text.SimpleDateFormat; public class Demo { public static void main(String[] args) throws Exception { Date d = new Date(); DateFormat dateFormat = new SimpleDateFormat("dd/MM/yyyy hh:mm:ss a"); String format = dateFormat.format(d); System.out.println("Current date and time = " + format); System.out.printf("Four-digit Year = %TY", d); System.out.printf("Two-digit Year = %ty", d); ... Read More
Use the ‘j’ date conversion character to display three-digit day of the year.System.out.printf("Three-digit Day of the Year: %tj/%Tj", d, d);Above, d is a date object −Date d = new Date();The following is an example −Example Live Demoimport java.util.Date; import java.text.DateFormat; import java.text.SimpleDateFormat; public class Demo { public static void main(String[] args) throws Exception { Date d = new Date(); DateFormat dateFormat = new SimpleDateFormat("dd/MM/yyyy hh:mm:ss a"); String format = dateFormat.format(d); System.out.println("Current date and time = " + format); System.out.printf("Four-digit Year = %TY", d); ... Read More
Use the ‘d’ date conversion character to display two-digit day of the month, for example, 27, 28, 20, etc.System.out.printf("Two-digit day of the month: %td", d);Above, d is a date object −Date d = new Date();The following is an example −Example Live Demoimport java.util.Date; import java.text.DateFormat; import java.text.SimpleDateFormat; public class Demo { public static void main(String[] args) throws Exception { Date d = new Date(); DateFormat dateFormat = new SimpleDateFormat("dd/MM/yyyy hh:mm:ss a"); String format = dateFormat.format(d); System.out.println("Current date and time = " + format); System.out.printf("Four-digit Year ... Read More
The bits of an integer number can be reversed to obtain another number. An example of this is given as follows −Number = 11 Binary representation = 1011 Reversed binary representation = 1101 Reversed number = 13A program that demonstrates this is given as follows −Example Live Demopublic class Example { public static void main(String[] args) { int num = 14; int n = num; int rev = 0; while (num > 0) { rev = 1; } ... Read More
To list weekday names, use the getWeekdays () from the DateFormatSymbols class in Java.DateFormatSymbols is a class for encapsulating localizable date-time formatting data.Get weekday month names in an array −String[] days = new DateFormatSymbols().getWeekdays ();Display the weekdays −for (int i = 0; i < days.length; i++) { String weekday = days[i]; System.out.println(weekday); }The following is an example −Example Live Demoimport java.text.DateFormatSymbols; public class Demo { public static void main(String[] args) { String[] days = new DateFormatSymbols().getWeekdays(); for (int i = 0; i < days.length; i++) { String weekday ... Read More
In 8085 Instruction set, there a set of instructions which can Accumulator contents left orright. It is to be noted here that rotate operation can be performedonly on Accumulator contents. These instructions set is listed below– Mnemonics, OperandOpcode(in HEX)BytesRAL171RAR1F1RLC071RRC0F1Mnemonic RLC stands for “Rotate Left Accumulator”. It rotates the Accumulator contents to the left by 1-bit position. The following Fig. shows the operation explicitly – In this fig. it has been depicted that the mostsignificant bit of the Accumulator will come out and left rotate willcreate an empty space at the least significant bit place and thiscome out bit will be copied at ... Read More
In 8085 Instruction set, there are a set of jump instructions, which can transfer program control to a certain memory location. So after these branching mnemonics we shall have to mention 16-bit target address of the location. These jump instructions can be divided into two categories– Unconditional jump instructions andConditional jump instructionsUnder unconditional jump instructions there is only one mnemonic i.e. JUMP. But under conditional Jump instructions we are having 8 different mnemonics. We know that there are 5 flag bits in 8085 Flag register. They are S, Z, P, Cy, AC. Out of them only on AC flag bit, there ... Read More
Data Structure
Networking
RDBMS
Operating System
Java
iOS
HTML
CSS
Android
Python
C Programming
C++
C#
MongoDB
MySQL
Javascript
PHP