CS Electrical And Electronics
@cselectricalandelectronics

Write an ASM language for division using repeated subtraction?

All QuestionsCategory: Embedded SystemWrite an ASM language for division using repeated subtraction?
CS Electrical And Electronics Staff asked 4 years ago

i need code.

1 Answers
CS Electrical And Electronics Staff answered 4 years ago

Code:

AREA A0, CODE
ENTRY
MOV R5, #15
MOV R6, #3
CMP R6, #0
BEQ EN
CMP R6, R5
MOVPL R6, #1
BPL EN
DIV SUB R7, R5, R6
ADD R1, R1, #1
CMP R7, R6
MOVPL R5, R7
BPL DIV
EN
STOP B STOP
END