summaryrefslogtreecommitdiffstats
path: root/sys/boot
diff options
context:
space:
mode:
authorsobomax <sobomax@FreeBSD.org>2008-12-08 23:45:41 +0000
committersobomax <sobomax@FreeBSD.org>2008-12-08 23:45:41 +0000
commit3a6ba7bd638f8ba131164663056adf7be2107c0e (patch)
treec68a4a518384499dc3882dfc460775e07eaebf65 /sys/boot
parent592295f8b78da95d781c52a28c60daa3d021e3d3 (diff)
downloadFreeBSD-src-3a6ba7bd638f8ba131164663056adf7be2107c0e.zip
FreeBSD-src-3a6ba7bd638f8ba131164663056adf7be2107c0e.tar.gz
Optimiza assembly in the previous r185779, to save whooping 16 bytes.
Submitted by: Christoph Mallon MFC after: 4 weeks (including r185779)
Diffstat (limited to 'sys/boot')
-rw-r--r--sys/boot/i386/btx/btxldr/btxldr.S14
1 files changed, 5 insertions, 9 deletions
diff --git a/sys/boot/i386/btx/btxldr/btxldr.S b/sys/boot/i386/btx/btxldr/btxldr.S
index 58ee9b6..f27d43a 100644
--- a/sys/boot/i386/btx/btxldr/btxldr.S
+++ b/sys/boot/i386/btx/btxldr/btxldr.S
@@ -67,11 +67,8 @@
* BTX program loader for ELF clients.
*/
start: cld # String ops inc
- leal 0x4(%esp,1),%ebx # First argument
- testl $OPT_SET(RBX_MUTE),(%ebx) # check for RBX_MUTE
- jz nomute
- movb $1,muted
-nomute:
+ testl $OPT_SET(RBX_MUTE), 4(%esp) # Check first argument
+ setnz muted # for RBX_MUTE, set flag
movl $m_logo,%esi # Identify
call putstr # ourselves
movzwl BDA_MEM,%eax # Get base memory
@@ -296,9 +293,8 @@ putstr: lodsb # Load char
/*
* Output character AL to the console.
*/
-putchr: testb $1,muted
- jz putchr_nm
- ret
+putchr: testb $1,muted # Check muted
+ jnz putchr.5 # do a nop
putchr_nm: pusha # Save
xorl %ecx,%ecx # Zero for loops
movb $SCR_MAT,%ah # Mode/attribute
@@ -336,7 +332,7 @@ putchr.3: cmpb $SCR_ROW,%dh # Beyond screen?
movb $SCR_ROW-1,%dh # Bottom line
putchr.4: movw %dx,(%ebx) # Update position
popa # Restore
- ret # To caller
+putchr.5: ret # To caller
/*
* Convert EAX, AX, or AL to hex, saving the result to [EDI].
*/
OpenPOWER on IntegriCloud