ack/mach/6500/libem/rmu4.s

40 lines
513 B
ArmAsm
Raw Normal View History

1984-12-17 11:03:13 +00:00
.define Rmu4
1987-01-30 18:41:42 +00:00
.sect .text
.sect .rom
.sect .data
.sect .bss
.sect .text
1984-12-17 11:03:13 +00:00
! This subroutine returns the remainder of a fourbyte unsigned
! division.
Rmu4:
ldy #1
sty UNSIGN ! its unsigned
jsr Pop
stx ARTH
sta ARTH+1
jsr Pop
stx ARTH+2
sta ARTH+3 ! second operand
jsr Pop
stx ARTH+4
sta ARTH+5
jsr Pop
stx ARTH+6
sta ARTH+7 ! first operand
jsr Duv4
lsr ARTH+11
ror ARTH+10
ror ARTH+9
ror ARTH+8 ! shift result one time
lda ARTH+11
ldx ARTH+10
jsr Push
lda ARTH+9
ldx ARTH+8
jmp Push