Divide 16-bit Number by 8-bit Number in 8086

Chandu yadav
Updated on 30-Jul-2019 22:30:25

13K+ Views

In this program we will see how to divide 16-bit number by an 8-bit number.Problem StatementWrite 8086 Assembly language program to divide 16-bit number stored in memory location offset 501. Divide it with 8-bit number stored in 500H. Also store result at memory offset 600.Discussiont8086 has DIV instruction to perform division. Take the 8-bit number into BL, and 16-bit number into AX. Now divide AX by BL. The result will be stored at AX.We are taking two numbers 24CF / 2D = D1InputAddressData……5002D501CF50224…… Flow Diagram Program OutputAddressData……600D1……

Use Time with Local Time in Android SQLite

Smita Kapse
Updated on 30-Jul-2019 22:30:25

380 Views

Before getting into example, we should know what sqlite data base in android is. SQLite is an open source SQL database that stores data to a text file on a device. Android comes in with built in SQLite database implementation. SQLite supports all the relational database features. In order to access this database, you don't need to establish any kind of connections for it like JDBC, ODBC etc.This example demonstrate about How to use time() with local time in Android sqliteStep 1 − Create a new project in Android Studio, go to File ⇒ New Project and fill all required ... Read More

Create a Common Error Page Using JSP

Arjun Thakur
Updated on 30-Jul-2019 22:30:25

2K+ Views

JSP gives you an option to specify Error Page for each JSP using page attribute. Whenever the page throws an exception, the JSP container automatically invokes the error page.Following is an example to specifiy an error page for a main.jsp. To set up an error page, use the directive.           Error Handling Example               We will now write one Error Handling JSP ShowError.jsp, which is given below. Notice that the error-handling page includes the directive . This directive causes the JSP compiler ... Read More

Insert Timestamp Value in a Database Using JDBC

Nancy Den
Updated on 30-Jul-2019 22:30:25

4K+ Views

Timestamp datatype in SQL is similar to Date (in SQL) both store day:month:year:hour:minute:second. In addition to this timestamp stores fractional seconds too.Inserting Timestamp in to a databaseThe PreparedStatement interface provides a method named setTimestamp() this method accepts two parameters an integer variable representing the parameter index of the place holder at which you need to store the timestamp and a long variable representing the number of milliseconds from the epoch time(standard base time I.e. January 1, 1970, 00:00:00 GMT) to the required time.ExampleAssume we have a table in the database named dispatches with the following description −+------------------+--------------+------+-----+-------------------+ | Field   ... Read More

LabelValue Class in Java Tuples

Chandu yadav
Updated on 30-Jul-2019 22:30:25

181 Views

A LabelValue class is a Tuple of 2 elements with label as the first position, whereas value as the second. It is in the JavaTuples library. The LabelValue Tuple class is Typesafe, Immutable, Iterable, Serializable, etc.The following is the declaration of the LabelValue class;public final class LabelValue extends Tuple implements IValueLabel, IValueValueLet us first see what we need to work with JavaTuples. To work with LabelValue class in JavaTuples, you need to import the following packageimport org.javatuples.LabelValue;Note: Download JavaTuples Jar library to run JavaTuples program. If you are using Eclipse IDE, then Right Click Project -> Properties -> Java Build Path ... Read More

Period Parse Method in Java

Krantik Chavan
Updated on 30-Jul-2019 22:30:25

554 Views

The Period instance can be obtained from a string value using the parse() method in the Period class in Java. This method requires a single parameter i.e. the string which is to be parsed. This string cannot be null. Also, it returns the Period instance obtained from the string value that was passed as a parameter.A program that demonstrates this is given as follows:Example Live Demoimport java.time.Period; public class Demo {    public static void main(String[] args) {       String period = "P5Y7M15D";       Period p = Period.parse(period);       System.out.println("The Period is: " + p); ... Read More

Convert PHP Variable to MySQL Time Format

Samual Sam
Updated on 30-Jul-2019 22:30:25

336 Views

Use DateTime to convert PHP variable “11:00 AM: to MySQL time format.The PHP code is as follows −$phpTime = '11:00 AM'; echo('The PHP Time Format is ='); echo ($phpTime); $timeFormat = DateTime::createFromFormat( 'H:i A', $phpTime); $MySQLTimeFormat = $timeFormat->format( 'H:i:s'); echo (' '); echo('The MySQL Time Format is ='); echo ($MySQLTimeFormat);The snapshot of PHP code is as follows −Here is the output −The PHP Time Format is =11:00 AM The MySQL Time Format is =11:00:00

The add Method of Java AbstractSequentialList Class

Nancy Den
Updated on 30-Jul-2019 22:30:25

122 Views

The AbstractSequentialList class has the add(int index, E ele) method to add element to the specific position. You can also use the add() method inherited from AbstractList class.add(int index, E ele) methodThe syntax is as follows:add(int index, E ele)Here, index is where the element is to be inserted. The ele is the element to be inserted.To work with the AbstractSequentialList class in Java, you need to import the following package:import java.util.AbstractSequentialList;The following is an example to implement AbstractSequentialList add() method in Java:Example Live Demoimport java.util.LinkedList; import java.util.AbstractSequentialList; public class Demo {    public static void main(String[] args) {       ... Read More

Find All Documents with a Field that is NaN in MongoDB

Chandu yadav
Updated on 30-Jul-2019 22:30:25

1K+ Views

To find all documents with a field that is NAN in MongoDB, use the following syntaxdb.yourCollectionName.find( { yourFieldName: NaN })Let us first create a collection with documents> db.nanDemo.insertOne({"Score":0/0}); {    "acknowledged" : true,    "insertedId" : ObjectId("5ca251a26304881c5ce84b8a") } > db.nanDemo.insertOne({"Score":10/5}); {    "acknowledged" : true,    "insertedId" : ObjectId("5ca2520e6304881c5ce84b8b") } > db.nanDemo.insertOne({"Score":20/0}); {    "acknowledged" : true,    "insertedId" : ObjectId("5ca252156304881c5ce84b8c") } > db.nanDemo.insertOne({"Score":0/20}); {    "acknowledged" : true,    "insertedId" : ObjectId("5ca2521e6304881c5ce84b8d") }Following is the query to display all documents from a collection with the help of find() method> db.nanDemo.find().pretty();This will produce the following output{ "_id" : ObjectId("5ca251a26304881c5ce84b8a"), "Score" ... Read More

Test if a List is an Unmodifiable List in Java

Samual Sam
Updated on 30-Jul-2019 22:30:25

1K+ Views

We will first set a list to unmodifiable and after that test if it is unmodifiable or not. Let us create a List and add elements −List list = new LinkedList (); list.add(10); list.add(20); list.add(30); list.add(40); list.add(50);Set the above list to unmodifiable −Listunmodifiable = Collections.unmodifiableList(list);Now, use If-else, to check whether the list in unmodifiable or not −if (unmodifiable.getClass().getName().contains("UnmodifiableList"))    System.out.println("This is an UnmodifiableList" ); else    System.out.println("This is not an UnmodifiableList" );Example Live Demoimport java.util.Collections; import java.util.LinkedList; import java.util.List; public class Demo {    public static void main(String[] args) {       Listlist = new LinkedList();     ... Read More

Advertisements