guys good day!!

i need ure help with this problem.
we are going to make a program.

1. Store first memory location og program into base register (for memory protection).
2. Set program counter (it keeps track of memory space used by the program) equal to address of first memory location.
3. Read first instruction of program.
4. Increment program counter by number of bytes in instruction.
5. Has the last instruction been reached?
if yes, then stop loading program
if no,then continue with step 6
6. Is program counter greater than memory size?
if yes, then stop Loading program
if no, then continue with step 7
7. Load instruction in memory
8. Read next instruction of program.
9. Go to step 4.


I hoping that you can help me guys.

actually im not really good in java, im hoping for a good response you guys.

Recommended Answers

All 6 Replies

Sure we can. Post your code and a specific question and we'll be happy to help you correct/improve/complete your code.

Sure we can. Post your code and a specific question and we'll be happy to help you correct/improve/complete your code.

this is my code but i cant continue.
Pls let me know if the code is correct.
hope you can help me

import javax.swing.*;
import java.util.*;
public class MemoryLocation

{

	static final String D = "";
	static final String C = "";
	static final String E = "";

	static Scanner console = new Scanner (System.in);
	public static void main (String [] eL_wRay)

	{

	String aString;
	int ProgCounter = 0;

	aString = JOptionPane.showInputDialog("Enter the Memory Location : ");
	//aString = console.next();

	System.out.println("\nThe Memory Location is in the Data : " + aString);

	System.out.println("\nIncrementing the Program Counter : ");

	while (ProgCounter <= 20)

		{

			System.out.print(ProgCounter + " ");
			ProgCounter ++;

		}

	System.out.println("\n");
	/*if (aString == aString)

		{

			System.out.println("Program had been reached !!!");
			System.out.println("\n\nShut Downing .....\n");

		}

	else

		{

		}

	System.out.println("\nLoading Instructions in the Memory .....\n");*/

	}

}

Seeing as how it deosn't do anything, sure, it's fine. This assignment is also not an extreme.beginner assignment (as the code provided implies you are), so either you should simply pack up the course as you lied about your qualifications, or you've been getting all of your sleep in class.

Really, there is nothing there to even start with, and we are not here to do your code for you.

Seeing as how it deosn't do anything, sure, it's fine. This assignment is also not an extreme.beginner assignment (as the code provided implies you are), so either you should simply pack up the course as you lied about your qualifications, or you've been getting all of your sleep in class.

Really, there is nothing there to even start with, and we are not here to do your code for you.

OK thanks for your advice. i will try my best to learn this programming.
Im not really good at it. I accept your point of view. But im not lying, and im not getting sleep in class.

Seeing as how it deosn't do anything, sure, it's fine. This assignment is also not an extreme.beginner assignment (as the code provided implies you are), so either you should simply pack up the course as you lied about your qualifications, or you've been getting all of your sleep in class.

Really, there is nothing there to even start with, and we are not here to do your code for you.

import javax.swing.*;
import java.util.*;
public class MemoryLocation

{

    static final String D = "";
    static final String C = "";
    static final String E = "";

    static Scanner console = new Scanner (System.in);
    public static void main (String [] eL_wRay)

    {

    String aString;
    int ProgCounter = 0;

    aString = JOptionPane.showInputDialog("Enter the Memory Location : ");
    //aString = console.next();

    System.out.println("\nThe Memory Location is in the Data : " + aString);

    System.out.println("\nIncrementing the Program Counter : ");

    while (ProgCounter <= 20)

        {

            System.out.print(ProgCounter + " ");
            ProgCounter ++;

        }

    System.out.println("\n");
    if (aString == aString)

        {

            System.out.println("Program had been reached !!!");
            System.out.println("\n\nShut Downing .....\n");

        }

    else

        {

        }

    System.out.println("\nLoading Instructions in the Memory .....\n");

    }

}

Seeing as how it deosn't do anything, sure, it's fine. This assignment is also not an extreme.beginner assignment (as the code provided implies you are), so either you should simply pack up the course as you lied about your qualifications, or you've been getting all of your sleep in class.

Really, there is nothing there to even start with, and we are not here to do your code for you.

i have now the idea.

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.