Advertisement
ShiningDrake

Untitled

Apr 16th, 2019
127
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.43 KB | None | 0 0
  1. remain2: .EQUATE 2 ;Stack addresses while executing a
  2. outYet2: .EQUATE 4 ; subroutine are greater by two because
  3. place2: .EQUATE 6 ; the retAddr is on the stack
  4. ;
  5. divide: LDWA remain2,s ;A <- remainder
  6. LDWX 0,i ;X <- 0
  7. divLoop: SUBA place2,s ;Division by repeated subtraction
  8. BRLT writeNum ;If remainder is negative then done
  9. ADDX 1,i ;X <- X + 1
  10. STWA remain2,s ;Store the new remainder
  11. BR divLoop
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement