Write an ASM language for division using repeated subtraction?


Warning: Trying to access array offset on false in /home3/indiakep/public_html/wp-content/plugins/dw-question-answer/inc/Template.php on line 8
All QuestionsCategory: Embedded SystemWrite an ASM language for division using repeated subtraction?
Chetan Shidling Staff asked 6 years ago

i need code.

1 Answers
Chetan Shidling Staff answered 6 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