Instruction Set of 8051

Chandu yadav
Updated on 27-Jun-2020 13:10:26

26K+ Views

The instructions of 8051 Microcontroller can be classified into five different groups. These groups are like belowData Transfer GroupArithmetic GroupLogical GroupProgram Branch GroupBit Processing GroupThis Bit-Processing group is also known as Boolean Variable Manipulation.Like 8085, some instruction has two operands. The first operand is the Destination, and the second operator is Source.In the following examples, you will get some notations. The notations are like −Rn = Any register from R0to R7 Ri = Either R0 or R1 d8 = Any 8-bit immediate data (00H to FFH) d16 = 16-bit immediate data a8 = 8-bit address bit = 8-bit address of ... Read More

Signed Floating Point Numbers

Arjun Thakur
Updated on 27-Jun-2020 13:10:04

2K+ Views

Were present real numbers in our daily life is not convenient for representing very small numbers, like +0.00000012347650. This same number can be more conveniently represented in scientific notation as +1.23476× 10−07. But this actually stands for +0.000000123476. So there is an error of 0.00000000000005, which forms a very small percentage error.Floating-point representation is similar in concept to scientific notation. Logically, a floating-point number consists of:A signed (meaning positive or negative) digit string of a given length in a given base(or radix).This digit string is referred to as the significand, mantissa, or coefficient.A signed integer exponent which modifies the magnitude of ... Read More

Data Transfer Group in 8051

Arjun Thakur
Updated on 27-Jun-2020 13:08:12

13K+ Views

In 8051 Microcontroller there is 28 different instructions under the Data Transfer Group. In total there are 79 opcodes. The flags are not affected by using the data transfer instructions, but the P (Parity) flag may change if the value of A register is changed using Data Transfer Instruction. Similarly, when a data is transferred to the PSW register, the flags will change.In the following table, we will see the Mnemonics, Lengths, Execution Time in terms of the machine cycle, Number of Opcodes etc.MnemonicsByte CountExecution TimeOpcode CountMOV A, Rn118MOV A, a8211MOV A, @Ri112MOV A, #d8211MOV Rn, A118MOV Rn, a8228MOV Rn, ... Read More

Arithmetic Group in 8051

Ankith Reddy
Updated on 27-Jun-2020 13:07:25

13K+ Views

In 8051 Microcontroller there are 24 different instructions under the Arithmetic Group. In total there are 64 opcodes. The Carry Flag (CY), Auxiliary Carry (AC)and Overflow flag (OV) are affected based on the result of ADD, ADDC, SUBB  etc. instructions. The multiple and divide instructions clear the Carry flag, and also does not affect the AC flag. After execution of multiplication, the OV flag will be 1 when the result is greater than FFH. Otherwise, it is 0. Similarly, after division OV flag is 1 when the content of B is 00H before division, otherwise it is 0. The DA ... Read More

List Short Weekday Names in Java

karthikeya Boyini
Updated on 27-Jun-2020 13:07:02

455 Views

To list short weekday names, use the getShortWeekdays() from the DateFormatSymbols class in Java.DateFormatSymbols is a class for encapsulating localizable date-time formatting data.Get short weekday names in an arrayString[] days = new DateFormatSymbols().getShortWeekdays();Display the weekdayfor (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().getShortWeekdays();       for (int i = 0; i < days.length; i++) {          String weekday = days[i];          System.out.println(weekday);       }    } }OutputSun Mon Tue Wed Thu Fri Sat

Logical Group in 8051

George John
Updated on 27-Jun-2020 13:06:59

7K+ Views

In 8051 Microcontroller there is 25 different instructions under the Logical Group. In total there are 49 opcodes. The Carry Flag (CY) affects only by instruction RRC and RLC.In the following table, we will see the Mnemonics, Lengths, Execution Time in terms of the machine cycle, Number of Opcodes etc.MnemonicsByte CountExecutionTimeOpcode CountANL A, Rn118ANL A, a8211ANL A, @Ri112ANL A, #d8211ANL a8, A211ANL a8, #d8321ORL A, Rn118ORL A, a8211ORL A, @Ri112ORL A, #d8211ORL a8, A211ORL a8, #d8321XRL A, Rn118XRL A, a8211XRL A, @Ri112XRL A, #d8211XRL a8, A211XRL a8, #d8321CLR A111CPL A111RL A111RLC A111RR A111RRC A111SWAP A111ExamplesSr.NoInstruction & Description1ANL A, R5This is ... Read More

Display Time in 24-Hour Format in Java

karthikeya Boyini
Updated on 27-Jun-2020 13:05:35

4K+ Views

Use the SimpleDateFormat class to display time in 24-hour format.Set the formatDate dt = new Date(); SimpleDateFormat dateFormat; dateFormat = new SimpleDateFormat("kk:mm:ss");Now, the following will display time in 24-hour formatdateFormat.format(dt)The following is an exampleExample Live Demoimport java.text.SimpleDateFormat; import java.util.Date; public class Demo {    public static void main(String[] argv) throws Exception {       Date dt = new Date();       SimpleDateFormat dateFormat;       dateFormat = new SimpleDateFormat("kk:mm:ss");       System.out.println("Time in 24 hr format = "+dateFormat.format(dt));    } }OutputTime in 24 hr format = 11:40:52

Bit Processing Group in 8051

Chandu yadav
Updated on 27-Jun-2020 13:04:59

4K+ Views

In 8051 Microcontroller there is 17 different instructions under the Logical Group. In total there are 17 opcodes. The Carry Flag (CY) acts like the single-bit accumulator in different bit processing instructions.In the following table, we will see the Mnemonics, Lengths, Execution Time in terms of the machine cycle, Number of Opcodes etc.MnemonicsByte CountExecution TimeOpcode CountCLR C111CLR bit211SETB C111SETB bit211CPL C111CPL bit211ANL C, bit221ANL C, /bit221ORL C, bit221ORL C, /bit221MOV C, bit211MOV bit, C221JC rel221JNC rel221JB bit, rel321JNB bit, rel321JBC bit, rel321ExamplesSr.No Instruction & Description1CLR CThis instruction is used to clear the carry flag to 0.2SETB 0D5HThis instruction of type SETB ... Read More

Unsigned Binary Integers

Ankith Reddy
Updated on 27-Jun-2020 13:04:39

5K+ Views

Unsigned binary integers are numbers without any ‘+’or ‘-’ sign. Here all bits representing the number will represent the magnitude part of the number only. No bits will remain reserved for sign bit representation. An unsigned binary integer is a fixed-point system with no fractional digits.Some real life Examples are −Number of tables in a class, The number of a member of a family.Obviously, they are unsigned integers like 10 and 5. These numbers have to be represented in a computer using only binary notation or using bits.Numbers are represented in a computer using a fixed size, like 4, 8, ... Read More

Feedback-Based Flow Control in Data Link Layer

Nitya Raut
Updated on 27-Jun-2020 13:03:04

2K+ Views

Flow control is a technique that allows two stations working at different speeds to communicate with each other. It is a set of measures taken to regulate the amount of data that a sender sends so that a fast sender does not overwhelm a slow receiver.In data link layer, the sender continues to send frames only after it has received acknowledgments from the user for the previous frames. This is called feedback based flow control. Here, a restriction is imposed on the number of frames the sender can send before it waits for an acknowledgment from the receiver.Feedback based Flow ... Read More

Advertisements