starting assembly

This commit is contained in:
julianb0 2019-05-16 19:59:14 +02:00
parent 826ad2245e
commit 0d2f94314a
No known key found for this signature in database
GPG Key ID: DDF8325C95299A62
15 changed files with 39 additions and 18 deletions

4
.gitignore vendored
View File

@ -1,4 +1,6 @@
k.exe
*.exe
*.out
*.o
test*
arch_i.h

View File

@ -1,23 +1,13 @@
# The OS/K Team licenses this file to you under the MIT license.
# See the LICENSE file in the project root for more information.
all: k.exe
all: pc as
src = instr/instrs.c karch/decd.c karch/main.c karch/regs.c \
karch/dump.c instr/jumps.c
pc:
cd pc && make
obj = $(patsubst %.c,%.o,$(src))
as:
cd as && make
%.o: %.c instrs/i_arch.h */*.h $(src)
@gcc -O2 -Wall -I./karch -c $< -o $@
instrs/i_arch.h: instr/INSTRS instr/instrs.py
@python3 instr/instrs.py
clean:
@rm */*.o
k.exe: $(obj) instrs/i_arch.h instr/INSTRS instr/instrs.py
@gcc -O2 -Wall $(obj) -o k.exe
@rm */*.o
test: all

0
as/Makefile Normal file
View File

4
as/k-as.py Normal file
View File

@ -0,0 +1,4 @@
#!/usr/bin/python3

25
pc/Makefile Normal file
View File

@ -0,0 +1,25 @@
# The OS/K Team licenses this file to you under the MIT license.
# See the LICENSE file in the project root for more information.
all: k.exe
src = instrs.c decd.c main.c regs.c \
dump.c jumps.c
obj = $(patsubst %.c,%.o,$(src))
%.o: %.c instrs/i_arch.h */*.h $(src)
@gcc -O2 -Wall -I./karch -c $< -o $@
instrs/i_arch.h: INSTRS instrs.py
@python3 instrs.py
.PHONY: clean
clean:
@rm *.o
k.exe: $(obj) i_arch.h INSTRS instrs.py
@gcc -O2 -Wall $(obj) -o ../k.exe
@rm *.o

View File

@ -1,4 +1,4 @@
#!/usr/bin/python
#!/usr/bin/python3
# The OS/K Team licences this file to you under the MIT license.
# See the LICENSE file in the project root for more information.