Computer Science, asked by ajaysingh7897, 1 year ago

Arm microprocessor program to find prime number

Answers

Answered by rahulmandviya
0
Now let’s see the 8086 assembly language code for prime number checking. [cc lang=”C”]1000 XOR CX,CX /*Clearing the registers*/
1002 XOR DX,DX /*Clearing the registers*/
1004 MOV AX,[1500] /*Assume the number is store in memory 1500*/
1006 MOV BX,AX /*Copy the value in AX to BX */
1008 DEC BX
1010 DIV BX /*Dividing*/
1012 CMP DX,0000 /*Check for Reminder, Reminder is stored in DX*/
1014 JZ step 13
1016 XOR DX,DX /*Clearing DX*/
1018 CMP BX,0002
1020 JNZ 1008
1022 MOV CX,0001
1024 MOV [2000],CX /*Storing the result*/
1026 HLT[/cc]
Similar questions