ack/mach/6500/libem/rmu.s

28 lines
377 B
ArmAsm
Raw Permalink Normal View History

1984-12-17 11:03:13 +00:00
.define Rmu2
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 an twobyte unsigned
! integer division.
Rmu2:
stx ARTH
sta ARTH+1 ! first operand
jsr Pop
stx ARTH+2
sta ARTH+3 ! second operand
ldy #1
sty UNSIGN ! it unsigned
jsr Duv
lsr ARTH+5
ror ARTH+4 ! shift result one time
ldx ARTH+4
lda ARTH+5
rts