Answered step by step
Verified Expert Solution
Question
1 Approved Answer
I need to di an assembly language assignment. Can you please give me the correct code and I can copy paste it on word document?
I need to di an assembly language assignment. Can you please give me the correct code and I can copy paste it on word document? Also, I am unable to get the executable file because I can't access a linux directory. if somone have it can give me the executable file i need it urgently!!! as well as the correct code. Here is the assignment instructions: Intel Assembly Language Programming Assignment
Date assigned: Wednesday, June
Due Date: Wednesday, June before : AM
Instructions:
Submit your executable program and your lis file using
by using the Assignment submission link on the course Moodle page.
You are to use a Linux text editor, together with the nasm assembler,
ld loader and gdbddd
debugger tools to write a complete Intel x assembly language program to
perform the following:
Complete the following Intel assembly language program
which determines whether the byte sized operand stored
in memory location 'number' is prime or not. The program
will write the value of into the memory location 'answer'
if the number is not prime, otherwise the initial value of will
be left unmodified indicating that the number is prime The program
makes use of the DIV instruction to determine the value of quotient
and remainder when dividing the number by number
section data
; put your data in this section using
; db dw dd directions
number db
answer db ; means number is prime, means number is not prime
section bss
; put UNINITIALIZED data here using
section text
global start
start:
mov esi, number ; get the offset of number into esi
keith: mov eax, ; clear the entire eax register
mov alesi ; get the number from memory into al
mov dl al ; put it inside dl as well
mov bl ; bl holds each divisor starting from
loopy: div bl ; ax bl with quot in al and rem in ah
and axb ; isolate the rem in ah with a AND mask
; to determine whether the remainder is
; YOU COMPLETE THE REST OF THE CODE
HINT: The program is to implement the following highlevel
pseudocode:
prime true ;
divisor ;
while divisor number
if the remainder of number divisor is
prime false ; we found a divisor which evenly divides number
so therefore number cannot be prime
divisor divisor ; check the next divisor and keep looping
Step by Step Solution
There are 3 Steps involved in it
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started