ack/mach/arm/libem/dvi.s

40 lines
546 B
ArmAsm
Raw Permalink Normal View History

1988-02-18 10:08:42 +00:00
.define .dvi
.sect .text
.dvi: LDMFD R12<,{R1,R2}
1990-11-12 17:09:15 +00:00
STMFD R12<,{R4}
CMP R1,#0
BEQ dbyzero
MOV R4,#0
1988-02-18 10:08:42 +00:00
CMP R1,#0
1990-11-12 17:09:15 +00:00
ADD.LT R4,R4,#1
RSB.LT R1,R1,#0
1988-02-18 10:08:42 +00:00
CMP R2,#0
1990-11-12 17:09:15 +00:00
ADD.LT R4,R4,#2
RSB.LT R2,R2,#0
1988-02-18 10:08:42 +00:00
MOV R0,#1
div1: CMP R1,#0x80000000
CMP.CC R1,R2
MOV.CC R1,R1,ASL #1
MOV.CC R0,R0,ASL #1
BCC div1
MOV R3,#0
div2: CMP R2,R1
SUB.CS R2,R2,R1
ADD.CS R3,R3,R0
MOV.S R0,R0,LSR #1
MOV.NE R1,R1,LSR #1
BNE div2
1990-11-12 17:09:15 +00:00
CMP R4, #1
RSB.EQ R3,R3,#0
CMP R4,#2
RSB.EQ R3,R3,#0
LDMFD R12<,{R4}
1988-02-18 10:08:42 +00:00
MOV R15,R14
1990-11-12 17:09:15 +00:00
dbyzero:
MOV R0,#6
STMFD R12<,{R0}
BAL _EmTrp