In this program we will see how to reverse an 8-bit number using 8-bit operation.Problem StatementWrite 8086 Assembly language program to reverse an 8-bit number which is stored at location 2000, using 8-bit operations.Discussion8086 has 8-bit operation for rotation. we are taking the byte from 2000. Then rotate that byte with ROL instruction. After that put the number into memory in reverse form.InputAddressData……2000AB…… Flow Diagram ProgramOutputAddressData……2000BA……
A static block is a set of statements, which will be executed by the JVM before the execution of the main() method. At the time of class loading if we want to perform any activity we have to define that activity inside a static block because this block executes at the time of class loading.Throw an exception from a Static BlockA static block can throw only a RunTimeException, or there should be a try and catch block to catch a checked exception.A static block occurs when a class is loaded by a class loader. The code can either come in the form ... Read More
Use BETWEEN and INTERVAL to achieve this. Let us first create a table −mysql> create table DemoTable -> ( -> AdmissionDate date -> ); Query OK, 0 rows affected (0.84 sec)Insert some records in the table using insert command −mysql> insert into DemoTable values('2019-09-30'); Query OK, 1 row affected (0.19 sec) mysql> insert into DemoTable values('2019-10-01'); Query OK, 1 row affected (0.13 sec) mysql> insert into DemoTable values('2019-03-30'); Query OK, 1 row affected (0.21 sec) mysql> insert into DemoTable values('2019-04-24'); Query OK, 1 row affected (0.17 sec)Display all records from the table using select ... Read More
The HTML DOM Input Datetime form property returns the reference of enclosing form for input datetime.SyntaxFollowing is the syntax −Returning reference to the form objectinputDatetimeObject.formExampleLet us see an example of Input Datetime form property − Live Demo Input Datetime form Date & Time: Get Form ID function getFormID() { var inputDatetime = document.getElementById("Datetime"); var divDisplay = document.getElementById("divDisplay"); divDisplay.textContent = 'Form ID for datetime input: '+inputDatetime.form.id; } OutputThis will produce the following output −Before clicking ‘Get Form ID’ button −After checking ‘Get Form ID’ button −
User can turn on or turn off mobile data from settings of an iOS device, but it’s practically not possible to disable or enable the same programmatically. It is only possible if you jailbroke an iOS device.. Apple does not allow any apps developer to access wifi or Bluetooth.There are some private API’s which may aid this but eventually result in app rejection from the app store.
You can use ORDER BY clause or aggregate function MAX() to select the maximum value.Using ORDER BYFollowing is the syntax −select yourColumnName from yourTableName order by yourColumnName desc limit 0, 1;Let us first create a table −mysql> create table DemoTable ( Number int ); Query OK, 0 rows affected (0.52 sec)Insert records in the table using insert command −mysql> insert into DemoTable values(790); Query OK, 1 row affected (0.15 sec) mysql> insert into DemoTable values(746); Query OK, 1 row affected (0.18 sec) mysql> insert into DemoTable values(480); Query OK, 1 row affected (0.15 sec) mysql> insert into ... Read More
Let us first create a table −mysql> create table DemoTable ( ProductId int NOT NULL AUTO_INCREMENT PRIMARY KEY, ProductQuantity int, ProductPrice int ); Query OK, 0 rows affected (0.19 sec)Insert some records in the table using insert command −mysql> insert into DemoTable(ProductQuantity, ProductPrice) values(10, 100); Query OK, 1 row affected (0.06 sec) mysql> insert into DemoTable(ProductQuantity, ProductPrice) values(5, 11); Query OK, 1 row affected (0.04 sec) mysql> insert into DemoTable(ProductQuantity, ProductPrice) values(3, 140); Query OK, 1 row affected (0.05 sec) mysql> insert into DemoTable(ProductQuantity, ProductPrice) values(2, 450); Query OK, 1 row affected ... Read More
Box is lightweight container that uses a BoxLayout object as its layout manager. To display components from left to right, use Box createHorizontalBox() method.Let us first create some button components −JButton button1 = new JButton("One"); JButton button2 = new JButton("Two"); JButton button3 = new JButton("Three"); JButton button4 = new JButton("Four"); JButton button5 = new JButton("Five"); JButton button6 = new JButton("Six");Now, crate a Box and align all the buttons from left to right −Box box = Box.createHorizontalBox(); box.add(button1); box.add(button2); box.add(button3); box.add(button4); box.add(button5); box.add(button6);The following is an example to create a Box to display components from left to right −Examplepackage my; import ... Read More
Here we will see how to find the bit differences of two binary patterns using 8085.Problem StatementTwo binary patterns are stored in locations 8030H and 8031H. Load them in registers A and B. Find out the bit positions where bits are differing and put these location numbers at locations starting from 8050H on words. (Bits are differing at those locations where 0 in A and 1 in B)DiscussionTo solve this problem, we are taking the numbers into A and B. Then initialize the C as counter with 08H, and the register L will keep tract the bit position, where A ... Read More
Hiding an e-mail addressThe following steps are to be followed to hide our e-mail from unauthorized users. In every email address '@' symbol is common so try to remove it from the email address using split() method. In the following example after splitting the email(batman@gmail.com) we get the result as batman, gmail.com.Divide the result in to 2 parts(split1 and split2). Using substring() method remove some of string from split1 and join resulted part with split2 using '...@'. Return the joined part as the final output. In our example the resulted output is "bat...@gmail.com".ExampleLive Demo newEmail = function (email) { ... Read More