OBJCOPY = objcopy
OPTFLAGS = -g -Os -march=i386 -falign-functions=0 -falign-jumps=0 -falign-loops=0 -fomit-frame-pointer
INCLUDES = -include code16.h -I. -I.. -I../libfat
-CFLAGS = -W -Wall -ffreestanding $(OPTFLAGS) $(INCLUDES)
+CFLAGS = -W -Wall -ffreestanding -msoft-float $(OPTFLAGS) $(INCLUDES)
LDFLAGS = -T com16.ld
AR = ar
RANLIB = ranlib
.code16
+#ifndef REGPARM
+# error "This file assumes -mregparm=3 -DREGPARM=3"
+#endif
+
.section ".init","ax"
.globl _start
.type _start,@function
shrw $2,%cx
rep ; stosl
- # Compute argc and argv
+ # Compute argc and argv (assumes REGPARM)
xorl %edx,%edx
- movzbw 80,%bx
- movb %dl,81(%bx) # Zero-terminate string
- movb $81,%dl
+ movzbw 0x80,%bx
+ movb %dl,0x81(%bx) # Zero-terminate string
+ movb $0x81,%dl
pushl %eax # Make space for argv
movl %esp,%eax
calll __parse_argv