Monday, July 25, 2011

Absolute division using loop

;program to divide absolute value like 20/5 = 4 etc.
;or like 4/2 not 20.5/12 no decimal values will be divided
ORG 0H          ;
MOV A, #25      ;
MOV R0, #05     ;
MOV R1, #00H    ;
LOOP: SUBB A, R0;
      INC R1    ;
      JNZ LOOP  ;
END

No comments:

Post a Comment