Bladeren bron

Added STS and LOS routines

ceriel 35 jaren geleden
bovenliggende
commit
9182f23c4f
2 gewijzigde bestanden met toevoegingen van 22 en 6 verwijderingen
  1. 13 3
      mach/i86/libem/loi.s
  2. 9 3
      mach/i86/libem/sti.s

+ 13 - 3
mach/i86/libem/loi.s

@@ -1,15 +1,15 @@
 .sect .text; .sect .rom; .sect .data; .sect .bss
 .sect .text
 .define .loi
+.define .los
 
 	! #bytes in cx
 	! address in bx
 	! save si/di. they might be register variables
-.loi:
-	pop     ax
+.los:
 	mov	dx,si
 	mov	si,bx
-	mov	bx,ax
+	pop	bx
 	mov     ax,cx
 	sar     cx,1
 	jnb     1f
@@ -20,6 +20,16 @@
 	jmp     bx
 1:
 	sub     sp,ax
+	jmp	1f
+
+.loi:
+	! only called with size > 4
+	mov	dx,si
+	mov	si,bx
+	pop	bx
+	sub	sp,cx
+	sar	cx,1
+1:
 	mov	ax,di
 	mov     di,sp
 	rep movs

+ 9 - 3
mach/i86/libem/sti.s

@@ -1,21 +1,27 @@
 .sect .text; .sect .rom; .sect .data; .sect .bss
 .sect .text
 .define .sti
+.define .sts
 
 	! #bytes in cx
 	! address in bx
 	! save di/si. they might be register variables
-.sti:
+.sts:
 	mov	dx,di		! save di
-	pop     ax              ! return address
 	mov	di,bx
-	mov	bx,ax
+	pop	bx
 	sar     cx,1
 	jnb     1f
 	pop     ax
 	stosb
 	mov	di,dx
 	jmp     bx
+.sti:
+	! only called with count > 4
+	mov	dx,di
+	mov	di,bx
+	pop	bx
+	sar	cx,1
 1:
 	mov	ax,si
 	mov     si,sp