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
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
--- /dev/null
+
+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
--- /dev/null
+# 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
-# 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
--- /dev/null
+# 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
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
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
--- /dev/null
+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
--- /dev/null
+# 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
-# 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
STA 0
*
*SPIEL BEGINNT:
-RND LDA 0
+RND LDA 0
SUB EP
SNZ
* SKIP WENN SP=EP >> FERTIG
*****************************************************
*PAUSE
CYC DEC 0
-CNT DEC **
+CNT DEC 0
PAUS DAC **
LDA CYC
STA CNT
* MAIN ROUTINE
*
MAIN SR1
-MAIN2 JST PRT
- SR2
+MAI2 JST PRT
+ SR2
JST PAUS
SR3
JST TTY1
+++ /dev/null
-* 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