8085 Program to Convert BCD to Hex

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

4K+ Views

In this program we will see how to convert BCD numbers to binary equivalent.Problem StatementA BCD number is stored at location 802BH. Convert the number into its binary equivalent and store it to the memory location 802CH.DiscussionIn this problem we are taking a BCD number from the memory and converting it to its binary equivalent. At first we are cutting each nibble of the input. So if the input is 52 (0101 0010) then we can simply cut it by masking the number by 0FH and F0H. When the Higher order nibble is cut, then rotate it to the left ... Read More

FTP nb_fget Function in PHP

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

94 Views

The ftp_nb_fget() function downloads a file from the FTP server and saves it into an open file.Syntaxftp_nb_fget(con, open_file, server_file, transfer_mode, beg_pos);Parameterscon − The FTP connectionopen_file − The local data is stored here.server_file − The server file to download.transfer_mode − This is the transfer mode. The following are the possible values:- FTP_ASCII, or- FTP_BINARYbeg_pos − The position to begin the downloadingReturnThe ftp_nb_fget() function returns any of the following values −FTP_FAILED − send/receive failedFTP_FINISHED − send/receive completedFTP_MOREDATA − send/receive in progressExampleThe following is an example −Read More

Get Absolute Filename Path from Relative Filename in Java

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

330 Views

The method java.io.File.getAbsoluteFile() can be used to acquire the absolute filename path from a relative filename with path in Java. This method requires no parameters. It returns the file that is defined by the path name.A program that demonstrates this is given as follows −Example Live Demoimport java.io.File; public class Demo {    public static void main(String[] argv) throws Exception {       File file = new File("c:" + File.separator + "JavaProgram" + File.separator + "demo1.txt");       file = file.getAbsoluteFile();       System.out.println(file);    } }The output of the above program is as follows −Outputc:\JavaProgram\demo1.txtNow let us ... Read More

Display Minutes with SimpleDateFormat MM in Java

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

1K+ Views

To work with SimpleDateFormat class in Java, import the following package.import java.text.SimpleDateFormat;Now, set the format with SimpleDateFormat(“mm”) to display minutes in two-digits.Format f = new SimpleDateFormat(‘”mm”);Now, get the minutes in a string.String strMinute = f.format(new Date());The following is an example −Example Live Demoimport java.text.Format; import java.text.SimpleDateFormat; import java.util.Date; import java.util.Calendar; public class Demo { public static void main(String[] args) throws Exception { // displaying current date and time Calendar cal = Calendar.getInstance(); SimpleDateFormat simpleformat = new SimpleDateFormat("dd/MMMM/yyyy hh:mm:s"); ... Read More

8085 Program to Convert Hex to BCD

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

8K+ Views

In this program we will see how to convert binary numbers to its BCD equivalent.Problem StatementA binary number is store dat location 800H. Convert the number into its BCD equivalent and store it to the memory location 8050H.DiscussionHere we are taking a number from the memory, and initializing it as a counter. Now in each step of this counter we are incrementing the number by 1, and adjust the decimal value. By this process we are finding the BCD value of binary number or hexadecimal number.We can use INRinstruction to increment the counter in this case but this instruction will ... Read More

Integrate Android Snackbar

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

509 Views

Snackbar is just like Toast in android but it going to interact with action. It going to show the message at the bottom of the screen without any interaction with other views and close automatically after a time-out.This example demonstrates how to integrate Android Snackbar.Step 1 − Create a new project in Android Studio, go to File ⇒ New Project and fill all required details to create a new project.Step 2 − Open build.gradle and add design support library dependency.apply plugin: 'com.android.application' android {    compileSdkVersion 28    defaultConfig {       applicationId "com.example.andy.myapplication"       minSdkVersion 19 ... Read More

Make Marquee Text in Android

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

2K+ Views

This example demonstrate about how to make Marquee text in Android.Step 1 − Create a new project in Android Studio, go to File ⇒ New Project and fill all required details to create a new project.Step 2 − Add the following code to res/layout/activity_main.xml.     In the above code, we have taken text view and ellipsize property as marquee as shown below -android:ellipsize = "marquee" android:fadingEdge = "horizontal" android:marqueeRepeatLimit = "marquee_forever" android:scrollHorizontally = "true" android:singleLine = "true"Step 3 − Add the following code to src/MainActivity.javapackage com.example.andy.myapplication; import android.os.Bundle; import android.support.v7.app.AppCompatActivity; import android.widget.TextView; public class MainActivity extends AppCompatActivity ... Read More

FTP nb_fput Function in PHP

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

80 Views

The ftp_nb_fput() function uploads from an open file and saves it to a file on the FTP server.Syntaxftp_nb_fput(con, remote_file, open_file, transfer_mode, beg_pos);Parameterscon − The FTP connectionremote_file − The file to upload toopen_file − The pointer to the open filetransfer_mode − This is the transfer mode. The following are the possible values:- FTP_ASCII, or- FTP_BINARYbeg_pos − The position to begin the downloadingReturnThe ftp_nb_fput() function returns any of the following values −FTP_FAILED − send/receive failedFTP_FINISHED − send/receive completedFTP_MOREDATA − send/receive in progressExampleThe following is an example −Read More

Determine if Two Filename Paths Refer to the Same File in Java

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

1K+ Views

The method java.io.File.equals() is used to find if the two file names refer to the same File in Java. This method requires a single parameter i.e.the file object that is to be compared to the other file object. It returns if the file objects are same and false otherwise.A program that demonstrates this is given as follows −Example Live Demoimport java.io.File; public class Demo {    public static void main(String[] args) {       try {          File file1 = new File("demo1.txt");          File file2 = new File("demo2.txt");          boolean flag ... Read More

Display Complete Date and Time Information Using Formatter in Java

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

140 Views

Firstly, create a Formatter and Calendar object.Formatter f = new Formatter(); Calendar cal = Calendar.getInstance();Now display the current date and time. We have shown the date here in both lowercase and uppercase −f = new Formatter(); System.out.println(f.format("Date and Time (lowercase): %tc", cal)); f = new Formatter(); System.out.println(f.format("Date and Time (uppercase): %Tc", cal));The following is an example −Example Live Demoimport java.util.Calendar; import java.util.Formatter; public class Demo { public static void main(String args[]) { Formatter f = new Formatter(); Calendar cal = Calendar.getInstance(); ... Read More

Advertisements