ack/mach/6500/libem/rmi4.s

34 lines
484 B
ArmAsm
Raw Normal View History

1984-12-17 11:03:13 +00:00
.define Rmi4
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 division.
Rmi4:
ldy #0
sty NBYTES ! for the sign of the result
ldy #0
sty UNSIGN ! it is signed arithmetic
jsr Div4
lsr ARTH+11
ror ARTH+10
ror ARTH+9
ror ARTH+8 ! result must be shifted one time
ldy NBYTES
beq 1f ! result is positive
lda #0
ldx #ARTH+8
jsr Ngi4
1: lda ARTH+11
ldx ARTH+10
jsr Push
lda ARTH+9
ldx ARTH+8
jmp Push