ceriel hace 37 años
padre
commit
f4fb73386e
Se han modificado 1 ficheros con 23 adiciones y 8 borrados
  1. 23 8
      mach/m68k4/libem/cii.s

+ 23 - 8
mach/m68k4/libem/cii.s

@@ -7,18 +7,33 @@
 	.sect .text
 .cii:
 	move.l	(sp)+,a0	! return address
-	move	(sp)+,d0	! destination size
-	sub	(sp)+,d0	! destination - source size
+	move.l	(sp)+,d0	! destination size
+	move.l	(sp)+,d1
+	move.l	(sp),d2
+	cmp.l	#1,d1
+	bne	1f
+	move.l	#2,d1
+	ext.w	d2
+1:
+	cmp.l	#2,d1
+	bne	1f
+	move.l	#4,d1
+	ext.l	d2
+1:
+	move.l	d2,(sp)
+	sub.l	d1,d0	
 	bgt	1f
-	sub	d0,sp		! pop extra bytes
+	sub.l	d0,sp		! pop extra bytes
 	bra	3f
 1:
-	move	(sp),d1
-	ext.l	d1
-	swap	d1
-	asr	#1,d0
+	clr.l	d1
+	tst.l	d2
+	bge	1f
+	move.l	#-1,d1
+1:
+	asr	#2,d0
 2:
-	move.w	d1,-(sp)
+	move.l	d1,-(sp)
 	dbf	d0,2b
 3:
 	move.l	a0,-(sp)