PERFORCE change 27483 for review
John Baldwin
jhb at FreeBSD.org
Thu Mar 27 15:32:18 PST 2003
http://perforce.freebsd.org/chv.cgi?CH=27483
Change 27483 by jhb at jhb_laptop on 2003/03/27 15:32:09
More arcane optimizations to trim the size down. This is now
down to -13 bytes over. However, if you remove the .p2align
at the end of the file, boot2 is only at -1 byte.
Affected files ...
.. //depot/projects/smpng/sys/boot/i386/btx/btx/btx.s#6 edit
Differences ...
==== //depot/projects/smpng/sys/boot/i386/btx/btx/btx.s#6 (text+ko) ====
@@ -208,7 +208,7 @@
ifdef(`PAGING',`
or $0x80000001,%eax # mode and enable paging
',`
- or $0x01,%eax # mode
+ inc %ax # mode
')
mov %eax,%cr0 #
ljmp $SEL_SCODE,$init.8 # To 32-bit code
@@ -626,11 +626,11 @@
movl 0x11(%edi),%eax # Read base of
movb 0x17(%edi),%al # GDT entry
ror $8,%eax # for source
- movl %eax,%esi # into %esi
+ xchgl %eax,%esi # into %esi
movl 0x19(%edi),%eax # Read base of
movb 0x1f(%edi),%al # GDT entry for
ror $8,%eax # destination
- movl %eax,%edi # into %edi
+ xchgl %eax,%edi # into %edi
pushl %ds # Make:
popl %es # es = ds
movzwl 0x18(%ebp),%ecx # Get user's CX
@@ -657,23 +657,16 @@
cmpb $0x19,%al # is it int 19?
je reboot # yes, reboot the machine
cmpb $0x15,%al # is it int 15?
- jne v86intn.3 # no, skip parse
- pushl %eax # stash EAX
- movl 0x1c(%ebp),%eax # user's saved EAX
- cmpb $0x87,%ah # is it the memcpy subfunction?
- jne v86intn.1 # no, keep checking
- popl %eax # get the stack straight
- jmp int15_87 # it's our cue
-v86intn.1: cmpw $0x4f53,%ax # is it the delete key callout?
- jne v86intn.2 # no, handle the int normally
+ jne v86intn.1 # no, skip parse
+ cmpb $0x87,0x1c(%ebp) # is it the memcpy subfunction?
+ je int15_87 # yes
+ cmpw $0x4f53,0x1c(%ebp) # is it the delete key callout?
+ jne v86intn.1 # no, handle the int normally
movb BDA_KEYFLAGS,%al # get the shift key state
andb $0xc,%al # mask off just Ctrl and Alt
cmpb $0xc,%al # are both Ctrl and Alt down?
- jne v86intn.2 # no, handle the int normally
- popl %eax # restore EAX
- jmp reboot # reboot the machine
-v86intn.2: popl %eax # restore EAX
-v86intn.3: subl %edi,%esi # From
+ je reboot # yes, reboot the machine
+v86intn.1: subl %edi,%esi # From
shrl $0x4,%edi # linear
movw %dx,-0x2(%ebx) # Save flags
movw %di,-0x4(%ebx) # Save CS
@@ -905,8 +898,7 @@
dump.3: lodsl # Set offset
xchgl %eax,%edx # Save
lodsl # Get segment
- shll $0x4,%eax # * 0x10
- addl %edx,%eax # + offset
+ leal (%edx,%eax,4),%eax # * 0x10 + offset
xchgl %eax,%esi # Set pointer
dump.4: movb $2,%dl # Num lines
dump.4a: movb $0x10,%cl # Bytes to dump
More information about the p4-projects
mailing list