Add software files

This commit is contained in:
Byron Lathi
2022-03-05 18:48:19 -06:00
parent bc98b67ddf
commit a2fdcc5553
4 changed files with 99 additions and 0 deletions

52
sw/.gitignore vendored Normal file
View File

@@ -0,0 +1,52 @@
# Prerequisites
*.d
# Object files
*.o
*.ko
*.obj
*.elf
# Linker output
*.ilk
*.map
*.exp
# Precompiled Headers
*.gch
*.pch
# Libraries
*.lib
*.a
*.la
*.lo
# Shared objects (inc. Windows DLLs)
*.dll
*.so
*.so.*
*.dylib
# Executables
*.exe
*.out
*.app
*.i*86
*.x86_64
*.hex
# Debug files
*.dSYM/
*.su
*.idb
*.pdb
# Kernel Module Compile Results
*.mod*
*.cmd
.tmp_versions/
modules.order
Module.symvers
Mkfile.old
dkms.conf

27
sw/Makefile Normal file
View File

@@ -0,0 +1,27 @@
CC=cl65
CFLAGS=-t none
LDFLAGS=-C link.ld
NAME=main
BIN=$(NAME).bin
HEX=$(NAME).hex
SRCS=$(wildcard *.S) $(wildcard *.c)
OBJS+=$(patsubst %.S,%.o,$(filter %S,$(SRCS)))
OBJS+=$(patsubst %.c,%.o,$(filter %c,$(SRCS)))
all: $(BIN)
objcopy --input-target=binary --output-target=ihex $(BIN) $(HEX)
$(BIN): $(OBJS)
$(CC) $(CFLAGS) $(LDFLAGS) $(OBJS) -o $@
%.o: %.c
$(CC) $(CFLAGS) -c $< -o $@
.PHONY: clean
clean:
rm -rf $(OBJS) $(BIN) $(HEX)

10
sw/link.ld Normal file
View File

@@ -0,0 +1,10 @@
MEMORY
{
ROM: start=$8000, size=$8000, type=ro, define=yes, fill=yes, file=%O;
}
SEGMENTS
{
CODE: load=ROM, type=ro;
VECTORS: load=ROM, type=ro, offset=$7ffa;
}

10
sw/main.S Normal file
View File

@@ -0,0 +1,10 @@
.setcpu "6502"
.segment "VECTORS"
.word loop
.word loop
.word loop
.code
loop: lda #$12
jmp loop