From 3a6ba7bd638f8ba131164663056adf7be2107c0e Mon Sep 17 00:00:00 2001 From: sobomax Date: Mon, 8 Dec 2008 23:45:41 +0000 Subject: Optimiza assembly in the previous r185779, to save whooping 16 bytes. Submitted by: Christoph Mallon MFC after: 4 weeks (including r185779) --- sys/boot/i386/btx/btxldr/btxldr.S | 14 +++++--------- 1 file changed, 5 insertions(+), 9 deletions(-) (limited to 'sys/boot') 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]. */ -- cgit v1.1