Subtract Two 8-Bit Numbers with or without Borrow in 8085

Vrundesha Joshi
Updated on 30-Jul-2019 22:30:24

2K+ Views

In this program we will see how to subtract two 8-bit numbers using 8085 microprocessor.Problem StatementWrite 8085 Assembly language program to subtract two 8-bit numbers with or without borrow and store the result at locations 8050H and 8051H.DiscussionIn 8085, the SUB instruction is used 2’s complemented method for subtraction. When the first operand is larger, the result will be positive. It will not enable the carry flag after completing the subtraction. When the result is negative, then the result will be in 2’s complemented form and carry flag will be enabled.We are using two numbers at location 8000H and 8001H. ... Read More

Swap Two 16-Bit Numbers Using Direct Addressing Mode in 8085

Anvi Jain
Updated on 30-Jul-2019 22:30:24

1K+ Views

In this program we will see how to swap two 16-bit numbers in direct addressing mode.Problem StatementWrite 8085 Assembly language program to swap two 16-bit number stored at location 8000H – 8001H and 8002H – 8003H using direct addressing mode.DiscussionHere we are swapping the values using XCHG instruction. This instruction swaps the contents of DE and HL pair contents. We are taking the first number into DE register pair, then the second number into HL pair, then by XCHG we are swapping them.InputAddressData......8000CD8001AB800234800312......Flow DiagramProgramAddressHEX CodesMnemonicsCommentsF0002A, 00, 80LHLD 8000HLoad the first number into HLF003EBXCHGExchange DE and HLF0042A, 02, 80LHLD 8002HLoad the ... Read More

Space Format Specifiers in Java

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

2K+ Views

For format specifier, import the following package −import java.util.Formatter;Create a formatter object and set space format specifier −Formatter f = new Formatter(); f.format("% d", -50); System.out.println(f); f = new Formatter(); f.format("% d", 90); System.out.println(f); f = new Formatter(); f.format("%10d", -50); System.out.println(f); f = new Formatter(); f.format("% 10d", 90); System.out.println(f);The following is an example displaying different forms of space format specifiers −Example Live Demoimport java.util.Formatter; public class Demo { public static void main(String args[]) { Formatter f = new Formatter(); f.format("% d", -50); ... Read More

What is Ambush Marketing and Why is it Known as Surprise Attack

Knowledge base
Updated on 30-Jul-2019 22:30:24

309 Views

Ambush, as the name implies, is a surprise marketing. The term Ambush marketing was coined by Jerry Welsh, a marketing strategist. Ambush marketing is a type of marketing where the marketer associates the product with an event or property and the marketer is not directly or officially related to that event. This is a type of Guerilla marketing.To be more precise, we often happen to watch some advertisements which refer to some events or personalities indirectly without mentioning them officially. Such advertisements have a lot of impact on unknowingly.Grab the OpportunityThis kind of advertising is done by utilizing the opportunities ... Read More

Create Scrollable TextView on iOS App

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

2K+ Views

To create a scrollable TextView in iOS we can do it in two ways, one by creating it using the storyboard and other by creating another textView programmatically.A text view is scrollable by default if it has text more than the height of textView and the scrollable property is disabled.1.Using storyboardGo to storyboard and from the object library drag a textView to your view.Now in the text view if the text is more than it’s height than it will be scrollable by default, otherwise it will not be scrollable.Give height constraint along with remaining required constraint.Make sure that scrolling enabled ... Read More

Using Single Quotes Around Database and Table Name in MySQL

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

660 Views

You need to use backticks around table name as well as database name. The syntax is as follows:UPDATE `yourDatabaseName`.`yourTableName` SET yourColumnName1=yourColumnName1+1 WHERE yourColumnName2=’yourValue’;To understand the above syntax, let us create a table. The query to create a table is as follows:mysql> use test; Database changed mysql> create table Add1Demo    -> (    -> Id varchar(10),    -> Value int    -> ); Query OK, 0 rows affected (1.19 sec)Insert some records in the table using insert command. The query is as follows:mysql> insert into Add1Demo values('1', 780); Query OK, 1 row affected (0.17 sec) mysql> insert into Add1Demo values('2', ... Read More

SQL Command to Return Field Names of a Table

Vrundesha Joshi
Updated on 30-Jul-2019 22:30:24

174 Views

To return the field names of a table, you can use desc command. The syntax is as follows −desc yourTableName;Or you can use column_name field from information_schema.columns table. The syntax is as follows −select column_name from information_schema.columns where table_name = ’yourTableName’;To understand both the syntax, let’s say we have a table ‘ExtractCommentDemo1’.Using the first syntax −mysql> desc ExtractCommentDemo1;The following is the output displaying the fields −+----------+--------------+------+-----+---------+-------+ | Field    | Type         | Null | Key | Default | Extra | +----------+--------------+------+-----+---------+-------+ | UserId   | int(11)      | YES  |     | NULL ... Read More

Access and Exchange Content of Flag Register with Register B in 8085

Jennifer Nicholas
Updated on 30-Jul-2019 22:30:24

977 Views

In this program we will see how to exchange the content of Flat register with register B.Problem StatementWrite 8085 Assembly language program to swap the content of flag register and the register B.DiscussionAs we cannot access the flag register content directly, we have to take the help of stack. By using stack, we can push the content of PSW (Accumulator and Flag). Then we can get it back and store into some other registers. Similarly, from other register, we have to push them into stack, then pop it to PSW.Here if we want to exchange the value of B and ... Read More

Create Multiple Styles Inside a TextView on iOS App

karthikeya Boyini
Updated on 30-Jul-2019 22:30:24

452 Views

To create multiple styles inside a textview we need to use attributed string. The text view in ios has a property attributedText which can be used to style the text inside a text view. We’ll see this with help of an example.First, we’ll create an attributelet attributeOne : [NSAttributedString.Key : Any] = [NSAttributedString.Key(rawValue: NSAttributedString.Key.font.rawValue) : UIFont.systemFont(ofSize: 16.0), NSAttributedString.Key(rawValue: NSAttributedString.Key.foregroundColor.rawValue) : UIColor.blue]Then we’ll create an attributed string with the attribute we createdlet string = NSAttributedString(string: "Text for first Attribute", attributes: attributeOne)Similarly, we’ll create another string with different attribute. Then we’ll initialize the text of textView with the attributed string.Now the whole ... Read More

Differences Between Flatten and Ravel in NumPy

karthikeya Boyini
Updated on 30-Jul-2019 22:30:24

341 Views

There are numerous ways to create a numpy array. Numpy provides two different kinds of ways to convert a ndarray to 1Darray: that is using the flatten() method and the other using the ravel() method.Example#Import required library, numpy import numpy as np #create an array from a list arr = np.array( [ (2, 7, 3, 4), (5, 6, 9, 1)]) #flatten_output print(arr.flatten()) #ravel_output print(arr.ravel())Output[2 7 3 4 5 6 9 1] [2 7 3 4 5 6 9 1]Now above we can see that both functions return the same list, so the question arises, why two methods for the same ... Read More

Advertisements