From: hachti Date: Tue, 29 May 2007 22:44:50 +0000 (+0000) Subject: *** empty log message *** X-Git-Url: http://gitweb.hachti.de/?a=commitdiff_plain;h=047c458fe956cb5142870d3095ae22215c55a100;p=h316.git *** empty log message *** --- diff --git a/Makefile b/Makefile index aee696b..8480e37 100644 --- a/Makefile +++ b/Makefile @@ -20,9 +20,7 @@ SUBDIRS+=systems SUBDIRS+=programs/fortran # And all other H316 tools depending on all the other stuff -SUBDIRS+=programs/mandelbrot\ - programs/punchomat\ - +SUBDIRS+=programs #lib/fortran/vpunch-help diff --git a/lib/iolib/src/pl$u.asm b/lib/iolib/src/pl$u.asm index 4c0dcb6..4c23c64 100644 --- a/lib/iolib/src/pl$u.asm +++ b/lib/iolib/src/pl$u.asm @@ -48,7 +48,6 @@ PADR EQU '40 PORT ADDRESS OF THE PLOTTER INTERFACE * * - SUBR PL$UP,UP SUBR PL$U,UP SUBR PL$D,DOWN SUBR PL$R,RGHT diff --git a/programs/Makefile b/programs/Makefile new file mode 100644 index 0000000..a0063a1 --- /dev/null +++ b/programs/Makefile @@ -0,0 +1,12 @@ + +MODULES=first-steps fortran mandelbrot plotter\ + punchomat small-things tools + + +%: + @$(foreach mod,$(MODULES),$(MAKE) -C $(mod) $@;) + +katzelmutelbrummsilalla: + @$(foreach mod,$(MODULES),$(MAKE) -C $(mod);) + +.PHONY:default \ No newline at end of file diff --git a/programs/first-steps/Makefile b/programs/first-steps/Makefile new file mode 100644 index 0000000..17cd216 --- /dev/null +++ b/programs/first-steps/Makefile @@ -0,0 +1,26 @@ +# Universal Makefile for X16 code + + +ASM_CMD=$(H316)/bin/asm +FRTN_CMD=$(H316)/bin/frtn +SRC_DIR=src +BUILD_DIR=build + +PROGRAMS=$(foreach n, $(wildcard $(SRC_DIR)/*.f $(SRC_DIR)/*.asm),$(notdir $(basename $(n)))) + +#$(PROGRAMS):%:/$(BUILD_DIR)/%.f + +default: $(foreach prog, $(PROGRAMS),$(BUILD_DIR)/$(prog).obj) + +$(BUILD_DIR)/%.obj:$(SRC_DIR)/%.f + @if [ ! -d $(BUILD_DIR) ]; then mkdir $(BUILD_DIR); fi + $(FRTN_CMD) $< && mv $(notdir $(basename $<)).obj $(BUILD_DIR) + +$(BUILD_DIR)/%.obj:$(SRC_DIR)/%.asm + @if [ ! -d $(BUILD_DIR) ]; then mkdir $(BUILD_DIR); fi + $(ASM_CMD) $< && mv $(notdir $(basename $<)).obj $(BUILD_DIR) + +clean : + @rm -rf *.obj $(BUILD_DIR)/ *.lst *.go *.par + +.PHONY: default clean diff --git a/programs/mandelbrot/Makefile b/programs/mandelbrot/Makefile index b1bd6d8..17cd216 100644 --- a/programs/mandelbrot/Makefile +++ b/programs/mandelbrot/Makefile @@ -1,27 +1,26 @@ -# Makefile für Apfelmännchenprogramm +# Universal Makefile for X16 code -ASM=$(H316)/bin/asm -FRTN=$(H316)/bin/frtn -default: build/apfel3.obj build/apfel4.obj +ASM_CMD=$(H316)/bin/asm +FRTN_CMD=$(H316)/bin/frtn +SRC_DIR=src +BUILD_DIR=build -build/apfel3.obj : src/apfel3.f - @if [ ! -d build ]; then mkdir build; fi - $(FRTN) src/apfel3.f && mv apfel3.obj build +PROGRAMS=$(foreach n, $(wildcard $(SRC_DIR)/*.f $(SRC_DIR)/*.asm),$(notdir $(basename $(n)))) +#$(PROGRAMS):%:/$(BUILD_DIR)/%.f -build/apfel4.obj : src/apfel4.f - @if [ ! -d build ]; then mkdir build; fi - $(FRTN) src/apfel4.f && mv apfel4.obj build +default: $(foreach prog, $(PROGRAMS),$(BUILD_DIR)/$(prog).obj) -clean : - @rm -rf *.obj build/ *.lst *.go *.par - -.PHONY: default clean +$(BUILD_DIR)/%.obj:$(SRC_DIR)/%.f + @if [ ! -d $(BUILD_DIR) ]; then mkdir $(BUILD_DIR); fi + $(FRTN_CMD) $< && mv $(notdir $(basename $<)).obj $(BUILD_DIR) +$(BUILD_DIR)/%.obj:$(SRC_DIR)/%.asm + @if [ ! -d $(BUILD_DIR) ]; then mkdir $(BUILD_DIR); fi + $(ASM_CMD) $< && mv $(notdir $(basename $<)).obj $(BUILD_DIR) -%.obj:%.f - $(FRTN) $^ +clean : + @rm -rf *.obj $(BUILD_DIR)/ *.lst *.go *.par -%.obj:%.asm - $(ASM) $^ \ No newline at end of file +.PHONY: default clean diff --git a/programs/plotter/Makefile b/programs/plotter/Makefile new file mode 100644 index 0000000..17cd216 --- /dev/null +++ b/programs/plotter/Makefile @@ -0,0 +1,26 @@ +# Universal Makefile for X16 code + + +ASM_CMD=$(H316)/bin/asm +FRTN_CMD=$(H316)/bin/frtn +SRC_DIR=src +BUILD_DIR=build + +PROGRAMS=$(foreach n, $(wildcard $(SRC_DIR)/*.f $(SRC_DIR)/*.asm),$(notdir $(basename $(n)))) + +#$(PROGRAMS):%:/$(BUILD_DIR)/%.f + +default: $(foreach prog, $(PROGRAMS),$(BUILD_DIR)/$(prog).obj) + +$(BUILD_DIR)/%.obj:$(SRC_DIR)/%.f + @if [ ! -d $(BUILD_DIR) ]; then mkdir $(BUILD_DIR); fi + $(FRTN_CMD) $< && mv $(notdir $(basename $<)).obj $(BUILD_DIR) + +$(BUILD_DIR)/%.obj:$(SRC_DIR)/%.asm + @if [ ! -d $(BUILD_DIR) ]; then mkdir $(BUILD_DIR); fi + $(ASM_CMD) $< && mv $(notdir $(basename $<)).obj $(BUILD_DIR) + +clean : + @rm -rf *.obj $(BUILD_DIR)/ *.lst *.go *.par + +.PHONY: default clean diff --git a/programs/plotter/src/nikolaussiedlung.f b/programs/plotter/src/nikolaussiedlung.f index 9a45c5e..7020a1a 100644 --- a/programs/plotter/src/nikolaussiedlung.f +++ b/programs/plotter/src/nikolaussiedlung.f @@ -2,15 +2,14 @@ C PLOTTER TEST PROGRAM C C CALL PL$RST - CALL PL$PD - CALL PL$MV(610,0) - CALL PL$MV(610,95) + CALL PL$MV(550,0) + CALL PL$MV(550,95) CALL PL$MV(0,95) CALL PL$MV(0,0) CALL PL$MV(1,1) - CALL PL$MV(609,1) - CALL PL$MV(609,94) + CALL PL$MV(549,1) + CALL PL$MV(549,94) CALL PL$MV(1,94) CALL PL$MV(1,1) CALL PL$PU @@ -28,7 +27,7 @@ C CALL PL$MV(0,0) CALL PL$MV(50,0) CALL PL$PU - CALL PL$MV(60,0) + CALL PL$MV(55,0) 1000 CONTINUE CALL PL$MV(-540,-10) C diff --git a/programs/plotter/src/pentagramm.f b/programs/plotter/src/pentagramm.f new file mode 100644 index 0000000..e7270f0 --- /dev/null +++ b/programs/plotter/src/pentagramm.f @@ -0,0 +1,44 @@ +C +C +C +C + INTEGER X,Y + INTEGER RADIUS + REAL RADIUR,RADF +C + RADIUS=100 + RADIUR=RADIUS + PI=3.14159265 + RADF=(2.0*PI)/360.0 +C + CALL PL$RST + CALL PL$MV(RADIUS,RADIUS) + CALL PL$RST +C + + DO 2000 I=0,362,1 + P=I + PHI=P*RADF + X=COS(PHI)*RADIUR + Y=SIN(PHI)*RADIUR + CALL PL$MV(X,Y) + IF (I.EQ.0) CALL PL$PD + 2000 CONTINUE + CALL PL$PU + DO 1000 I=0,720,144 + P=I-18 + PHI=P*RADF + X=COS(PHI)*RADIUR + Y=SIN(PHI)*RADIUR + CALL PL$MV(X,Y) + IF (I.EQ.0) CALL PL$PD + 1000 CONTINUE + + CALL PL$PU + CALL PL$MV(-RADIUS,-RADIUS) + CALL PL$RST +C +C + CALL REBOOT + END +$0 diff --git a/programs/small-things/Makefile b/programs/small-things/Makefile new file mode 100644 index 0000000..17cd216 --- /dev/null +++ b/programs/small-things/Makefile @@ -0,0 +1,26 @@ +# Universal Makefile for X16 code + + +ASM_CMD=$(H316)/bin/asm +FRTN_CMD=$(H316)/bin/frtn +SRC_DIR=src +BUILD_DIR=build + +PROGRAMS=$(foreach n, $(wildcard $(SRC_DIR)/*.f $(SRC_DIR)/*.asm),$(notdir $(basename $(n)))) + +#$(PROGRAMS):%:/$(BUILD_DIR)/%.f + +default: $(foreach prog, $(PROGRAMS),$(BUILD_DIR)/$(prog).obj) + +$(BUILD_DIR)/%.obj:$(SRC_DIR)/%.f + @if [ ! -d $(BUILD_DIR) ]; then mkdir $(BUILD_DIR); fi + $(FRTN_CMD) $< && mv $(notdir $(basename $<)).obj $(BUILD_DIR) + +$(BUILD_DIR)/%.obj:$(SRC_DIR)/%.asm + @if [ ! -d $(BUILD_DIR) ]; then mkdir $(BUILD_DIR); fi + $(ASM_CMD) $< && mv $(notdir $(basename $<)).obj $(BUILD_DIR) + +clean : + @rm -rf *.obj $(BUILD_DIR)/ *.lst *.go *.par + +.PHONY: default clean diff --git a/programs/tools/Makefile b/programs/tools/Makefile index 54afeb8..17cd216 100644 --- a/programs/tools/Makefile +++ b/programs/tools/Makefile @@ -1,32 +1,26 @@ -# Makefile for assembler sources +# Universal Makefile for X16 code -SRC_DIR = src -OBJ_DIR = build -LIB_DIR = lib -MODULES = binal cleanup cleanup2 restart +ASM_CMD=$(H316)/bin/asm +FRTN_CMD=$(H316)/bin/frtn +SRC_DIR=src +BUILD_DIR=build -FRTN_COMMAND = frtn -ASM_COMMAND = asm +PROGRAMS=$(foreach n, $(wildcard $(SRC_DIR)/*.f $(SRC_DIR)/*.asm),$(notdir $(basename $(n)))) -SRC_FILES = $(foreach obj, $(MODULES),$(obj).asm) -OBJ_FILES = $(SRC_FILES:.asm=.obj) -OBJ_FILES_FULL = $(foreach file, $(OBJ_FILES),$(OBJ_DIR)/$(file)) +#$(PROGRAMS):%:/$(BUILD_DIR)/%.f -########################################## +default: $(foreach prog, $(PROGRAMS),$(BUILD_DIR)/$(prog).obj) -obj : $(OBJ_FILES_FULL) +$(BUILD_DIR)/%.obj:$(SRC_DIR)/%.f + @if [ ! -d $(BUILD_DIR) ]; then mkdir $(BUILD_DIR); fi + $(FRTN_CMD) $< && mv $(notdir $(basename $<)).obj $(BUILD_DIR) -$(OBJ_FILES_FULL):$(OBJ_DIR)/%.obj:$(SRC_DIR)/%.asm - @echo Building: $(subst $$,\$$,$@) - @if [ ! -d $(OBJ_DIR) ]; then mkdir $(OBJ_DIR); fi - @ rm -f $@ - @ cd $(OBJ_DIR) && $(ASM_COMMAND) ../$(subst $$,\$$,$^) -# @ cd $(OBJ_DIR) && ldc -s -l $(notdir $(subst $$,\$$,$@)) +$(BUILD_DIR)/%.obj:$(SRC_DIR)/%.asm + @if [ ! -d $(BUILD_DIR) ]; then mkdir $(BUILD_DIR); fi + $(ASM_CMD) $< && mv $(notdir $(basename $<)).obj $(BUILD_DIR) -clean: - @echo Cleaning up. - @rm -rf $(OBJ_DIR) $(LIB_DIR) *.lst *.go - -.PHONY: clean all org obj libs +clean : + @rm -rf *.obj $(BUILD_DIR)/ *.lst *.go *.par +.PHONY: default clean diff --git a/programs/tools/src/asr-test.asm b/programs/tools/src/asr-test.asm index 763b8d5..93fa3ad 100644 --- a/programs/tools/src/asr-test.asm +++ b/programs/tools/src/asr-test.asm @@ -33,7 +33,7 @@ PRT DAC ** STA 0 * *SPIEL BEGINNT: -RND LDA 0 +RND LDA 0 SUB EP SNZ * SKIP WENN SP=EP >> FERTIG @@ -56,7 +56,7 @@ RND LDA 0 ***************************************************** *PAUSE CYC DEC 0 -CNT DEC ** +CNT DEC 0 PAUS DAC ** LDA CYC STA CNT @@ -80,8 +80,8 @@ TTY1 DAC ** * MAIN ROUTINE * MAIN SR1 -MAIN2 JST PRT - SR2 +MAI2 JST PRT + SR2 JST PAUS SR3 JST TTY1 diff --git a/programs/tools/src/copy.asm b/programs/tools/src/copy.asm deleted file mode 100644 index d20ea87..0000000 --- a/programs/tools/src/copy.asm +++ /dev/null @@ -1,85 +0,0 @@ -* COPY - COPY PTR TO PTP -* -* -* -* - SUBR COPY,STRT - REL ASSEMBLE IN RELOCATABLE MODE - ORG 0 -* -*********************** -* MAIN LOOP -STRT - - OCP '102 START PTR ??? - OCP '104 START PTP ??? - LDA ABUF FIRST BUFFER ADDRESS - STA WBUF TO WRITE POINTER - STA RBUF TO READ POINTER - - JST READ - JST WRIT - JMP STRT -* -* -*********************** -* READ ROUTINE -READ DAC ** - SS1 SKIP IF SW1 SET - JMP* READ RETURN - LDA RPTR READ POINTER - CMP WPTR COMPARE WRITE POINTER - SKP SKIP - - -*********************** -* WRITE ROUTINE -WRIT DAC ** - SS2 SKIP IF SW1 SET - JMP* WRIT RETURN - - -RPTR DAC ** READ POINTER -WPTR DAC ** WRITE POINTER -ABUF OCT '1000 FIRST BUFFER LOCATION -EBUF OCT '2000 LAST BUFFER LOCATION - - - -STRT JMP ST2 JUMP OVER CONSTANTS -ANFA OCT 20 -ENDE DAC STRT-1 -ST2 LDA ANFA LOAD START ADDRESS - STA PTR -LOOP CRA - STA* PTR STORE THE ZERO - LDA PTR - SUB ENDE TEST FOR - SNZ LAST LOCATION? - JMP RDY IF LAST LOCATION, END - IRS PTR - JMP LOOP NO OVERFLOW - HLT OVERFLOW OCCURED -RDY OCP '104 ASR START -* - LDA KO - JST PRNT - LDA LFCR - JST PRNT - HLT - JMP STRT RESTART :-) -******* -KO BCI 1,KO -LFCR OCT '6412 -******* -PRNT DAC ** - OTA 4 OUTPUT CHAR - JMP *-1 REPEAT UNTIL POSSIBLE - ICA NEXT CHAR - OTA 4 - JMP *-1 - JMP* PRNT RETURN -***** -PTR DEC 0 LOCATION POINTER -***** - END