From eabafccaa9119c64c3964f25035a71579de18ddd Mon Sep 17 00:00:00 2001 From: hachti Date: Mon, 25 Aug 2008 21:02:23 +0000 Subject: [PATCH] *** empty log message *** --- Makefile | 1 + config/libs.config | 6 +- lib/fortran/recipe/flib3.recipe | 6 +- lib/hachti/Makefile | 29 +- lib/hachti/font.config | 82 ++++ lib/hachti/recipe/hachti.recipe | 13 +- lib/hachti/src/matrix.asm | 484 +++++++++++++++++--- lib/hachti/src/pl$mv.asm | 343 ++++++++++---- lib/hachti/src/pl$txt.asm | 242 +++------- lib/hachti/src/pl$u.asm | 20 +- lib/hachti/src/stack.asm | 178 +++++-- pc-tools/ldc2/src/config.cpp | 8 +- pc-tools/ldc2/src/configuration_manager.cpp | 8 +- pc-tools/ldc2/src/main.cpp | 9 +- programs/libtest/src/plotter-matrix.f | 57 ++- programs/plotter/src/nikolaussiedlung.f | 2 + 16 files changed, 1093 insertions(+), 395 deletions(-) create mode 100644 lib/hachti/font.config diff --git a/Makefile b/Makefile index 62e8d98..c092b95 100644 --- a/Makefile +++ b/Makefile @@ -35,6 +35,7 @@ default: clean: @mklink.sh @$(foreach subdir, $(SUBDIRS), $(MAKE) -C $(subdir) $@&&) true + @rm -f h316rc @rmlink.sh %: diff --git a/config/libs.config b/config/libs.config index ce5f3c5..9c4acdf 100644 --- a/config/libs.config +++ b/config/libs.config @@ -2,14 +2,12 @@ # Libraries used by fload, frun and fboot: LOAD_LIBS="\ $H316/lib/hachti/lib/hachti.lib\ - $H316/lib/fortran/lib/math.lib\ - $H316/lib/fortran/lib/math.lib\ - $H316/lib/fortran/lib/math.lib\ - $H316/lib/fortran/lib/math.lib\ $H316/lib/fortran/lib/flib1.lib\ $H316/lib/fortran/lib/flib2.lib\ $H316/lib/fortran/lib/flib3.lib\ + $H316/lib/fortran/lib/math.lib\ $H316/lib/iolib/lib/io.lib\ + $H316/lib/hachti/lib/stack.lib\ " #LOAD_LIBS="\ diff --git a/lib/fortran/recipe/flib3.recipe b/lib/fortran/recipe/flib3.recipe index 3cfe653..2849d03 100644 --- a/lib/fortran/recipe/flib3.recipe +++ b/lib/fortran/recipe/flib3.recipe @@ -21,7 +21,7 @@ org/F$B5 org/F$F5 org/F$IO org/F$HT - obj/PCHAR - obj/LPCHAR - obj/UCHAR +# obj/PCHAR +# obj/LPCHAR +# obj/UCHAR obj/REBOOT diff --git a/lib/hachti/Makefile b/lib/hachti/Makefile index c24f3be..24a97d4 100644 --- a/lib/hachti/Makefile +++ b/lib/hachti/Makefile @@ -12,12 +12,15 @@ export ORG_OBJDIR=org export MAKE -MODULES = font pl$$mv pl$$txt pl$$u stack matrix +MODULES = font pl$$mv pl$$txt pl$$u stack matrix endlib oct +F4_MODULES=pmat graphics -FRTN_COMMAND = frtn_original +FRTN_COMMAND = frtn ASM_COMMAND = asm_original LDC_COMMAND = ldc -saq +include font.config + ############# RECIPES=$(foreach recipe,$(shell ls $(RECIPE_DIR) | egrep "recipe$$" | grep -v CVS),\ @@ -30,8 +33,9 @@ OBJECTS=$(shell cat $(RECIPES)|egrep -v '^[[:space:]]*(\#.*)*$$'|\ #|sort -u OBJECT_FILES=$(foreach obj, $(MODULES), $(OBJ_DIR)/$(obj).obj) -SOURCE_FILES=$(foreach obj, $(MODULES), $(SRC_DIR)/$(obj).asm) - +F4_OBJECT_FILES=$(foreach obj, $(F4_MODULES), $(OBJ_DIR)/$(obj).obj) +#ASM_FILES=$(foreach obj, $(MODULES), $(SRC_DIR)/$(obj).asm) +#FORTRAN_FILES=$(foreach obj, $(MODULES), $(SRC_DIR)/$(obj).f) #************ #tmp: # @echo $(subst $$,\$$, $(OBJECTS)) @@ -42,23 +46,32 @@ $(ORG_OBJDIR)/lastrun: $(ORG_LIBDIR)/* @if [ ! -d $(OBJ_DIR) ]; then mkdir $(OBJ_DIR); fi @./buildlib.sh makeorg -$(OBJECTS): $(OBJECT_FILES) +$(OBJECTS): $(OBJECT_FILES) $(F4_OBJECT_FILES) @#$(MAKE) $(subst $$,\$$,$?) -$(OBJECT_FILES) : $(OBJ_DIR)/%.obj : $(SRC_DIR)/%.asm +$(OBJECT_FILES):$(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 $$,\$$,$^) $(LISTING) @ cd $(OBJ_DIR) && $(LDC_COMMAND) $(notdir $(subst $$,\$$,$@)) + +$(F4_OBJECT_FILES):$(OBJ_DIR)/%.obj : $(SRC_DIR)/%.f +# @echo Building: $(subst $$,\$$,$@) + @if [ ! -d $(OBJ_DIR) ]; then mkdir $(OBJ_DIR); fi + @ rm -f $@ + @ cd $(OBJ_DIR) && $(FRTN_COMMAND) ../$(subst $$,\$$,$^) + @ cd $(OBJ_DIR) && $(LDC_COMMAND) $(notdir $(subst $$,\$$,$@)) + + # $(ORG_OBJDIR)/lastrun $(LIBS):$(LIB_DIR)/%.lib: $(RECIPE_DIR)/%$(RECIPE_SUFFIX) $(OBJECTS) @./buildlib.sh genlib $(RECIPE_DIR)/$(basename $(notdir $@))$(RECIPE_SUFFIX) -src/font.asm: - @ln -sf $(shell pwd)/fonts/font_hp_charset0_2.asm $(shell pwd)/src/font.asm +src/font.asm: font.config fonts/*.asm + @ln -sf $(shell pwd)/fonts/font_$(FONT).asm $(shell pwd)/src/font.asm clean: @rm -rf $(OBJ_DIR) $(LIB_DIR) *.lst *.go src/font.asm *.obj *~ *.par \ diff --git a/lib/hachti/font.config b/lib/hachti/font.config new file mode 100644 index 0000000..83ae8d9 --- /dev/null +++ b/lib/hachti/font.config @@ -0,0 +1,82 @@ + +#FONT=astrology +#FONT=cursive +#FONT=cyrilc +#FONT=futural +#FONT=futuram +#FONT=gothgbt +#FONT=gothgrt +#FONT=gothicita +#FONT=gothitt +#FONT=greekc +#FONT=greekcs +#FONT=greekp +#FONT=greeks +#FONT=hp_charset0_1 +#FONT=hp_charset0_2 +#FONT=hp_charset0_3 +#FONT=hp_charset0_4 +#FONT=hp_charset1_1 +#FONT=hp_charset1_2 +#FONT=hp_charset1_3 +#FONT=hp_charset1_4 +#FONT=hp_charset173_1 +#FONT=hp_charset173_2 +#FONT=hp_charset173_3 +#FONT=hp_charset173_4 +#FONT=hp_charset205_1 +#FONT=hp_charset205_2 +#FONT=hp_charset205_3 +#FONT=hp_charset205_4 +#FONT=hp_charset2_1 +#FONT=hp_charset2_2 +#FONT=hp_charset2_3 +#FONT=hp_charset2_4 +#FONT=hp_charset3_1 +#FONT=hp_charset3_2 +#FONT=hp_charset3_3 +#FONT=hp_charset3_4 +#FONT=hp_charset4_1 +#FONT=hp_charset4_2 +#FONT=hp_charset4_3 +#FONT=hp_charset4_4 +#FONT=hp_charset5_1 +#FONT=hp_charset5_2 +#FONT=hp_charset5_3 +#FONT=hp_charset5_4 +#FONT=hp_charset6_1 +#FONT=hp_charset6_2 +#FONT=hp_charset6_3 +#FONT=hp_charset6_4 +#FONT=hp_charset7_1 +#FONT=hp_charset7_2 +#FONT=hp_charset7_3 +#FONT=hp_charset7_4 +#FONT=italicc +#FONT=italiccs +#FONT=italict +#FONT=markers +#FONT=mathlow +#FONT=mathupp +#FONT=meteorology +#FONT=music +# Problem mit dem a! +#FONT=romant +#FONT=romancs +#FONT=romand +#FONT=romanp +#FONT=romans + +# Romant Macht J über o! +#FONT=romant +#FONT=rowmand +#FONT=rowmans +#FONT=rowmant +FONT=scriptc +#FONT=scripts +#FONT=symbolic +#FONT=timesg +#FONT=timesi +#FONT=timesib +#FONT=timesr +#FONT=timesrb diff --git a/lib/hachti/recipe/hachti.recipe b/lib/hachti/recipe/hachti.recipe index 1ef6823..58247cb 100644 --- a/lib/hachti/recipe/hachti.recipe +++ b/lib/hachti/recipe/hachti.recipe @@ -1,3 +1,9 @@ + +# Graphics games +obj/BOX +obj/SQUARE + + # Text driver obj/PL$TXT @@ -13,8 +19,9 @@ obj/PL$U # Text Font (Selected in makefile) obj/PL$FNT -# Stack operations -obj/STACK - +# Matrix debug +obj/PMAT +# Integer output +obj/OCT diff --git a/lib/hachti/src/matrix.asm b/lib/hachti/src/matrix.asm index 812fd23..79202db 100644 --- a/lib/hachti/src/matrix.asm +++ b/lib/hachti/src/matrix.asm @@ -91,7 +91,7 @@ * M= | | * | 0.0 1.0 | * -* WICH RESULTS TO THE IDENTITY TRANSFORMATION. +* WHICH RESULTS TO THE IDENTITY TRANSFORMATION. * * JST M$INIT * DAC MATRIX POINTER TO A MATRIX @@ -112,24 +112,29 @@ * * THIS ROUTINE CONVERTS THE VECTOR ELEMENTS TO FLOATING POINT VALUES, * APPLIES THE TRANSFORMATION TO THEM AND ROUNDS THE RESULTS BACK TO -* INTEGER VALUES. THEN IT SAVES THE NEW VECTOR IN THE PLACE OF THE -* OLD VECTOR. +* INTEGER VALUES. THEN IT SAVES THE NEW VECTOR TO THE LOCATION +* DESIGNATED BY THE TARGET ADDRESS. SOURCE AND TARGET MAY BE THE SAME, +* THE SOURCE'S CONTENTS ARE NOT ALTERED. * * JST M$APLI * DAC MATRIX MATRIX TO APPLY -* DAC VECTOR VECTOR TO TRANSFORM +* DAC TARGET POINTER TO TARGET VECTOR +* DAC SOURCE VECTOR TO TRANSFORM * DAC 0 FOR FORTRAN IV COMPATIBILITY * * * M$APII: APPLY MATRIX TO PAIR OF INTEGERS AS VECTOR * -* THIS ROUTINE USES TWO DISTINCT INTEGER POINTERS INSTEAD OF ONE VECTOR -* POINTER. THE REST OF THE BEHAVIOR IS EXACTLY LIKE M$APL. +* THIS ROUTINE USES TWO DISTINCT INTEGER POINTERS TO DESCRIBE A POINT. +* THE REST OF THE BEHAVIOR IS EXACTLY LIKE M$APL. * -* JST M$APLI +* JST M$APII * DAC MATRIX MATRIX TO APPLY -* DAC X X COORDINATE OF ARGUMENT VECTOR -* DAC Y Y COORDINATE OF ARGUMENT VECTOR +* DAC XO X COORDINATE OF RESULT VECTOR +* DAC XO Y COORDINATE OF RESULT VECTOR +* DAC XI X COORDINATE OF ARGUMENT VECTOR +* DAC YI Y COORDINATE OF ARGUMENT VECTOR +* DAC 0 FOR FORTRAN IV COMPATIBILITY * * * M$ROT: ROTATE MATRIX @@ -146,6 +151,17 @@ * DAC ANGLE RADIANT ANGLE * DAC 0 FOR FORTRAN IV COMPATIBILITY * +* +* M$ROTI: ROTATE MATRIX +* +* WORKS LIKE M$ROT, BUT TAKES AN INTEGER DEGREE VALUE AS ARGUMENT. +* +* JST M$ROTI +* DAC MATRIX MATRIX TO MODIFY +* DAC ANGLE DEGREE ANGLE +* DAC 0 FOR FORTRAN IV COMPATIBILITY +* +* * M$SCLE: SCALE MATRIX * * THIS ROUTINE WORKS SIMILAR TO M$ROT BUT SCALES THE ARGUMENT MATRIX. @@ -156,7 +172,87 @@ * DAC SCALE SCALE FACTOR * DAC 0 FOR FORTRAN IV COMPATIBILITY * -* +* +********************************************************************************* +* +* +* T$INIT: INITIALISE AFFINE TRANSFORM +* +* JST T$INIT +* DAC TRANS POINTER TO AFFINE TRANSFORMATION (SEE ABOVE) +* +* +* T$SCLE: SCALE AFFINE TRANSFORMATION +* +* THIS SCALES THE MATRIX OF THE AFFINE TRANSFORMATION BY FACTOR SCALE. +* CALLS M$SCLE INTERNALLY. +* +* JST T$SCLE +* DAC TRANS TRANSFORMATION TO MODIFY +* DAC SCALE SCALE FACTOR +* DAC 0 FOR FORTRAN IV COMPATIBILITY +* +* +* T$TRAN: ADD RELOCATION TO AFFINE TRANSFORMATION +* +* THE OFFSET VECTOR IS FIRST PROCESSED BY THE TRANSFORMATION. +* THEN IT IS ADDED TO THE TRANSFORMATION'S TRANSLATION VECTOR. +* +* JST T$TRAN +* DAC TRANS TRANSFORMATION TO MODIFY +* DAC XOFF X OFFSET +* DAC YOFF Y OFFSET +* DAC 0 FOR FORTRAN IV COMPATIBILITY +* +* +* T$ROT: ADD ROTATION TO AFFINE TRANSFORMATION +* +* ADDS ROTATION TO THE MATRIX OF THE AFFINE TRANSFORMATION. +* CALLS M$$ROT INTERNALLY. +* +* JST T$ROT +* DAC TRANS TRANSFORMATION TO MODIFY +* DAC ANGLE ANGLE LIKE FOR M$ROT +* DAC 0 FOR FORTRAN IV COMPATIBILITY +* +* +* T$ROTI: ADD ROTATION TO AFFINE TRANSFORMATION +* USES AN INTEGER ARGUMENT INSTEAD OF FLOATING POINT RADIANT. +* +* ADDS ROTATION TO THE MATRIX OF THE AFFINE TRANSFORMATION. +* CALLS M$$ROTI INTERNALLY. +* +* JST T$ROTI +* DAC TRANS TRANSFORMATION TO MODIFY +* DAC ANGLE ANGLE LIKE FOR M$ROTI +* DAC 0 FOR FORTRAN IV COMPATIBILITY +* +* +* T$APII: APPLY AFFINE TRANSFORM TO PAIR OF INTEGERS AS VECTOR +* +* WORKS LIKE M$APII WHICH IS USED INTERNALLY. +* +* JST T$APII +* DAC TRANS TRANSFORMATION TO USE +* DAC XO X COORDINATE OF RESULT VECTOR +* DAC XO Y COORDINATE OF RESULT VECTOR +* DAC XI X COORDINATE OF ARGUMENT VECTOR +* DAC YI Y COORDINATE OF ARGUMENT VECTOR +* DAC 0 FOR FORTRAN IV COMPATIBILITY +* +* +* T$APLI: APPLY AFFINE TRANSFORM TO VECTOR +* +* WORKS LIKE M$APL WHICH IS USED INTERNALLY. +* +* JST T$APLI +* DAC TRANS +* DAC TARGET POINTER TO TARGET VECTOR +* DAC SOURCE POINTER TO INPUT VECTOR +* DAC 0 FOR FORTRAN IV COMPATIBILITY +* +* +* ******************************************************************************** * **** EXPORTED SYMBOLS @@ -167,10 +263,19 @@ SUBR M$APLI,APLI APPLY MATRIX TO INTEGER VECTOR SUBR M$APII,APII APPLY MATRIX TO PAIR OF INTEGERS SUBR M$ROT,ROT ADD ROTATION TO MATRIX + SUBR M$ROTI,ROTI ADD ROTATION TO MATRIX SUBR M$SCLE,SCLE SCALE MATRIX + SUBR M$SCLI,SCLI SCALE MATRIX (INTEGER PERCENT) * - SUBR A$INIT,AFIN INITIALISE AFFINE TRANSFORMATION -* + SUBR T$INIT,AFIN INITIALISE AFFINE TRANSFORMATION + SUBR T$APLI,TPLI APPLY AFFINE TRANSFORM TO INTEGER VECTOR + SUBR T$APII,TPII APPLY AFFINE TRANSFORM TO PAIR OF INTEGERS + SUBR T$ROT,ROT ADD ROTATION TO AFFINE TRANSFORMATION + SUBR T$ROTI,ROTI ADD ROTATION TO AFFINE TRANSFORMATION + SUBR T$SCLE,SCLE SCALE AFFINE TRANSFORMATION + SUBR T$SCLI,SCLI SCALE AFFINE TRANSFORMATION (INTEGER PERCENT) + SUBR T$TRAN,TRAN ADD TRANSLATION TO AFFINE TRANSFORMATION +* * ******************************************************************************** * @@ -179,7 +284,148 @@ * * ******************************************************************************** -* +* +* +*** T$TRAN - TRANSLATE +* +* +* ABS +* ORG '4000 +TRAN DAC ** ENTRY. + LDA* TRAN TRANSFORMATION POINTER + STA TPT + ADD =8 + STA VECP + IRS TRAN +* + LDA* TRAN X OFFSET + STA XOFP + IRS TRAN +* + LDA* TRAN Y OFFSET + STA YOFP + IRS TRAN +* + IRS TRAN FOR FORTRAN IV +* + JST APII FIXME! +TPT DAC ** + DAC TMP3 STORE NEW X VALUE IN TMP3 + DAC TMP4 STORE NEW Y VALUE IN TMP4 +XOFP DAC ** +YOFP DAC ** + DAC 0 FOR FORTRAN IV COMPATIBILITY +* + LDA* VECP + ADD TMP3 + STA* VECP + IRS VECP + LDA* VECP + ADD TMP4 + STA* VECP +* + JMP* TRAN RETURN. +* +* +******************************************************************************** +* +* +**** T$APLI - APPLY AFFINE TRANSFORMATION TO INTEGER VECTOR +* +* USED VARIABLES: ((TMP1) XOP,YOP,XP1,YP1,XP2,YP2),VECP +* +TPLI DAC ** ENTRY. +* + LDA* TPLI LOAD POINTER TO TRANSFORMATION + STA MPT STORE TO MATRIX POINTER + ADD =8 FORWARD TO VECTOR ADDRESS IN TRANSFORMATION + STA VECP VECTOR ADDRESS + IRS TPLI +* + LDA* TPLI POINTER TO RESULT VECTOR + STA IOV + IRS TPLI +* + LDA* TPLI POINTER TO INPUT VECTOR + STA IIV + IRS TPLI +* + IRS TPLI +* + JST APLI APPLY MATRIX +MPT DAC ** +IOV DAC ** +IIV DAC ** +* + LDA* IOV PERFORM VECTOR ADDITION + ADD* VECP + STA* IOV + IRS VECP + IRS IOV + LDA* IOV + ADD* VECP + STA* IOV +* + JMP* TPLI +* +* +******************************************************************************** +* +* +**** T$APII - APPLY AFFINE TRANSFORMATION TO PAIR OF INTEGERS +* +* USED VARIABLES: ((TMP1) XOP,YOP,XP1,YP1,XP2,YP2),VECP +* +* +**************************************** +* +TPII DAC ** ENTRY. +* + LDA* TPII LOAD POINTER TO TRANSFORMATION + STA IMPT STORE TO MATRIX POINTER + ADD =8 FORWARD TO VECTOR ADDRESS IN TRANSFORMATION + STA VECP VECTOR ADDRESS + IRS TPII +* + LDA* TPII POINTER TO RESULT X + STA RXP + IRS TPII +* + LDA* TPII POINTER TO RESULT Y + STA RYP + IRS TPII +* + LDA* TPII POINTER TO INPUT X + STA IXP + IRS TPII +* + LDA* TPII POINTER TO INPUT Y + STA IYP + IRS TPII +* + IRS TPII +* + JST APII APPLY MATRIX +IMPT DAC ** +RXP DAC ** +RYP DAC ** +IXP DAC ** +IYP DAC ** + DAC 0 +* + LDA* VECP PERFORM THE ADDITION + ADD* RXP + STA* RXP + IRS VECP + LDA* VECP + ADD* RYP + STA* RYP +* + JMP* TPII RETURN +* +* +******************************************************************************** +* * **** INITIALIZE AFFINE TRANSFORMATION * @@ -211,24 +457,20 @@ AFI1 DAC ** * INIT DAC ** LDX* INIT LOAD INDEX REGISTER WITH ADDRESS OF MATRIX - LDA* INIT LOAD MATRIX ADDRESS - STA IM11 STORE POINTER TO FIRST ELEMENT (A11) - ADD =6 IM12,IM21 ARE NOT TO BE INITIALISED WITH FP DATA - STA IM22 STORE POINTER TO FOURTH ELEMENT (A22) IRS INIT CORRECT RETURN ADDRESS * CRA INITIALISE + STA 1,1 A11, LOWER BITS STA 2,1 A12 STA 3,1 STA 4,1 A21 - STA 5,1 - CALL FLOAT GENERATE FLOATING POINT 1.0 - DAC ONE CONSTANT INTEGER 1 - CALL H$22 STORE FLOATING POINT -IM11 DEC 0 - CALL H$22 -IM22 DEC 0 -* + STA 5,1 + STA 7,1 A22, LOWER BITS +* + LDA ONEF FLOATING POINT 1.0 CONSTANT + STA 0,1 A11, UPPER BITS + STA 6,1 A22, UPPER BITS +* JMP* INIT RETURN. * * @@ -334,34 +576,55 @@ PC22 DEC 0 **** SCALE MATRIX * SCLE DAC ** SCALE MATRIX - LDX* SCLE * LDA* SCLE GET MATRIX BASE ADDRESS STA SM11 STA TM11 - ADD =6 + ADD =2 + STA SM12 + STA TM12 + ADD =2 + STA SM21 + STA TM21 + ADD =2 STA SM22 STA TM22 IRS SCLE LDA* SCLE - STA SX - STA SY + STA S1 + STA S2 + STA S3 + STA S4 IRS SCLE TALLY RETURN ADDRESS IRS SCLE AGAIN * CALL L$22 -SM11 DAC 0 +SM11 DAC ** CALL M$22 -SX DAC 0 +S1 DAC ** CALL H$22 -TM11 DAC 0 +TM11 DAC ** * CALL L$22 -SM22 DAC 0 +SM12 DAC ** CALL M$22 -SY DAC 0 +S2 DAC ** CALL H$22 -TM22 DAC 0 +TM12 DAC ** +* + CALL L$22 +SM21 DAC ** + CALL M$22 +S3 DAC ** + CALL H$22 +TM21 DAC ** +* + CALL L$22 +SM22 DAC ** + CALL M$22 +S4 DAC ** + CALL H$22 +TM22 DAC ** * JMP* SCLE * @@ -539,10 +802,14 @@ R412 DAC ** * CALL: * JST M$APII * DAC MATRIX -* DAC X -* DAC Y +* DAC XO +* DAC YO +* DAC XI +* DAC YI * DAC 0 DON'T FORGET! * +* USED VARIABLES: (TMP1) XOP,YOP,XP1,YP1,XP2,YP2 +* **************************************** * APII DAC ** @@ -558,13 +825,21 @@ APII DAC ** IRS APII JUMP TO NEXT ARGUMENT (X) * LDA* APII LOAD X VALUE - STA XP1 STORE TO X-POINTER - STA XP2 STORE TO X-POINTER + STA XOP STORE TO X-POINTER + IRS APII JUMP TO NEXT ARGUMENT (Y) + LDA* APII LOAD Y VALUE + STA YOP STORE TO Y-POINTER + IRS APII CORRECT RETURN ADDRESS +* + LDA* APII LOAD X VALUE + STA XIP1 STORE TO X-POINTER + STA XIP2 STORE TO X-POINTER IRS APII JUMP TO NEXT ARGUMENT (Y) LDA* APII LOAD Y VALUE - STA YP1 STORE TO Y-POINTER - STA YP2 STORE TO Y-POINTER + STA YIP1 STORE TO Y-POINTER + STA YIP2 STORE TO Y-POINTER IRS APII CORRECT RETURN ADDRESS +* IRS APII FOR FORTRANIV COMPATIBILITY JST APL CALL REAL ROUTINE JMP* APII @@ -580,9 +855,12 @@ APII DAC ** * CALL: * JST M$APLI * DAC MATRIX -* DAC VECTOR +* DAC TARGET +* DAC SOURCE * DAC 0 DON'T FORGET! * +* USED VARIABLES: (TMP1) XOP,YOP,XP1,YP1,XP2,YP2 +* **************************************** * APLI DAC ** @@ -598,12 +876,19 @@ APLI DAC ** IRS APLI * LDA* APLI - STA XP1 - STA XP2 + STA XOP AOA - STA YP1 - STA YP2 + STA YOP IRS APLI +* + LDA* APLI + STA XIP1 + STA XIP2 + AOA + STA YIP1 + STA YIP2 + IRS APLI +* IRS APLI JST APL CALL INTERNAL ROUTINE JMP* APLI RETURN. @@ -616,18 +901,20 @@ APLI DAC ** * * ALL DATA IS SET UP BY THE BOTH USER ROUTINES ABOVE. * +* USED VARIABLES: TMP1 +* **************************************** * APL DAC ** * CALL FLOAT LOAD SINGLE PRECISION FLOAT FROM 1-WORD INTEGER -XP1 DAC 0 +XIP1 DAC 0 CALL M$22 MULTIPLY FLOAT*FLOAT MP11 DAC 0 CALL H$22 STORE FLOAT DAC TMP1 CALL FLOAT -YP1 DAC 0 +YIP1 DAC 0 CALL M$22 MP12 DAC 0 CALL A$22 @@ -636,27 +923,81 @@ MP12 DAC 0 STA PA21 STORE NEW X VALUE INTO TEMPORARY LOCATION **** CALL FLOAT -XP2 DAC 0 +XIP2 DAC 0 CALL M$22 MP21 DAC 0 CALL H$22 DAC TMP1 * CALL FLOAT -YP2 DAC 0 +YIP2 DAC 0 CALL M$22 MP22 DAC 0 CALL A$22 DAC TMP1 JST RND NOW INTEGER IN AC - STA* YP1 STORE NEW Y VALUE + STA* YOP STORE NEW Y VALUE * LDA PA21 - STA* XP1 + STA* XOP +* JMP* APL RETURN TO CALLER. * * ******************************************************************************** +* +* +**** M$ROTI ROTATE MATRIX, USE INTEGER DEGREE ANGLE +* +ROTI DAC ** + LDA* ROTI GET MATRIX POINTER + STA MTA STORE TO ARGUMENT TO FINAL ROT + IRS ROTI NEXT ARGUMENT: ANGLE + LDA* ROTI LOAD ANGLE + IRS ROTI + IRS ROTI + JST RAD CONVERT INTEGER TO RADIANT + CALL H$22 + DAC RTMP + JST ROT +MTA DAC ** + DAC RTMP + DAC 0 + JMP* ROTI +* +RTMP BSS 2 TEMPORARY VARIABLE +* +* +******************************************************************************** +* +* +**** M$SCLI - SCALE MATRIX, USE INTEGER PERCENT VALUE +* +SCLI DAC ** + LDA* SCLI GET MATRIX POINTER + STA MTSS STORE TO ARGUMENT TO FINAL ROT + IRS SCLI NEXT ARGUMENT: PERCENTS +* + LDA* SCLI LOAD PERCENTS + STA SA1 STORE + CALL FLOAT CONVERT TO FLOAT +SA1 DAC ** + CALL M$22 MULTIPLY WITH + DAC PERC FACTOR 0.01 + IRS SCLI + IRS SCLI + CALL H$22 + DAC RTMP +* + JST SCLE +MTSS DAC ** + DAC RTMP + DAC 0 +* + JMP* SCLI RETURN +* +* +******************************************************************************** * * **** ROUND FLOAT TO INTEGER ROUTINE @@ -679,22 +1020,57 @@ RND DAC ** ******************************************************************************** * * +**** RAD - CONVERT ANGLE IN DEGREE TO RADIANT. +* +* ENTER WITH INTEGER ANGLE IN A +* +* CALL: +* +* JST RAD +* DAC ANGLE POINTER TO ANGLE +* +**************************************** +* +RAD DAC ** + STA AN1 + CALL FLOAT +AN1 DAC ** + CALL M$22 + DAC DEG + JMP* RAD +* +* +******************************************************************************** +* +* **** CONSTANTS * ONE DEC 1 HLF OCT '040100 CONSTANT 0.5 OCT '000000 +ONEF OCT '040300 CONSTANT 1.0 + OCT '000000 +DEG OCT '036707 CONSTANT PI/180 + OCT '076432 +PERC OCT '036521 CONTANT 0.01 + OCT '165605 * * ******************************************************************************** * +* **** VARIABLES * TMP1 BSS '2 TEMPORARY 2-WORD VARIABLE TMP2 BSS '2 " " " TMP3 BSS '2 " " " -TMP4 BSS '2 " " " -* +TMP4 BSS '2 " " " +VAP DAC ** TEMPORARY POINTER TO VECTOR +XOP DAC ** OUTPUT VECTOR X POINTER +YOP DAC ** OUTPUT VECTOR Y POINTER +*VECP DAC ** VECTOR POINTER USED BY T$PII,T$PLI +VECP EQU TMP2 VECTOR POINTER USED BY T$PII,T$PLI +* * ******************************************************************************** * diff --git a/lib/hachti/src/pl$mv.asm b/lib/hachti/src/pl$mv.asm index af93917..3a142f7 100644 --- a/lib/hachti/src/pl$mv.asm +++ b/lib/hachti/src/pl$mv.asm @@ -27,7 +27,8 @@ * * PURPOSE: * -* PROVIDE SIMPLE LIBRARY FUNCTIONS FOR INCREMENTAL PLOTTERS +* PROVIDE DRAWING AND COORDINATE TRANSFORMATION +* ROUTINES FOR INCREMENTAL PLOTTERS * * * STORAGE: @@ -67,57 +68,140 @@ * * SUBR PL$MV,MOVE + SUBR PL$MVR,MVR SUBR PL$RST,RST SUBR PL$LN,LINE SUBR PL$RMR,RMR - SUBR PL$X,X - SUBR PL$Y,Y - SUBR PL$MAT,MTRX + SUBR PL$X,UX + SUBR PL$Y,UY + SUBR PL$MAT,ATRA SUBR PL$SCL,SCLE + SUBR PL$SCI,SCLI SUBR PL$ROT,ROT - SUBR PL$IDN,IDEN + SUBR PL$ROI,ROTI + SUBR PL$PUS,PUSH + SUBR PL$POP,POP + SUBR PL$INI,INIT * * * REL THIS IS A RELOCATABLE OBJECT ORG '0 * +* ******************************************************************************** +* +**** PL$MVR - MOVE PEN RELATIVELY +* +MVR DAC ** +* + LDA* MVR + STA TMPX + IRS MVR + LDA* MVR + STA TMPY + IRS MVR +* + LDA* TMPX +* CALL OCT + ADD XU + STA XU +* + LDA* TMPY +* CALL OCT + ADD YU + STA YU +* + IRS RELA SET FLAG + NOP + IRS MVR + JMP* MVR RETURN +* +* +* +**** PL$INI - GRAPHICS INITIALISATION +* +* THIS ROUTINE SETS THE HARDWARE ORIGIN TO THE CURRENT PlOTTER POSITION. +* IT ALSO INITIALISES THE TRANSFORMATION. +* +**************************************** +* +INIT DAC ** + CRA + STA XU + STA YU + STA X + STA Y + STA RELA + CALL T$INIT + DAC ATRA + JMP* INIT +* +* +**** PL$PUS - PUSH GRAPHIC CONTEXT ONTO THE STACK +* +PUSH DAC ** ENTRY + LDA* PUSH + STA SD1 + IRS PUSH + CALL S$PUSM PUSH MEMORY ROUTINE +SD1 DAC ** + DAC ATRA + DEC 12 12 WORDS OF DATA. + JMP* PUSH +* +* +******************************************************************************** +* +* +**** PL$POP - POP GRAPHIC CONTEXT FROM THE STACK +* +POP DAC ** ENTRY + LDA* POP + STA SD2 + IRS POP + CALL S$POPM POP MEMORY ROUTINE +SD2 DAC ** + DAC ATRA + DEC 12 12 WORDS OF DATA. + JMP* POP +* +* +* ******************************************************************************* * -LINE DAC 0 DRAW A LINE FROM NEAR STARTING POINT +* +**** PL$LN - DRAW A LINE +* +LINE DAC 0 DRAW A LINE FROM NEAREST STARTING POINT LDA* LINE X1 - STA X1 - LDA* X1 - STA X1 + STA X1P IRS LINE - LDA* LINE Y1 - STA Y1 - LDA* Y1 - STA Y1 + LDA* LINE Y1 + STA Y1P IRS LINE LDA* LINE X2 - STA X2 - LDA* X2 - STA X2 + STA X2P IRS LINE LDA* LINE Y2 - STA Y2 - LDA* Y2 - STA Y2 + STA Y2P IRS LINE TALLY RETURN ADDRESS IRS LINE AGAIN FOR FORTRAN IV COMPATIBILITY -* -* - CALL M$APLI - DAC MTRX +* + CALL T$APII APPLY MATRIX + DAC ATRA DAC X1 + DAC Y1 +X1P DAC ** +Y1P DAC ** DAC 0 -* - CALL M$APLI - DAC MTRX +* + CALL T$APII APPLY MATRIX + DAC ATRA DAC X2 + DAC Y2 +X2P DAC ** +Y2P DAC ** DAC 0 -* * * LDA X @@ -192,37 +276,50 @@ NM1 CALL PL$PD WE ARE AT BEGINNING OF LINE JST RMOV REAL MOVE JMP* LINE END OF THE LINE :-) * -* -* +* ******************************************************************************** * -**** MOVE PEN ROUTINE +**** MAKE CURRENT X AND Y THE ORIGIN * -RST DAC ** SET POINT ZERO +RST DAC ** +* +**** FIRST TRANSLATE THE CURRENT USER POSITION: + CALL T$TRAN + DAC ATRA + DAC XU + DAC YU + DAC 0 CRA - STA Y - IMA X + STA XU + STA YU +* JMP* RST * - ABS - ORG '3000 -* +* +******************************************************************************** +* +* +**** PL$MV - BASIC MOVE ROUTINE +* MOVE DAC ** MOVE YA! * -* JMP* MOVE -* LDX MOVE GET PARAMETERS LDA* 0,1 X VALUE + STA XU STA XN LDA* 1,1 Y VALUE + STA YU STA YN LDA MOVE ADD =3 STA MOVE CORRECT RETURN ADDRESS * - CALL M$APLI APPLY TRANSFORMATION MATRIX TO POSITION - DAC MTRX + CALL T$APII APPLY TRANSFORMATION MATRIX TO POSITION + DAC ATRA DAC XN + DAC YN + DAC XN + DAC YN DAC 0 * JST RMOV CALL INTO REAL MOVE SUBROUTINE @@ -285,8 +382,10 @@ YGTX NOP DY GREATER OR EQUAL DX STA STPS LDA DX STA DS + STA DS0 LDA DY STA DL + STA DL0 JMP GTE * XGTY LDA STPY @@ -295,35 +394,53 @@ XGTY LDA STPY STA STPL LDA DX STA DL + STA DL0 LDA DY - STA DS -* -GTE LDA DL LONG DISTANCE + STA DS + STA DS0 +* +**************************************** +* +* NOW ALL STEP ROUTINES, DL0, DS0, DL0, DS0 ETC. +* ARE READY TO USE. +* +GTE LDA DL0 LONG DISTANCE LGR 1 DIVIDE BY TWO STA ERR INITIALIZE ERROR COUNTER * * -* -LOOP LDA DL +*** MOVE LOOP +* +LOOP LDA DL LONG DISTANCE SNZ JMP FNSH END OF WORK - HOPE SO.... - SUB =1 DECREMENT DL +* + SUB =1 DECREMENT LONG DISTANCE STA DL - LDA ERR - SUB DS +* + LDA ERR ERROR COUNTER + SUB DS0 STA ERR SMI SKIP IF NOT OVERFLOWN (MINUS) JMP NDIA NO DIAG STEP - ADD DL RELOAD +* +*** DIAG STEP TO DO +* + ADD DL0 STA ERR LDA DS SUB =1 STA DS - JST* STPD - JMP STEN END OF STEP -NDIA JST* STPL LONG DIR STEP ONLY + JST* STPD DO DIAGONAL STEP + JMP LOOP RELOOP +* +*** NO DIAGONAL STEP TO DO +* +NDIA JST* STPL DO LONG DIRECTION STEP STEN JMP LOOP RELOOP * +* +*** END OF LOOP FNSH LDA XN STA X LDA YN @@ -334,73 +451,124 @@ FNSH LDA XN ******************************************************************************** * * -IDEN DAC ** RESET TRANSFORMATION MATRIX - CALL M$INIT - DAC MTRX - JMP* IDEN -* -* -******************************************************************************** +**** SCALE OUTPUT * SCLE DAC ** LDA* SCLE STA FCTR IRS SCLE - CALL M$SCLE - DAC MTRX + CALL T$SCLE + DAC ATRA FCTR DAC 0 DAC 0 JMP* SCLE * * +******************************************************************************** * * +**** ROTATE - RADIANT +* ROT DAC ** LDA* ROT STA FCR2 IRS ROT - CALL M$ROT - DAC MTRX + CALL T$ROT + DAC ATRA FCR2 DAC 0 DAC 0 JMP* ROT * * ******************************************************************************** +* +* +**** RLUP - UPDATE LATENT POSITION TO REAL POSITION +* +RLUP DAC ** + LDA RELA LOAD FLAG + SNZ + JMP* RLUP NOTHING TO DO + JST MOVE + DAC XU + DAC YU + DAC 0 + CRA + STA RELA CLEAR FLAG + JMP* RLUP +* +* +******************************************************************************** +* +* +**** ROTATE - INTEGER DEGREES +* +ROTI DAC ** + LDA* ROTI + STA FCR3 + IRS ROTI + CALL T$ROTI + DAC ATRA +FCR3 DAC 0 + DAC 0 + JMP* ROTI +* +* +******************************************************************************** +* +* +**** SCALE - INTEGER PERCENTS +* +SCLI DAC ** + LDA* SCLI + STA FCR4 + IRS SCLI +* + CALL T$SCLI + DAC ATRA +FCR4 DAC 0 + DAC 0 + JMP* SCLI +* +******************************************************************************** * *** MOVE COORDINATE SYSTEM RELATIVELY * RMR DAC ** LDA* RMR - STA PTR - LDA X - SUB* PTR - STA X + STA XTR IRS RMR LDA* RMR - STA PTR - LDA Y - SUB* PTR - STA Y + STA YTR IRS RMR IRS RMR +* + CALL T$TRAN + DAC ATRA +XTR DAC ** +YTR DAC ** + DAC 0 +* JMP* RMR -PTR DAC ** * -* +* ********************** * * VARIABLES * -X DEC 0 PEN POSITION, X VALUE -Y DEC 0 PEN POSITION, Y VALUE +X DEC 0 HARDWARE VIEW PEN POSITION, X VALUE +Y DEC 0 HARDWARE VIEW PEN POSITION, Y VALUE XN DEC 0 NEW PEN POSITION, X VALUE YN DEC 0 NEW PEN POSITION, Y VALUE DX DEC 0 X DIFFERENCE TO GO DY DEC 0 Y DIFFERENCE TO GO +TMPX DEC 0 TEMPORARY X VALUE +TMPY DEC 0 TEMPORARY Y VALUE * -DL DEC 0 LONG DISTANCE NEGATIVE -DS DEC 0 SHORT DISTANCE NEGATIVE +DL0 DEC 0 INITIAL LONG DISTANCE +DS0 DEC 0 INITIAL SHORT DISTANCE +DL DEC 0 LONG DISTANCE +DS DEC 0 SHORT DISTANCE STPL DAC ** ROUTINE TO LONG DISTANCE STEP STPS DAC ** ROUTINE TO SHORT DISTANCE STEP STPD DAC ** ROUTINE TO DIAGONAL STEP @@ -422,6 +590,7 @@ XB DEC 0 REAL SECOND POINT X COORDINATE YB DEC 0 REAL SECOND POINT Y COORDINATE D1 DEC 0 ORTHOGONAL WAY LENGTH FROM CURRENT POS TO P1 D2 DEC 0 ORTHOGONAL WAY LENGTH FROM CURRENT POS TO P2 +RELA DEC 0 FLAG INDICATING THAT RELATIVE POSITIONING HAS OCCURED * **** GLUE IN THE MOVEMENT ROUTINES * @@ -435,18 +604,30 @@ MDL XAC PL$DL MDR XAC PL$DR * ******************************************************************************** -* +* +* +**** AFFINE TRASFORMATION DATA AND REST OF GRAPHIC CONTEXT +* +* OLD PROGRAMS DON'T HAVE TO WORRY ABOUT THAT. NEWER PROGRAMS SHOULD. +* *** HERE THE TRANSFORMATION MATRIX, INITIALLY NO TRANSFORMATION, OLD PROGRAMS *** DON'T HAVE TO CARE ABOUT THAT (HOPE SO) -MTRX OCT '040300 A11 +ATRA OCT '040300 A11 (CONSTANT 1.0) OCT '000000 OCT '000000 A12 OCT '000000 OCT '000000 A21 OCT '000000 - OCT '040300 A22 + OCT '040300 A22 (CONSTANT 1.0) OCT '000000 -* +* +VECT DEC 0 X TRANSLATION + DEC 0 Y TRANSLATION +XU DEC 0 USER VIEW PEN POSITION, X VALUE +YU DEC 0 USER VIEW PEN POSITION, Y VALUE +* +VECX EQU VECT +VECY EQU VECT+1 * ******************************************************************************** * diff --git a/lib/hachti/src/pl$txt.asm b/lib/hachti/src/pl$txt.asm index fe9d1c2..d100b3f 100644 --- a/lib/hachti/src/pl$txt.asm +++ b/lib/hachti/src/pl$txt.asm @@ -1,8 +1,9 @@ -* PLOTTER TEXT TEST +* PLOTTER TEXT OUTPUT * * * SUBR PL$TXT,FPTX + SUBR PL$TNL,NEWL * * REL @@ -11,8 +12,32 @@ * ******************************************************************************** * +NEWL DAC ** + LDA* FONT LOAD VERTICAL SPACING FROM FONT + TCA + STA GPTR + LDA TWDH LAST TEXT WIDTH + TCA + STA PPTR + CALL PL$MVR MOVE RELATIVELY + DAC PPTR + DAC GPTR + DAC 0 + JMP* NEWL RETURN +* +* +******************************************************************************** +* +* +**** PL$TXT - TEXT OUTPUT ROUTINE +* FPTX DAC ** FORTRAN TEXT OUTPUT ROUTINE * + LDA* FPTX LOAD STACK DATA POINTER + STA SDA1 SAVE + STA SDA2 + IRS FPTX +* LDA* FPTX ARGUMENT TRANSFER STA BUFP IRS FPTX @@ -24,24 +49,20 @@ FPTX DAC ** FORTRAN TEXT OUTPUT ROUTINE STA BLEN IRS FPTX IRS FPTX -* WE HAVE TO CORRECT OUR BUFFER POINTER, WHY???? - LDA FPTX LOAD RETURN ADDRESS -* JST OCT -* LDA FPTX -* ANA ='77000 -* ADD BUFP - STA BUFP -* * CALL PL$PU DON'T KNOW WHAT HAS HAPPENED BEFORE: PEN UP! * + CRA + STA TWDH TEXT WIDTH +* JST TXIN EXECUTE INTERNAL TEXT ROUTINE * + LDA TWDH JMP* FPTX RETURN TO CALLER * -TXTP DAC TXTT -TXTT BCI 10,Philipp VOID - DAC 0 +* TXTP DAC TXTT +* TXTT BCI 10,Philipp VOID +* DAC 0 ******************************************************************************** * * @@ -54,21 +75,9 @@ BLEN DEC 0 LENGTH OF TEXT TO OUTPUT * TXIN DAC ** INTERNAL TEXT WRITE ROUTINE * - LDA* XP SAVE CURRENT - STA XPC PEN POSITION - LDA* YP FOR - STA YPC NEWLINE PROCESSING -* - LDA* XP SAVE CURRENT - STA XPB PEN POSITION - LDA* YP FOR - STA YPB RESTORE -* + CALL PL$PUS PUSH GRAPHIC CONTEXT ONTO STACK +SDA1 DAC ** CALL PL$RST RESET COORDINATE SYSTEM. NOW WE MENTALLY PLOT FROM 0,0! -* - CRA CLEAR X BORROW VARIABLE - STA BROW (WILL BE NEEDED TO RESTORE COORDINATE POSITION) -* * TLOP LDA BLEN CHARACTER LOOP, FIRST TEST CHAR COUNTER SNZ @@ -81,9 +90,8 @@ TLOP LDA BLEN CHARACTER LOOP, FIRST TEST CHAR COUNTER TEGO LGR 8 TAKE DOWN UPPER CHARACTER ANA ='177 MASK OUT PARITY BIT JST PLG DRAW GLYPH -* - ADD BROW PLG CHANGES THE X COORDINATE BUT TELLS US ABOUT THAT. - STA BROW WE ADD THE "BORROWED" X PIXELS UP FOR LATER. + ADD TWDH + STA TWDH * IRS BLEN INCREMENT CHARACTER COUNTER SKP @@ -93,8 +101,9 @@ TEGO LGR 8 TAKE DOWN UPPER CHARACTER ANA ='177 MASK OUT UPPER BITS AND PARITY. * JST PLG LIKE ABOVE - ADD BROW - STA BROW + ADD TWDH + STA TWDH +* * IRS BLEN NOP @@ -103,24 +112,16 @@ TEGO LGR 8 TAKE DOWN UPPER CHARACTER JMP TLOP JUMP BACK IN CHARACTER LOOP * * -TFIN LDA XPB RESTORE AND GO HOME - ADD BROW TAKE HIDDEN X OFFSET INTO ACCOUNT (SEE GLYPH ROUTINE!) - ADD* XP - STA* XP UPDATE REAL (RELATED TO ORIGINAL COORDINATES) POSITION - LDA YPB SAME - ADD* YP WITH - STA* YP Y VALUE -* +TFIN CALL PL$POP GET OLD GRAPHIC CONTEXT AND BE HAPPY +SDA2 DAC ** + CALL PL$MVR + DAC TWDH + DAC ZERO + DAC * +* JMP* TXIN THAT'S IT, WE GO HOME. * * -XP XAC PL$X EXTERNAL POINTER TO PLOT X COORDINATE -YP XAC PL$Y EXTERNAL POINTER TO PLOT Y COORDINATE -* -XPB DEC 0 BACKUP OF X COORDINATE -YPB DEC 0 BACKUP OF Y COORDINATE -* -BROW DEC 0 BORROWED X PIXELS * ********************************************************** * @@ -147,7 +148,7 @@ FGOO LDA* GPTR LOAD GLYPH NUMBER SUB ARG SUBSTRACT WANTED GLYPH NUMBER SNZ JMP PGLP FOUND, TAKE GLYPH TO THE PLOTTING ROUTINE! -* +* IRS LEFT INCREMENT LOOP COUNTER LDX GPTR UPDATE LDA GPTR GLYPH @@ -163,21 +164,22 @@ PGLP LDX GPTR LOAD CURRENT GLYPH'S ADDRESS TO INDEX REGISTER LGR 8 USE UPPER BITS FIRST SUB =82 SUBSTRACT LETTER R - ASK HERSHEY, WHY IT'S THAT WAY! TCA WE WANT THE LEFT MARGIN NEGATED FOR LATER USE. - STA X1 STORE + STA XMIN STORE LDA 2,1 LOAD THE MARGINS AGAIN CAL CLEAR UPPER BITS OF A SUB =81 THAT'S CORRECT, ONE LESS FOR NOT OVERLAPPING GLYPHS! - STA X2 SAVE RIGHT MARGIN -* - CALL PL$RMR MOVE PLOT ORIGIN - THE REASON FOR THE BORROW STUFF. - DAC X1 GLYPH SHOULD START AT ORIGINAL X=0..BUT - ASK HERSHEY - DAC ZERO Y STAYS UNCHANGED. - DAC 0 + STA XNEX SAVE RIGHT MARGIN * LDA 1,1 LOAD POINT COUNT +* CALL OCT TCA COMPLEMENT AOA INCREMENT - FIRST "POINT" WERE THE MARGINS. STA LEFT SET UP THE WELL KNOWN COUNTER. +* + CALL PL$RMR MOVE ORIGIN + DAC XMIN + DAC ZERO Y STAYS UNCHANGED. + DAC 0 * LDA GPTR ADD =3 ADD OFFSET IN GLYPH DATA @@ -217,7 +219,7 @@ MOGO LDA* PPTR PEND IRS PPTR INCREMENT POINT POINTER IRS LEFT INCREMENT POINT COUNTER NOP - JMP MLOP LOOP AGAIN. + JMP MLOP LOOP AGAIN. * * PUP CALL PL$PU PEN UP @@ -227,38 +229,22 @@ PUP CALL PL$PU PEN UP MFIN CALL PL$PU END OF GLYPH, PEN UP! * CALL PL$RMR FUZZ COORDINATES AGAIN. - DAC X2 THE 81 ABOVE SAVES AN ADDITION OF 1 HERE. + DAC XNEX THE 81 ABOVE SAVES AN ADDITION OF 1 HERE. DAC ZERO Y UNTOUCHED. ZERO IS ZERO. DAC 0 * - CALL PL$MV MOVE PEN TO BEGINNING OF NEXT GLYPH - JUST IN CASE... - DAC ZERO - DAC ZERO - DAC 0 -* - LDA X2 ADD MARGINS - ADD X1 TO BORROWED GLYPH WIDTH +* CALL PL$MV MOVE PEN TO BEGINNING OF NEXT GLYPH - JUST IN CASE... +* DAC ZERO +* DAC ZERO +* DAC 0 + LDA XMIN RETURN WITH CORRECT WIDTH VALUE + ADD XNEX JMP* PLG RETURN TO CALLER. * * **************************************************************** * * -PNL DAC ** NEW LINE ROUTINE - LDA YPC - SUB* FONT VERTIVAL SPACING - STA YPC - CALL PL$MV - DAC XPC - DAC YPC - DAC 0 - JMP* PNL -* -* -XPC DEC 0 -YPC DEC 0 -* -* * ******************************************************************** ARG DEC 0 @@ -267,106 +253,12 @@ GPTR DEC 0 PPTR DEC 0 X DEC 0 Y DEC 0 -X1 DEC 0 -X2 DEC 0 +XMIN DEC 0 +XNEX DEC 0 ZERO DEC 0 +TWDH DAC ** GENERATED TEXT WIDTH * FONT XAC PL$FNT * -MK1 DAC ** - OCP '104 - LDA M1 - OTA 4 - JMP *-1 - ICA - OTA 4 - JMP *-1 -* LDA =10 -* OTA '4 -* JMP *-1 -* LDA =13 -* OTA '4 -* JMP *-1 -* LDA =13 -* OTA '4 -* JMP *-1 - JMP* MK1 -* -* -MK2 DAC ** - OCP '104 - LDA M2 - OTA 4 - JMP *-1 - ICA - OTA 4 - JMP *-1 -* LDA =10 -* OTA '4 -* JMP *-1 -* LDA =13 -* OTA '4 -* JMP *-1 -* LDA =13 -* OTA '4 -* JMP *-1 - JMP* MK2 -* -* -M1 BCI 2,A: -M2 BCI 2,B: -* -OCT DAC ** - OCP '104 - IAB SAVE TO B - CRA - LLR 1 - ADD =48 - OTA '4 ASR OUTPUT - JMP *-1 - CRA - LLR 3 - ADD =48 - OTA 4 ASR OUTPUT - OTA 4 - JMP *-1 - CRA - LLR 3 - ADD =48 - OTA '4 ASR OUTPUT - OTA 4 - JMP *-1 - CRA - LLR 3 - ADD =48 - OTA '4 ASR OUTPUT - OTA 4 - JMP *-1 - CRA - LLR 3 - ADD =48 - OTA '4 ASR OUTPUT - OTA 4 - JMP *-1 - CRA - LLR 3 - ADD =48 - OTA '4 ASR OUTPUT - OTA 4 - JMP *-1 -* - LDA =10 - OTA '4 - JMP *-1 - LDA =13 - OTA '4 - JMP *-1 - LDA =13 - OTA '4 - JMP *-1 - SKS 4 - JMP *-1 -* - JMP* OCT * END diff --git a/lib/hachti/src/pl$u.asm b/lib/hachti/src/pl$u.asm index 19ee7da..e6c2db4 100644 --- a/lib/hachti/src/pl$u.asm +++ b/lib/hachti/src/pl$u.asm @@ -65,18 +65,24 @@ PADR EQU '40 PORT ADDRESS OF THE PLOTTER INTERFACE REL THIS IS A RELOCATABLE OBJECT ORG '0 * -* +* OUT DAC ** DO THE MOVEMENT OTA PADR JMP *-1 * -* LDA =-'10000 -* AOA -* SZE -* JMP *-2 -* +* LDA =-1 +* STA CNT +* LDA =-1000 +* LLL AOA +* SZE +* JMP LLL +* IRS CNT +* JMP LLL +* +* JMP* OUT -* +* +* CNT DAC ** * UP DAC ** LDA CUP diff --git a/lib/hachti/src/stack.asm b/lib/hachti/src/stack.asm index 84c72b7..b54074f 100644 --- a/lib/hachti/src/stack.asm +++ b/lib/hachti/src/stack.asm @@ -15,35 +15,92 @@ * TO PROVIDE A SPECIAL-PURPOSE STACK MECHANISM FOR RECURSIVE * PROGRAM CALLS * -* WHAT: +* THEORY OF OPERATION: * -* THIS VARIANT OF THE STACK ROUTINE USES A FIXED SIZE MEMORY -* BUFFER FOR THE THE STACK. THE STACK USAGE IS MONITORED. -* ON OVERFLOW, THE COMPUTER TYPES OUT AN ERROR MESSAGE AND HALTS. +* THE STACK ROUTINES MAINTAIN AN UPWARDS GROWING STACK. +* EVERY USAGE CONTEXT OF THE STACK NEEDS TO RESERVE THE SPACE FOR +* ITS STACK'S DATA. THIS ENABLES THE PROGRAMMER TO CHOOSE THE STACK +* SIZE AND USE MULTIPLE STACKS IN MULTIPLE PLACES INDEPENDENTLY. +* ALL STACK RELATED ROUTINES TAKE A POINTER TO THE STACK'S INTERNAL +* DATA AS FIRST ARGUMENT. * +* THE DATA LAYOUT OF THE STACK DATA IS AS FOLLOWING: +* +* SIZE OCT '1000 SIZE OF THE STACK IN MACHINE WORDS +* PTR DAC ** THE STACK POINTER +* FILL DAC ** THE FILL COUNTER +* OVER DAC OFL OPTIONAL POINTER TO OVERFLOW ERROR ROUTINE +* UNDR DAC UFL OPTIONAL POINTER TO UNDERFLOW ERROR ROUTINE +* STCK BSS '1000 THE STACK DATA +* +* IF CUSTOM ERROR HANDLING ROUTINES ARE NOT TO BE USED, SET THE TWO +* POINTER LOCATIONS TO ZERO. THEN, INTERNAL ERROR ROUTINES WILL BE +* USED. SIZE AND THE FUNCTION POINTERS HAVE TO BE INITIALISED. THE +* OTHER LOCATIONS ARE INITIALISED BY THE STACK ROUTINES. * * USAGE: * * INITIALISING STACK POINTER: * -* CALL S$INIT +* CALL S$INIT +* DAC SDATA STACK DATA +* OCT SSIZ DATA SIZE (NOT STACK DEPTH!!!) * * PUSHING AND POPPING THE A-REGISTER FROM AND TO THE STACK: * * CALL S$PUSH VALUE IN A REGISTER IS PUSHED. -* CALL $$PUSH VALUE FROM STACK IS POPPED INTO A-REGISTER. +* DAC SDATA +* +* CALL $$POP VALUE FROM STACK IS POPPED INTO A-REGISTER. +* DAC SDATA * * PUSHING AND POPPING ARBITRARY DATA FROM AND TO THE STACK: * * CALL S$PUSM +* DAC SDATA * DAC ADDRESS * OCT SIZE * * CALL S$POPM +* DAC SDATA * DAC ADDRESS * OCT SIZE +* +* +* MAKING A RECURSIVE CALL FROM FORTRAN IV TO A FORTRAN IV OR OTHER ROUTINE: * +* THE ROUTINE S$CALL SAVES A SET OF LOCAL VARIABLES ONTO THE STACK. +* IT ALSO SAVES THE RETURN ADDRESS AND ITS OWN PARAMETERS. +* S$LLAC DOES EVERYTHING IN REVERSE ORDER. +* +* HERE IS AN EXAMPLE HOW TO USE THE TWO ROUTINES IN FORTRAN IV: +* +* C LOCAL VARIABLES I(3),A,Z TO SAVE +* +* CALL S$CALL(3,I,3,A,2,Z,2) +* RETURN <-- FOR THE RETURN ADDRESS OF THE CURRENT ROUTINE +* CALL MYROUTINE(...) +* CALL S$LLAC +* +* ASSEMBLER CALLING SEQUENCE: +* +* JST S$CALL +* DAC VARNO NO OF LOCAL VARIABLES TO SAVE ON THE STACK +* DAC VAR1 POINTER TO FIRST VARIABLE +* DAC SIZE1 WORD SIZE OF VARIABLE +* ... +* DAC VARN POINTER TO LAST VARIABLE +* DAC SIZEN WORD SIZE OF LAST VARIABLE +* DAC 0 FORTRAN IV COMPILER GENERATED * +* JMP* PROC RETURN JUMP, GENERATED BY THE "RETURN" STATEMENT +* +* JST MYROUTINE +* ... +* +* JST S$LLAC +* +* ******************************************************************************** * * @@ -56,24 +113,26 @@ SUBR S$PUSM,PUSM MEMORY RANGE PUSH SUBR S$POPM,POPM MEMORY RANGE POP SUBR S$PTR,SPTR STACK POINTER ACCESS + SUBR S$CALL,CALL + SUBR S$LLAC,LLAC * * ******************************************************************************** * -* -SSIZ EQU '1000 512 WORDS DEFAULT STACK BUFFER SIZE * REL RELOCATEABLE OBJECT - ORG '0 * * ******************************************************************************** -* -* -**** PUSH MEMORY RANGE TO STACK +* +* *** PUSH MEMORY RANGE TO STACK * PUSM DAC ** ENTRY POINT TO PUSH ROUTINE STA ATM1 SAVE A-REGISTER +* + LDA* PUSM LOAD DATA BASE + IRS PUSM + STA DPT SAVE FOR LATER USE * LDA* PUSM LOAD POINTER STA PTR STORE TO TRANSFER POINTER @@ -86,12 +145,14 @@ PUSM DAC ** ENTRY POINT TO PUSH ROUTINE * PULP LDA* PTR GET DATA JST PUSH PUSH IT! +DPT DAC ** +* IRS PTR INCREMENT POINTER IRS CNT INCREMENT BYTE COUNTER JMP PULP DO IT AGAIN! * LDA ATM1 RESTORE A-REG - JMP* PUSM + JMP* PUSM RETURN * * ******************************************************************************** @@ -102,6 +163,10 @@ PULP LDA* PTR GET DATA POPM DAC ** ENTRY POINT TO PUSH ROUTINE STA ATM1 SAVE A-REGISTER * + LDA* POPM GET DATA POINTER + IRS POPM + STA DPTR STORE FOR LATER USE +* LDA* POPM LOAD POINTER IRS POPM GO TO NEXT ARGUMENT ADD* POPM ADD TRANSFER SIZE @@ -114,6 +179,8 @@ POPM DAC ** ENTRY POINT TO PUSH ROUTINE STA CNT STORE TO COUNTER * POLP JST POP POP DATA FROM THE STACK +DPTR DAC ** +* STA* PTR STORE IT. LDA PTR SUB =1 DECREMENT @@ -121,8 +188,8 @@ POLP JST POP POP DATA FROM THE STACK IRS CNT INCREMENT BYTE COUNTER JMP POLP DO IT AGAIN! * - LDA ATM1 - JMP* POPM + LDA ATM1 RESTORE A-REG + JMP* POPM RETURN * * ******************************************************************************** @@ -130,19 +197,27 @@ POLP JST POP POP DATA FROM THE STACK * **** PUSH SINGLE WORD ONTO STACK * + SUBR PUSH PUSH DAC ** REAL PUSH ROUTINE - PUSH AC TO STACK. -* +* + STX XTM SAVE X REGISTER STA ATM2 SAVE A REGISTER * - LDA SPTR LOAD STACK POINTER - SUB MAX TEST IF STACK FULL - SNZ - JST OFLO OVERFLOW OH! OH! OH! + LDX* PUSH LOAD INDEX REGISTER WITH DATA BASE + IRS PUSH * + LDA FILL,1 LOAD FILL SIZE + CAS SSIZ,1 COMPARE STACK SIZE + NOP + JST OFLO OVERFLOW! +* LDA ATM2 - STA* SPTR NO OVERFLOW, PUT DATA ONTO STACK - IRS SPTR INCREMENT STACK POINTER + STA* SPTR,1 NO OVERFLOW, PUT DATA ONTO STACK + IRS SPTR,1 INCREMENT STACK POINTER + IRS FILL,1 INCREMENT FILL SIZE * + LDX XTM RESTORE X REGISTER + LDA ATM2 JMP* PUSH RETURN WITH A-REG UNALTERED. * * @@ -153,16 +228,23 @@ PUSH DAC ** REAL PUSH ROUTINE - PUSH AC TO STACK. * POP DAC ** REAL POP ROUTINE - POP AC FROM STACK. * - LDA SPTR LOAD STACK POINTER - SUB MIN TEST IF STACK EMPTY + STX XTM SAVE X REGISTER + LDX* POP LOAD INDEX REGISTER WITH DATA BASE + IRS POP +* + LDA FILL,1 FILL SIZE SNZ - JST UFLO UNDERFLOW OH! OH! OH! + JST UFLO NOTHING INSIDE? SKIP! * - LDA SPTR LOAD STACK POINTER + LDA SPTR,1 LOAD STACK POINTER SUB =1 DECREMENT IT TO LAST USED LOCATION - STA SPTR SAVE IT BACK + STA SPTR,1 SAVE IT BACK + LDA FILL,1 + SUB =1 + STA FILL,1 DECREMENT FILL SIZE * - LDA* SPTR LOAD VALUE FROM THE STACK + LDA* SPTR,1 LOAD VALUE FROM THE STACK + LDX XTM RESTORE INDEX REGISTER JMP* POP RETURN. * * @@ -171,9 +253,27 @@ POP DAC ** REAL POP ROUTINE - POP AC FROM STACK. * **** INITIALIZATION * -INIT DAC ** INITIALIZE STACK POINTER - LDA CPTR LOAD INITIAL STACK POINTER - STA SPTR SET STACK POINTER +INIT DAC ** INITIALIZE STACK + STA ATM1 + STX XTM +* + LDX* INIT +* + LDA VARS SIZE OF MANAGEMENT VARIABLES + ADD* INIT BASE ADDRESS + STA SPTR,1 SAVE TO STACK POINTER + IRS INIT +* + LDA* INIT LOAD DATA POOL SIZE + SUB VARS VARIABLE SIZE + STA SSIZ,1 SAVE TO STACK DEPTH +* + CRA + STA FILL,1 +* + LDA ATM1 + LDX XTM + IRS INIT JMP* INIT * * @@ -182,6 +282,7 @@ INIT DAC ** INITIALIZE STACK POINTER * **** ERROR HANDLING ROUTINES * + SUBR OFLO OFLO DAC ** STACK OVERFLOW ROUTINE LDA OMSP LOAD OVERFLOW MESSAGE POINTER JST TYPE TYPE IT OUT. @@ -193,6 +294,7 @@ OFLO DAC ** STACK OVERFLOW ROUTINE **************************************** * * + SUBR UFLO UFLO DAC ** STACK OVERFLOW ROUTINE LDA UMSP LOAD OVERFLOW MESSAGE POINTER JST TYPE TYPE IT OUT. @@ -204,6 +306,7 @@ UFLO DAC ** STACK OVERFLOW ROUTINE **************************************** * * + SUBR TYPE TYPE DAC ** SKS '104 TEST ASR READY JMP *-1 WAIT TO BECOME READY @@ -231,22 +334,23 @@ TLOP LDA* PTR TYPE LOOP * ***** VARIABLES * -SBUF BSS SSIZ THE STACK BUFFER -SPTR DAC SBUF THE STACK POINTER * PTR DEC 0 TRANSFER POINTER TO USER BUFFERS CNT DEC 0 TRANSFER COUNTER * ATM1 DEC 0 A-REGISTER BACKUP ATM2 DEC 0 A-REGISTER BACKUP +XTM DEC 0 X-REGISTER BACKUP * * ***** CONSTANTS -* -CPTR DAC SBUF STACK POINTER CONSTANT -MAX DAC SBUF+SSIZ FIRST ILLEGAL SPTR LOC BEFORE PUSH -MIN DAC SBUF FIRST ILLEGAL SPTR LOC BEFORE POP * +VARS DEC 3 SIZE OF VARIABLES AT BEGINNING OF DATA +* +SSIZ EQU 0 +SPTR EQU 1 +FILL EQU 2 +* OMSP DAC OMSG POINTER TO MESSAGE UMSP DAC UMSG POINTER TO MESSAGE OMSG OCT '006412 CR/LF CHARACTERS diff --git a/pc-tools/ldc2/src/config.cpp b/pc-tools/ldc2/src/config.cpp index 905292e..0bc613a 100644 --- a/pc-tools/ldc2/src/config.cpp +++ b/pc-tools/ldc2/src/config.cpp @@ -2,11 +2,14 @@ * * LDC2 source code * - * $Date: 2007/12/23 15:25:11 $ + * $Date: 2008/08/25 21:02:24 $ * $Author: hachti $ * * $Log: config.cpp,v $ - * Revision 2.1 2007/12/23 15:25:11 hachti + * Revision 2.2 2008/08/25 21:02:24 hachti + * *** empty log message *** + * + * Revision 2.1 2007-12-23 15:25:11 hachti * *** empty log message *** * * Revision 2.0 2007-03-26 01:00:38 hachti @@ -24,6 +27,7 @@ #include #include +#include #include #include #include diff --git a/pc-tools/ldc2/src/configuration_manager.cpp b/pc-tools/ldc2/src/configuration_manager.cpp index 98a3778..f21de67 100644 --- a/pc-tools/ldc2/src/configuration_manager.cpp +++ b/pc-tools/ldc2/src/configuration_manager.cpp @@ -2,11 +2,14 @@ * * LDC2 source code * - * $Date: 2007/06/15 12:46:04 $ + * $Date: 2008/08/25 21:02:24 $ * $Author: hachti $ * * $Log: configuration_manager.cpp,v $ - * Revision 2.2 2007/06/15 12:46:04 hachti + * Revision 2.3 2008/08/25 21:02:24 hachti + * *** empty log message *** + * + * Revision 2.2 2007-06-15 12:46:04 hachti * Some small changes in configuration_manager output - added (c/f) info. * Changed order in tool.hh:add_unique.... * @@ -23,6 +26,7 @@ #include #include #include +#include #define MAX_LINE_LENGTH 80 diff --git a/pc-tools/ldc2/src/main.cpp b/pc-tools/ldc2/src/main.cpp index d2270b6..352b476 100644 --- a/pc-tools/ldc2/src/main.cpp +++ b/pc-tools/ldc2/src/main.cpp @@ -2,11 +2,14 @@ * * LDC2 source code * - * $Date: 2007/05/30 02:51:16 $ + * $Date: 2008/08/25 21:02:24 $ * $Author: hachti $ * * $Log: main.cpp,v $ - * Revision 2.3 2007/05/30 02:51:16 hachti + * Revision 2.4 2008/08/25 21:02:24 hachti + * *** empty log message *** + * + * Revision 2.3 2007-05-30 02:51:16 hachti * Changed everything towards LDC2 use. * Worked on the buildlib.sh. * Centralized buildlib.sh to a new lib/common directory. @@ -26,6 +29,8 @@ #include #include #include +#include +#include #include #include diff --git a/programs/libtest/src/plotter-matrix.f b/programs/libtest/src/plotter-matrix.f index d4dff8f..901a677 100644 --- a/programs/libtest/src/plotter-matrix.f +++ b/programs/libtest/src/plotter-matrix.f @@ -1,29 +1,45 @@ C PLOTTING MATRIX TEST! C C - INTEGER DD(100) +C INTEGER DD(100) INTEGER FF C - WRITE (1,100) - 100 FORMAT (5HHALLO) +C WRITE (1,100) +C 100 FORMAT (5HHALLO) C - CALL PL$RST - CALL PL$IDN +C CALL PL$RST C +CCCCCC INITIALISE STACK + EXTERNAL MUH -C CALL BOX(0,0) - CALL PL$LN(0,0,0,100) - CALL PL$LN(50,0,50,100) + A=0.01 - CALL PL$PU - CALL PL$MV(0,-120) + CALL S$INIT + CALL MUH CALL PL$RST + CALL PL$PUS + + CALL PL$RMR(25,25) CALL PL$SCL(0.5) - CALL PL$LN(0,0,0,100) - CALL PL$LN(50,0,50,100) - CALL PL$LN(100,0,100,100) - CALL PL$PU + CALL PL$ROT(RAD(45)) + CALL BOX(0,0) + + CALL PL$POP + CALL BOX(0,0) +C CALL PL$LN(0,0,0,100) +C CALL PL$LN(50,0,50,100) + + + +C CALL PL$MV(-50,-100) + +C CALL PL$RST +C CALL PL$SCL(0.5) +C CALL PL$LN(0,0,0,100) +C CALL PL$LN(50,0,50,100) +C CALL PL$LN(100,0,100,100) +C CALL PL$PU C CALL PL$SCL(0.5) C CALL BOX(0,0) @@ -46,7 +62,7 @@ C CALL PL$MV(0,-100) C CALL PL$RST C ALL PL$PU - CALL PL$MV(0,0) +C CALL PL$MV(0,0) C CALL PL$TXT(18HText auf der Linie,18) C CALL PL$LN(0,16,18*8,16) C CALL PL$LN(18*8,16,18*8,0) @@ -57,12 +73,19 @@ C 2 CALL PL$MV (0,-70) 9999 CALL REBOOT 2000 END - + + SUBROUTINE MUH + WRITE (1,334) + 334 FORMAT(4HMUH!) + RETURN + END + + FUNCTION RAD(RIN) INTEGER RIN REAL RINF,ROUT REAL RAD,PI - PI=3.1416 + PI=3.14159265 RINF=RIN ROUT = (RINF/180.0)*PI diff --git a/programs/plotter/src/nikolaussiedlung.f b/programs/plotter/src/nikolaussiedlung.f index 3d55f14..66433c3 100644 --- a/programs/plotter/src/nikolaussiedlung.f +++ b/programs/plotter/src/nikolaussiedlung.f @@ -2,6 +2,8 @@ C PLOTTER TEST PROGRAM C C CALL PL$RST + CALL PL$SCI(100) + CALL PL$ROI(30) CALL PL$PD CALL PL$MV(605,0) CALL PL$MV(605,95) -- 2.32.0