I get the following errors:
What's strange is if I change "main" to "_main" this turns into:C:\Users\Owner\DOCUME~1\MYDROP~1\Firefly\programs\HELLOW~1>compile
Compiling...
Linking...
..\entry.o(.text+0x1): undefined reference to `main'
compile\main.o(.text+0x21):main.c: undefined reference to `__alloca'
compile\main.o(.text+0x26):main.c: undefined reference to `___main'
Copying...
The system cannot find the file specified.
C:\Users\Owner\DOCUME~1\MYDROP~1\Firefly\programs\HELLOW~1>
So somehow __alloca and ___main (triple underscore?) both disappear. But a reference to main is still missing?C:\Users\Owner\DOCUME~1\MYDROP~1\Firefly\programs\HELLOW~1>compile
Compiling...
Linking...
..\entry.o(.text+0x1): undefined reference to `main'
Copying...
The system cannot find the file specified.
C:\Users\Owner\DOCUME~1\MYDROP~1\Firefly\programs\HELLOW~1>
Plus in the original it should be able to call main.
compile.bat:
entry.s:@echo off
@echo Compiling...
gcc -o compile\main.o -c main.c -I..\include\ -Wextra -fno-builtin -nostdlib -nostartfiles -nodefaultlibs -fno-leading-underscores
@echo Linking...
ld-elf -L..\libraries\ -T compile\linker.ld -o hello.prg ..\entry.o compile\main.o -lstdio -lstdlib -l_sysapi -lstring
@echo Copying...
copy hello.prg A:\programs\hello.prg
Code: Select all
global entrypoint
extern main
section .text
align 4
entrypoint:
jmp main
section .bss
align 4