Skip site navigation (1)Skip section navigation (2)
Date:      Mon, 8 Dec 2008 23:45:42 +0000 (UTC)
From:      Maxim Sobolev <sobomax@FreeBSD.org>
To:        src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org
Subject:   svn commit: r185780 - head/sys/boot/i386/btx/btxldr
Message-ID:  <200812082345.mB8Njgvf074168@svn.freebsd.org>

next in thread | raw e-mail | index | archive | help
Author: sobomax
Date: Mon Dec  8 23:45:41 2008
New Revision: 185780
URL: http://svn.freebsd.org/changeset/base/185780

Log:
  Optimiza assembly in the previous r185779, to save whooping 16 bytes.
  
  Submitted by:	Christoph Mallon
  MFC after:	4 weeks
  		(including r185779)

Modified:
  head/sys/boot/i386/btx/btxldr/btxldr.S

Modified: head/sys/boot/i386/btx/btxldr/btxldr.S
==============================================================================
--- head/sys/boot/i386/btx/btxldr/btxldr.S	Mon Dec  8 21:52:06 2008	(r185779)
+++ head/sys/boot/i386/btx/btxldr/btxldr.S	Mon Dec  8 23:45:41 2008	(r185780)
@@ -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 sc
 		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].
  */



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?200812082345.mB8Njgvf074168>