Academic Integrity: tutoring, explanations, and feedback — we don’t complete graded work or submit on a student’s behalf.

Write a ASSEMBLY Language program using: \" INCLUDE Irvine32.inc \" language Que

ID: 3841192 • Letter: W

Question

Write a ASSEMBLY Language program using:

"INCLUDE Irvine32.inc" language

Question: Write a program tht generates all prime numbers between 2 and 1000, using the Sieve of Eratosthenes method.

DO NOT use x86 language or any other. make sure to use "INCLUDE Irvine32.inc"

please test the program before posting, THANK YOU

start the input from the left at a a babe So The correct answer is soso, s2,s2,so, si,s2 which output z ooooo to Rember that the program accepts Char (let but trints zeros and ones (ou ay.

Explanation / Answer

Private Function SOES(ByVal N As Integer) As List(Of Integer)

   

    Dim result As New List(Of Integer)

   

    Dim IsPrime As New List(Of Boolean)

   

    For i As Integer = 0 To N - 2

        IsPrime.Add(True)

    Next

   

    Dim NumberOfPrimeChecks As Integer = CInt(Math.Sqrt(N))

   

    Dim CurrentNumber As Integer = 2

   

    For i As Integer = 0 To NumberOfPrimeChecks - 1

        If IsPrime(i) Then

           

            For j As Integer = i + CurrentNumber To IsPrime.Count - 1 Step CurrentNumber

                IsPrime(j) = False

            Next

        End If

       

        CurrentNumber += 1

    Next

   

    For i As Integer = 0 To IsPrime.Count - 1

        If IsPrime(i) Then

            result.Add(i + 2)

        End If

    Next

    Return result

End Function

Hire Me For All Your Tutoring Needs
Integrity-first tutoring: clear explanations, guidance, and feedback.
Drop an Email at
drjack9650@gmail.com
Chat Now And Get Quote