In this program we will see how to find the smallest of two numbers.Problem StatementWrite 8085 Assembly language program to find the smallest number of two 8-bit number stored at location 8000H and 8001H.DiscussionThis checking is done by using the CMP instruction. This instruction is very similar to the SUB instruction. The only difference is that it does not update the value of Accumulator after executing. So after comparing, if the CY flag is set, it means that the first number is smaller, and the second one is largerInputFirst inputAddressData......8000FD800123......second inputAddressData......800059800175......Flow DiagramProgramAddressHEX CodesLabelMnemonicsCommentsF00021, 00, 80LXI H, 8000HPoint to the first ... Read More
To use MBProgressHUD in swift we first need to create a podfile if it does not exist already.Go to terminal and change directory to your project directory then initialize pod and later install MBProgressHUD.cd /projectDirectory pod init open podfileThen in the podfile add the following line and go back to the terminal and run the below command in the same directory.pod 'MBProgressHUD', '~> 1.1.0' pod installOnce you run these commands MBProgressHUD will be installed to your project, now you can import this library in ViewController where ever you want to use, or you may create an extension of UIView controller ... Read More
Python is one of the preferred languages among coders for most of the competitive programming challenges. Most of the problems are easily computed in a reasonable time frame using python.For some of the complex problem, writing fast-enough python code is often a challenge. Below are some of the pythonic code constructs that help to improve the performance of your code in competitive coding −1. Strings concatenation: Do not use the below construct.str1 = "" some_list = ["Welcome ", "To ", "Tutorialspoint "] for x in some_list: str1 += x print(str1)Above method gives huge time overhead.Instead, try to use this ... Read More
Let us consider we want to add two decimal numbers 38 and 45. They will be represented in BCD as 0011 1000 and 0100 0101. The addition results in 0111 1101. But the answer will be incorrect if we want to interpret this result as a BCD number. The result will be not only incorrect but also illegal as 1101, which we obtained as the last nibble in the answer is not a valid BCD number. Here, in such situations, we can use DAA to have the BCD sum as outcome. All that is required to be done is to ... Read More
No one can deny the value of English in the current era where it becomes difficult to survive without the knowledge of this precious language. Moreover, you receive a fine bouquet of respect and honor by folks around you if you are a good orator of this language. Knowing English also gives you a great social status and adds value to your personality.Therefore, it becomes imperative to speak in English. But how? Because, for some, it’s extremely difficult to utter even a few words in English when asked. They literally start trembling. But what? Speaking in English is must as ... Read More
You can select the row with highest ID in MySQL with the help of ORDER BY with LIMIT OFFSETThe syntax is as follows −select *from yourTableName order by yourColumnName desc limit 1 offset 0;To understand the above syntax, let us create a table. The query to create a table is as follows −mysql> create table HighestIdOrderBy −> ( −> EmployeeId int, −> EmployeeName varchar(200) −> ); Query OK, 0 rows affected (0.58 sec)Insert records in the table with the help of insert command. The query is as follows −mysql> insert into HighestIdOrderBy values(200, 'David'); Query OK, ... Read More
To get floor key means to return the greatest key less than or equal to the given key, or null if there is no such key. This can be done with the floorKey() metho.The following is an example to get floor key from NavigableMapExample Live Demoimport java.util.*; public class Demo { public static void main(String[] args) { NavigableMap n = new TreeMap(); n.put("A", 498); n.put("B", 389); n.put("C", 868); ... Read More
Format specifier for Hash Code us %h.Firstly, create a new object for Formatter and Calendar −Formatter f = new Formatter(); Calendar c = Calendar.getInstance();For hash code −f.format("%h", c)The following is an example that finds the hash code −Example Live Demoimport java.util.Calendar; import java.util.Formatter; public class Demo { public static void main(String args[]) { Formatter f = new Formatter(); Calendar c = Calendar.getInstance(); System.out.println("Hash Code: "+f.format("%h", c)); } }OutputHash Code: 4b899958
The UNESCO Heritage site of Ajanta caves is located in Aurangabad, Maharashtra. These caves were excavated as a part of the first wave of cave architecture in India. It became an important center for Buddhist religion and art under the enlightened patronage of the Vakataka rulers. However, it is important to note that the excavations of these caves happened in different phases in different time periods beginning in the 2nd Century.The aerial view of the site looks like a horseshoe. This site was abandoned during the 6th-7th centuries and was rediscovered only during the British period by an Army officer ... Read More
Update only one cell’s data with the help of UPDATE command. The syntax is as follows −UPDATE yourTableName yourColumnName=yourNewValue where yourColumnName=yourOldValue;To understand the above concept, let us first create a table. The query to create a table is as follows −mysql> create table changeCellsData -> ( -> Id int, -> Name varchar(100), -> Age int -> ); Query OK, 0 rows affected (0.81 sec)Insert some records in the table using insert command. The query is as follows −mysql> insert into changeCellsData values(101, 'Mike', 23); Query OK, 1 row affected (0.12 sec) mysql> insert into ... Read More