1 answer

X86 intel assembly language instruction should be used. 3. What this pseudo-code does? And convert it into Assembly. prime( 1):#2:

Question:

3. What this pseudo-code does? And convert it into Assembly. prime( 1):#2: prime[2] :#3: {first prime number} {second prime n

x86 intel assembly language instruction should be used.

3. What this pseudo-code does? And convert it into Assembly. prime( 1):#2: prime[2] :#3: {first prime number} {second prime number) candidate-5 (first candidate for a new prime number) while primeCount

Answers

the given pseudo code is used to calculate the prime numbers upto 100

Use the following code to calculate the prime numbers between 0 to 100


include 'emu8086.inc'

org 100h

jmp CodeStart

DataStart:
max dw 100
space db " ", 0
primecount db 0

CodeStart:
mov bx, 2

LoopStart:
          
   call IsPrime
   cmp dx, 0

   je Equal
         
   mov ax, bx
   inc primecount
     

     
   Equal:   
   add bx, 1
   cmp bx, max

jle LoopStart

  
ret

IsPrime PROC

   mov ax, bx     
   mov dx, 0
   mov cx, 2
   div cx
   mov si, ax
   mov dx, 1
   mov cx, 2
     
   PrimeLoop:

       cmp cx, si
       ja StopLabel

       mov ax, bx
       mov dx, 0          
       div cx

       cmp dx, 0
je StopLabel
  
       add cx, 1
  
   jmp PrimeLoop
  
  
     
   StopLabel:      
     
   ret   

IsPrime ENDP


DEFINE_PRINT_STRING
DEFINE_SCAN_NUM
DEFINE_PRINT_NUM
DEFINE_PRINT_NUM_UNS

After executing the code

run the code and then

click on vars

emulator: mycode.com file math debug view external virtual devices virtual drive help Load reloadstep back single step step d

E variables size: byteements: 1 show as: signed 100 MAR SPACE20h PRIMECOUNT 25

.

Similar Solved Questions

1 answer
Use the following to answer questions 12 – 15 Transaction Cash involved? (Yes or No) Type...
Use the following to answer questions 12 – 15 Transaction Cash involved? (Yes or No) Type of CASH FLOW Operating, Investing, Financing, or None Use the first letter (O, I, F, N) 12. Issue common stock Purchased building and land 13. 14. Provide services to customers on account 15. Paid utiliti...
1 answer
What is the business perspective for inclusion of diversity management in a health care environment? How...
What is the business perspective for inclusion of diversity management in a health care environment? How has diversity management been addressed in your organization...
1 answer
3 A tilting level was checked by the two-peg test method and the following staff readings...
3 A tilting level was checked by the two-peg test method and the following staff readings were obtained: Staff position Peg X Peg Y Peg Y Peg X Staff reading 0.975 1.235 1.480 1.300 Distance to staff (m) 40 40 Instrument position Mid-way between peg X and peg Y Over peg X Calculate the amount of ins...
1 answer
Hawke Skateboards is considering building a new plant. Bob Skerritt, the company’s marketing manager, is an...
Hawke Skateboards is considering building a new plant. Bob Skerritt, the company’s marketing manager, is an enthusiastic supporter of the new plant. Lucy Liu, the company’s chief financial officer, is not so sure that the plant is a good idea. Currently, the company purchases its skatebo...
1 answer
2. Consider the global market of oil, which has become quite competitive, so you can rely...
2. Consider the global market of oil, which has become quite competitive, so you can rely on the supply and demand graph . A group of oil producing countries (OPEC) would like to impose a price floor, to prevent the price from reaching a low equilibrium level. Show graphically the effect of a succes...
1 answer
Reserve Problems Chapter 12 Section 1 Problem 1 During a research, the amount of Internet users...
Reserve Problems Chapter 12 Section 1 Problem 1 During a research, the amount of Internet users was measured. Each time three random groups of 10,000 people of the average age of 20, 40, and 60 were considered. The data are as follows (x1 - the number of years since the beginning of the research, x2...
1 answer
I need some help on this question for my stats homework, any help is appreciated! Thank...
I need some help on this question for my stats homework, any help is appreciated! Thank you! Question: For 3 and 4, find the sample size needed to give the desired margin of error in estimating a population proportion with the indicated level of confidence. 3. A margin of error within plus or minus...
1 answer
4. Show that when x € (-1,1), HRE = (-1)"za" and aretan(x) = {2+1,+ Also, find...
4. Show that when x € (-1,1), HRE = (-1)"za" and aretan(x) = {2+1,+ Also, find the value of the series 1-3+37 and justify your answer....
1 answer
How do you solve #(2 (tan^2)x - 1)((tan^2)x +1) = 0#?
How do you solve #(2 (tan^2)x - 1)((tan^2)x +1) = 0#?...
1 answer
White Mountain Food stock is expected to pay a dividend of 3.18 dollars in 1 year...
White Mountain Food stock is expected to pay a dividend of 3.18 dollars in 1 year and a dividend of 2.1 dollars in 2 years. The stock is expected to be priced at 121.64 dollars in 1 year and at 132.68 dollars in 2 years. What is the current price of White Mountain Food stock? The stock’s divid...
1 answer
Consider the discrete data in the table below. ​a) Construct a frequency distribution. ​b) Construct a...
Consider the discrete data in the table below. ​a) Construct a frequency distribution. ​b) Construct a relative frequency distribution. ​c) Construct a cumulative relative frequency distribution. 11 44 44 11 44 11 33 22 55 11 22 22 44 22 ...
1 answer
JAVASCRIPT Write a GUI application that has three labels, two text fields, and two buttons (with...
JAVASCRIPT Write a GUI application that has three labels, two text fields, and two buttons (with the titles Name and Age). When the program starts the user will enter his/her first name in the first text field and his age in the second text field. When the user clicks the Name button, the first ...
1 answer
Problem 7-58 (Algo) Tracing Costs in a Job Company (LO 7-2, 3) The following transactions occurred...
Problem 7-58 (Algo) Tracing Costs in a Job Company (LO 7-2, 3) The following transactions occurred in January at Apex Manufacturing, a custom parts supplier. Apex uses job costing. 1. Purchased $55,600 in materials on account. 2. Issued $3,400 in supplies from the materials inventory to the producti...
1 answer
A hot piece of aluminum weighing 50.0 grams at 350°C is dropped into 500. grams of...
A hot piece of aluminum weighing 50.0 grams at 350°C is dropped into 500. grams of water at 22.0°C. What is the final temperature of the water? The specific heat of aluminum is 0.902 J/g°C and that of water is 4.184 J/g°C....
1 answer
Classic Uniforms produces uniforms. The company allocates manufacturing overmead based on the machine hours each job...
Classic Uniforms produces uniforms. The company allocates manufacturing overmead based on the machine hours each job uses. Classic Uniforms reports the following cost data for the past year 囲(Click the icon to view the cost data.) Read the recuiremants. Requirements Requirement 1. Compute the...
1 answer
For question 3 use this format %Example Function Calls newton2(@sin,1) newton2(@(x) x.^2 - 4, 1) ...
For question 3 use this format %Example Function Calls newton2(@sin,1) newton2(@(x) x.^2 - 4, 1) The code to call the function is %Example Function Calls newton3(@sin,1,6) newton3(@(x) x.^2 - 4, 1,4) Please type answers We were unable to transcribe this image3. Using a for loop, create a function th...
1 answer
Question.2 Next will be specifications of HDD disk drive and SSD disk drive. Calculate how much...
Question.2 Next will be specifications of HDD disk drive and SSD disk drive. Calculate how much it costs to store 6 TB of data for 4 years? Assume that both the HDD and SSD are active 25% of the time and that the cost of electricity is $0.10 per kilowatt hour. 800GB SSD Drive cost $1100. The 800GB s...
1 answer
Python: Stock Pricing The DOW Jones stock ticker has been on a roller coaster ride these...
Python: Stock Pricing The DOW Jones stock ticker has been on a roller coaster ride these past 12 months. A local hardware store has invested deeply into the bond market. In order for us to simulate any stock prices we can write a simple program using a list and either While or For loop to store 100 ...
1 answer
A car with a mass of 980 kg is initially traveling east toward an intersection with...
A car with a mass of 980 kg is initially traveling east toward an intersection with a speed of vc = 20.9 m/s and a 1500 kg pickup is traveling north toward the same intersection. The car and truck collide at the intersection and stick together. After the collision, the wreckage (car and truck) moves...