rmu4.s 513 B

123456789101112131415161718192021222324252627282930313233343536373839
  1. .define Rmu4
  2. .sect .text
  3. .sect .rom
  4. .sect .data
  5. .sect .bss
  6. .sect .text
  7. ! This subroutine returns the remainder of a fourbyte unsigned
  8. ! division.
  9. Rmu4:
  10. ldy #1
  11. sty UNSIGN ! its unsigned
  12. jsr Pop
  13. stx ARTH
  14. sta ARTH+1
  15. jsr Pop
  16. stx ARTH+2
  17. sta ARTH+3 ! second operand
  18. jsr Pop
  19. stx ARTH+4
  20. sta ARTH+5
  21. jsr Pop
  22. stx ARTH+6
  23. sta ARTH+7 ! first operand
  24. jsr Duv4
  25. lsr ARTH+11
  26. ror ARTH+10
  27. ror ARTH+9
  28. ror ARTH+8 ! shift result one time
  29. lda ARTH+11
  30. ldx ARTH+10
  31. jsr Push
  32. lda ARTH+9
  33. ldx ARTH+8
  34. jmp Push