Difference between revisions of "Assembly Language Division"

From TRCCompSci - AQA Computer Science
Jump to: navigation, search
(Created page with " INP R0,2 INP R1,2 MOV R2,#0 MOV R3,#1 LOOP: SUB R0,R0,R1 ADD R2,R2,R3 CMP R0,#0 BGT LOOP BEQ END SUB R2,R2,R3...")
(No difference)

Revision as of 08:14, 14 January 2019

      INP R0,2
      INP R1,2
      MOV R2,#0
      MOV R3,#1
LOOP: SUB R0,R0,R1
      ADD R2,R2,R3
      CMP R0,#0
      BGT LOOP
      BEQ END
      SUB R2,R2,R3
END:  OUT R2,4
      HALT