dev: fixed assembly errors, added linker script and Makefile
Additionally created a .gitignore to avoid committing object code and output formats
This commit is contained in:
parent
1353091dda
commit
f753eb9642
5 changed files with 372 additions and 246 deletions
16
.gitignore
vendored
Normal file
16
.gitignore
vendored
Normal file
|
|
@ -0,0 +1,16 @@
|
|||
# Created by https://www.toptal.com/developers/gitignore/api/assembler
|
||||
# Edit at https://www.toptal.com/developers/gitignore?templates=assembler
|
||||
|
||||
### Assembler ###
|
||||
*.exe
|
||||
*.o
|
||||
*.obj
|
||||
*.bc
|
||||
|
||||
# Output
|
||||
*.hex
|
||||
*.srec
|
||||
*.s19
|
||||
*.elf
|
||||
# End of https://www.toptal.com/developers/gitignore/api/assembler
|
||||
|
||||
21
Makefile
Normal file
21
Makefile
Normal file
|
|
@ -0,0 +1,21 @@
|
|||
ASM=vasm_z80_std
|
||||
LINK=vlink
|
||||
|
||||
ASMFLAGS=-Fvobj
|
||||
LINKFLAGS=-b ihex -T linker.cmd
|
||||
|
||||
all: float.hex
|
||||
|
||||
float.o: float.asm
|
||||
$(ASM) $(ASMFLAGS) -o $@ $<
|
||||
|
||||
printChar.o: printChar.asm
|
||||
$(ASM) $(ASMFLAGS) -o $@ $<
|
||||
|
||||
float.hex: float.o printChar.o linker.cmd
|
||||
$(LINK) $(LINKFLAGS) -o $@ float.o printChar.o
|
||||
|
||||
clean:
|
||||
rm -f float.o printChar.o float.hex
|
||||
|
||||
.PHONY: all clean
|
||||
6
linker.cmd
Normal file
6
linker.cmd
Normal file
|
|
@ -0,0 +1,6 @@
|
|||
SECTIONS
|
||||
{
|
||||
.text 0xE000 : { *(.text) }
|
||||
.data 0x7000 : { *(.data) }
|
||||
.bss : { *(.bss) }
|
||||
}
|
||||
4
printChar.asm
Normal file
4
printChar.asm
Normal file
|
|
@ -0,0 +1,4 @@
|
|||
; Stub printChar: does nothing
|
||||
.global printChar
|
||||
printChar:
|
||||
ret
|
||||
Loading…
Add table
Add a link
Reference in a new issue