# Code runs in real mode, which is a 16-bit segment.
+.globl start
+start:
.code16
# Disable interrupts.
cli
cld
-# Set up segment registers and stack.
-# Stack grows downward starting from us.
+# Set up data segments and stack.
subw %ax, %ax
movw %ax, %es
movw %ax, %ds
+
+# Stack grows downward starting from us.
+# We don't ever use the stack so this is strictly speaking
+# unnecessary.
+
movw %ax, %ss
movw $0x7c00, %sp
# Transfer sector.
- movl $512 / 4, %ecx
+ movl $256, %ecx
movl $0x1f0, %edx
- rep insl
+ rep insw
# Next sector.