Prime finder - assembly program, Assembly Language

Prime Finder - assembly program:

Problem:  Prime Finder
In this problem you will write a small program that tests whether a given integer is a prime number or not.  Let's call the number we are testing A and let's assume that it starts in R0 - at the end of your program R1 should contain 1 if the number is prime and 0 if it is not.
Here is the pseudo-code for the procedure
If (A <= 1) {
B = 2;
PRIME_FLAG = 1;  // we assume that the number is prime until we prove otherwise
While (B*B <= A) {
  If (A % B == 0) { // check if A is divisible by B
    PRIME_FLAG = 0;
B = B+1
You should think about why this code works.
For this part you should turn in two files: prime.asm and prime_script.txt

Posted Date: 2/11/2013 2:51:31 AM | Location : United States

Related Discussions:- Prime finder - assembly program, Assignment Help, Ask Question on Prime finder - assembly program, Get Answer, Expert's Help, Prime finder - assembly program Discussions

Write discussion on Prime finder - assembly program
Your posts are moderated
Related Questions
bello need help with a final project , I have to do a presentation on a digital stop watch , but I have to use edsim51 to make it wondering if you guys can help me

Control Transfer or Branching Instruction Control transfer instructions transfer the flow of execution of the program to a new address specified in the instruction indirectly o

Port Mapped I/O or I/O Mapped I/O I/O devices are mapped into a separate address space. This is generally accomplished by having a different set of signal lines to denote a mem

Will be needing help with assembly language assignments over the course of 4 weeks

The definitions of the bits in ICWI are following: Always set to the value 1. It directs the received byte to ICWI as oppose to OCW2 or OCW3. Which also utilize the even addr

Ask question #MinimuWHAT ARE CONSTANTS AND WHAT DO THEY DO?m 100 words accepted#

segmentation and overlapping in assemble language

PTR : Pointer:- The pointer operator which is used to declare the type of a variable, label or memory operand. The operator PTR is prefixed by either WORD or BYTE. If the prefi

implement the following c++ code in assembly language using the block-structured .IF and .while directives

hey ,, I need to know how to let a symbol moves with mouse ??