summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorbde <bde@FreeBSD.org>1996-03-08 07:27:52 +0000
committerbde <bde@FreeBSD.org>1996-03-08 07:27:52 +0000
commit9acf1cecfc141db5d0fc49519e5b2ed71a4a5996 (patch)
tree501d9c87ba51382584145934b227367cb4351304
parentb149de385358aae454e84aaa2ae0182793af8c2b (diff)
downloadFreeBSD-src-9acf1cecfc141db5d0fc49519e5b2ed71a4a5996.zip
FreeBSD-src-9acf1cecfc141db5d0fc49519e5b2ed71a4a5996.tar.gz
Saved 14 bytes by avoiding gas braindamage and 8 bytes by better
instruction selection, for a total of 16 bytes after padding. Whee.
-rw-r--r--sys/i386/boot/biosboot/asm.S45
1 files changed, 22 insertions, 23 deletions
diff --git a/sys/i386/boot/biosboot/asm.S b/sys/i386/boot/biosboot/asm.S
index 885a3a5..a29dd87 100644
--- a/sys/i386/boot/biosboot/asm.S
+++ b/sys/i386/boot/biosboot/asm.S
@@ -24,7 +24,7 @@
* the rights to redistribute these changes.
*
* from: Mach, Revision 2.2 92/04/04 11:34:13 rpd
- * $Id: asm.S,v 1.7 1996/03/08 05:15:53 bde Exp $
+ * $Id: asm.S,v 1.8 1996/03/08 05:43:46 bde Exp $
*/
@@ -89,18 +89,18 @@ ENTRY(real_to_prot)
*/
data32
ljmp $0x18, $xprot
-
xprot:
+
/*
* we are in USE32 mode now
* set up the protected mode segment registers : DS, SS, ES, FS
*/
- mov $0x20, %eax
- movw %ax, %ds
- movw %ax, %ss
- movw %ax, %es
+ movw $0x20, %ax /* data segment */
+ mov %ax, %ds /* gas would waste a prefix byte for movw */
+ mov %ax, %ss
+ mov %ax, %es
movw $0x10, %ax /* flat segment */
- movw %ax, %fs
+ mov %ax, %fs
#ifdef BDE_DEBUGGER
/* load idtr so we can debug */
@@ -148,11 +148,11 @@ xreal:
* we are in real mode now
* set up the real mode segment registers : DS, SS, ES, FS
*/
- movw %cs, %ax
- movw %ax, %ds
- movw %ax, %ss
- movw %ax, %es
- movw %ax, %fs
+ mov %cs, %ax
+ mov %ax, %ds
+ mov %ax, %ss
+ mov %ax, %es
+ mov %ax, %fs
#ifdef BDE_DEBUGGER
/* load idtr so we can debug */
@@ -179,8 +179,8 @@ ENTRY(startprog)
movl %esp, %eax /* Use eax as the old stack pointer */
/* convert the current stack to a 32 bit flat model */
- mov $0x10, %ebx
- movw %bx, %ss
+ movw $0x10, %bx
+ mov %bx, %ss
addl $(BOOTSEG<<4),%esp
/* copy the arguments from the old stack to the new stack */
@@ -199,9 +199,9 @@ ENTRY(startprog)
pushl 0x08(%eax) /* kernel entry address */
/* convert over the other data segs */
- mov $0x10, %ebx
- movw %bx, %ds
- movw %bx, %es
+ movw $0x10, %bx
+ mov %bx, %ds
+ mov %bx, %es
/* convert the PC (and code seg) */
lret
@@ -226,12 +226,12 @@ ENTRY(pbzero)
cld
/* set %es to point at the flat segment */
- mov $0x10, %eax
- movw %ax, %es
+ movw $0x10, %ax
+ mov %ax, %es
mov 0x8(%ebp), %edi /* destination */
mov 0xc(%ebp), %ecx /* count */
- mov $0x0, %eax /* value */
+ xorl %eax, %eax /* value 0 */
rep
stosb
@@ -259,8 +259,8 @@ ENTRY(pcpy)
cld
/* set %es to point at the flat segment */
- mov $0x10, %eax
- movw %ax, %es
+ movw $0x10, %ax
+ mov %ax, %es
mov 0x8(%ebp), %esi /* source */
mov 0xc(%ebp), %edi /* destination */
@@ -276,4 +276,3 @@ ENTRY(pcpy)
pop %ebp
ret
-
OpenPOWER on IntegriCloud