Assembly Language Division

From TRCCompSci - AQA Computer Science
Revision as of 08:14, 14 January 2019 by Admin (talk | contribs) (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...")
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)
Jump to: navigation, search
      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