*** empty log message ***
authorhachti <hachti>
Tue, 29 May 2007 22:44:50 +0000 (22:44 +0000)
committerhachti <hachti>
Tue, 29 May 2007 22:44:50 +0000 (22:44 +0000)
12 files changed:
Makefile
lib/iolib/src/pl$u.asm
programs/Makefile [new file with mode: 0644]
programs/first-steps/Makefile [new file with mode: 0644]
programs/mandelbrot/Makefile
programs/plotter/Makefile [new file with mode: 0644]
programs/plotter/src/nikolaussiedlung.f
programs/plotter/src/pentagramm.f [new file with mode: 0644]
programs/small-things/Makefile [new file with mode: 0644]
programs/tools/Makefile
programs/tools/src/asr-test.asm
programs/tools/src/copy.asm [deleted file]

index aee696b1a9f606baa71281f6c60316b2661f4236..8480e37c3cda585ca91fa79352c34fbd2550b872 100644 (file)
--- 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
 
index 4c0dcb61cf97a0a93e6c10e5209fe90d0a5429ff..4c23c6496ff4ed39816aa5fccbd84d70c65043af 100644 (file)
@@ -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 (file)
index 0000000..a0063a1
--- /dev/null
@@ -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 (file)
index 0000000..17cd216
--- /dev/null
@@ -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
index b1bd6d840a8d0c9e515cb31642553064bae506b4..17cd216d8e0636afe46bc133704e75ba15b1ca7b 100644 (file)
@@ -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 (file)
index 0000000..17cd216
--- /dev/null
@@ -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
index 9a45c5e47df5b2fe993f5e8d5459f707d12443cc..7020a1a1d2847e9d4d6c6b0f75c1120daf602673 100644 (file)
@@ -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 (file)
index 0000000..e7270f0
--- /dev/null
@@ -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 (file)
index 0000000..17cd216
--- /dev/null
@@ -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
index 54afeb8c8743ef1e500ad4c661b1a6f1c689ab4c..17cd216d8e0636afe46bc133704e75ba15b1ca7b 100644 (file)
@@ -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
index 763b8d5afefe5bca900512d57a85cc3708ede4fc..93fa3adff6d8610ec0ce8c7c866349d509329271 100644 (file)
@@ -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     
+MAI  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 (file)
index d20ea87..0000000
+++ /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