Question: THIS IS MASM. MASM IS ASSEMBLY. NOT C, C++, JAVA OR ANY OTHER LANGUAGE. An error (access violation) occurs isPrime procedure. I just can't fix

THIS IS MASM. MASM IS ASSEMBLY. NOT C, C++, JAVA OR ANY OTHER LANGUAGE.

An error (access violation) occurs isPrime procedure. I just can't fix this error, so I need help.

Thank you.

INCLUDE Irvine32.inc .data v1 dword 2 v2 dword 2 s1 byte "Please enter a number:",0 s3 byte "| The value will be recognized as non signed |",0Ah, 0 s4 byte "|By definition of Prime Number, number can't be negative|",0Ah, 0 .code main proc mov edx, offset s4 call writestring mov edx, offset s3 call writestring mov edx, offset s1 call writestring call readdec mov ecx, eax dec ecx dec ecx L1: push ecx push v2 mov eax, v1 push eax xor edx, edx mov ebx, 2 div ebx mov ecx, eax call isPrime pop v2 pop ecx inc v1 cmp edx, 0 JE L4 LOOP L1 L4: call writedec dec ecx JMP L1 exit main endp isPrime proc L2: pop eax push eax xor edx, edx div v2 cmp edx, 0 JE L3 inc v2 LOOP L2 pop eax mov edx, 0 ret L3: pop eax mov edx, 1 ret <----------- ERROR OCCURS HERE. isPrime endp end main 

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!