Jump to content

Vorticon

Members
  • Content Count

    4,690
  • Joined

  • Last visited

  • Days Won

    2

Posts posted by Vorticon


  1. 5 hours ago, wolhess said:

    Thank you, now I have something to read and to learn. 
     

    I tried to run the logistic equation program from the E/A Module, but I got only a green screen and nothing happens. From the 99 Fortran menu it works fine. 
     

    I compiled and linked the program again and used only my real floppy drive. The program runs from the 99 Fortran menu. I changed to the E/A (in my FG99) and it runs once from E/A option 5. The second try I got the green screen again. Do I something wrong? After a reset the same program runs from the 99 Fortran menu again.

     

     

    You have to use the utility menu to create an EA executable. The process is detailed in the Errata section 9.4.2

    • Like 1

  2. 3 hours ago, dhe said:

     

    Most people will only need to worry about compiler errors and run time errors.

     

    Unfortunately, I feel this is an area of weakness with this package. The compiler is not very good at catching all errors, and to date all the run time errors I have encountered only give the address of the error in the compiled code and not a pointer to the source code line causing the error, which makes debugging slow and painful. 


  3. 10 hours ago, DuaneAL said:

    Sorry if this was asked before, how does the speed of the compiled program compare to other languages like c99 or xb(compiled)? 

     

    (Edit) I’m not asking about a specific program on this thread, just in general, how does FORTRAN compare to the other commonly used languages in speed?  I knew there was FORTRAN for the TI but I didn’t realize how complete it was.

    It compares very favorably to assembly. Probably vey close to the speed of compiled XB, but with major advantage of direct bitmap access, access to the VDP (memory and registers), and double precision floating point operations when needed. There is even a sound facility! With the exception of speech, it's pretty much complete. An impressive feat and a very under-appreciated package. 

    • Like 3

  4. 5 hours ago, moulinaie said:

    Hi !

     

    The RND function used has a precision of 1/4096 = 0.00024.

    The best we can expect is a value in PI +/- 0.00024

    3.1413 and 3.1418

     

    Guillaume.

    Good to know! The problem is that even after 14 billion+ iterations, that 4th decimal was still stuck at 0, outside of the theoretical range...

    I would assume then that the XB RND function has the full TI precision and should give a better result, although it would take months to get a decent number of iterations...


  5. As I read the manual Errata, I was very pleasantly surprised to find that bitmap support had been added to the package, including the ability to draw lines and circles as well as place text anywhere on the bitmap screen and individual pixel plot routines. This made Fortran 99 quite a powerful package!

    As an exercise, I coded the chaotic logistic equation and plotted it on the bitmap screen. Requires the GL, ML and FL libraries. Fun:)

     

     

          PROGRAM LOGISTIC
     
          INTEGER X, Y
     
          CALL FILES(1)
          CALL CLEAR
          CALL SETMOD(4)
          CALL SCREEN(2, 16)
     
          WRITE(6, 20)
     
          P = 0.4
          R = 2.5
     
          DO WHILE (X .LE. 250)
            P = P * R * (1 - P)
            Y = IFIX(191 - (P * 191))
            X = IFIX((R - 2.5) * 170)
            CALL SETPIX(X, Y)
            R = R + 0.0001
          REPEAT
     
    10    CALL KEY(0, KEYC, ISTATUS)
          IF (ISTATUS .EQ. 0) GOTO 10
     
    20    FORMAT('+', M24.1, 'Logistic equation')
          STOP
          END

     

    • Like 3

  6. 6 minutes ago, dhe said:

    no fair! post the code! 😃

    Here you go :) It's based on Moulinaie's XB program.

     

     PROGRAM RANDTEST
     
          INTEGER IRAND,  X
          INTEGER *4 T(10)
          REAL S, S2, SD
     
          CALL RANDOM
          PRINT ,'Number of data points?'
          ACCEPT ,N
          DO 10 I = 1, N
            X = IRAND(10)
    10      T(X + 1) = T(X + 1) + 1
          S = 0
          S2 = 0
          DO 20 I = 0, 9
            S = S + (T(I + 1) * I)
    20      S2 = S2 + (T(I + 1) * I * I)
          S = S / N
          S2 = S2 / N
          SD = SQRT(S2 - S * S)
          PRINT , 'MEAN = ', S
          PRINT , 'STANDARD DEVIATION = ', SD
          STOP
          END

     


  7. Incidentally, I wasn't too happy about the value of PI I was getting, so I checked the random number generator function in Fortran 99 and got this:

     

    RND_FORTRAN.thumb.jpg.da899343f60fbe1422f2d1d7dab2a533.jpg

     

    The expected values are:

    MEAN = 4.5

    STANDARD DEVIATION = 2.87

     

    What still trips me on occasion is the range of variables. For example, if an operation brings a simple integer variable out of range (32767), it goes negative but no overflow error is generated. This is not something we had to worry about in loosely typed languages like Basic or Python...


  8. 19 hours ago, INVISIBLE said:

    To put things into some sort of perspective, H1N1 had over 60 million cases domestically with about 12,500 deaths.  While things are still early in the timeline, as of this posting, the reported domestic deaths are hovering at around 2000 with around 120,000 REPORTED cases.

    Again, the mortality rate for COVID-19 is around 10x that of H1N1, with a higher transmission rate. Using your numbers, the death rate from H1N1 is 0.21%, and from COVID-19 1.7%... That's 1,020,000 death in the US if we assume the same total number of infections as H1N1, which is very optimistic. Put that into perspective...

    • Like 1

  9. Not that I could tell. So on a hunch, I deleted the disk image I was using for DSK3 and created a new one, and now everything works as it should. I must have had a bad image for some reason. Sorry about the fuss! Should have done that from the get go. 


  10. I got the C12 trick from the sample program in Beard's introduction :)

    Incidentally, I did end up needing to add the following types to the program in order to allow for an iteration number > 32767, and the compiler complained but still complied :)

     

    INTEGER *4 N, I
    REAL *8 TOTAL

    I must say, Fortran is a beast to use... But I'm starting to warm up to it he he...


  11. OK I figured out what the problem was: The FORMAT statement for the initial READ statement was incorrect. This really takes some getting used to...

    I also optimized the program a bit as I got more familiar with the language. Here's the new listing:

     

          PROGRAM PICALCFT
     
    C GET NUMBER OF ITERATIONS
          WRITE(6, 10)
          READ(6, 15) N
     
    C MAIN PROGRAM LOOP
          WRITE(6, 20)
          I = 1
          DO 1 I = 1, N
            X = IRAND(10)
            Y = IRAND(10)
            D = (X / 10)**2 + (Y / 10)**2
            IF (D .LE. 1.0) TOTAL = TOTAL + 1
    1       WRITE(6, 25) I
     
    C FINALIZE RESULT AND DISPLAY
          PI = (TOTAL / N) * 4
          WRITE(6, 30) PI
          WRITE(6, 35)
     
    10    FORMAT('+', C12, M5.1, 'Number of iterations? ', M5.23)
    15    FORMAT(I8)
    20    FORMAT('+', M12.1, 'Iteration # ')
    25    FORMAT('+', M12.13, I8)
    30    FORMAT('+', M20.1, 'Approximate PI = ', F8.6)
    35    FORMAT('0 ')
          STOP
          END

    And here it is running. It's pretty fast! This also proves that the library files are not corrupted.

     

     

    • Like 2

  12. 4 hours ago, dhe said:

    PS.. A clue to the way the file, is the way it is... I tried to cut and paste the list from textpad, and it said - sorry, no can do, this listing has embedded NULLS.

     

     

     

    If you use TI99Dir to view the file, you should be able to cut and paste without issues.

     

    Here's the compiler output for the PICALCFT program

     

    1 PICALCFT                      Version 4.42                Page   0001                    .
    0      0001       PROGRAM PICALCFT
           0002
           0003       INTEGER *4 N, I, TOTAL
           0004       REAL *8 X, Y, D, PI
           0005
           0006 C GET NUMBER OF ITERATIONS
           0007       READ(6, 10, END=9999, ERR=9999) N
           0008
           0009 C MAIN PROGRAM LOOP
           0010       I = 1
           0011       DO WHILE(I .LE. N)
           0012         X = IRAND(10) / 10
           0013         Y = IRAND(10) / 10
           0014         D = X**2 + Y**2
           0015         IF (D .LE. 1) THEN
        **Warning- Mixed Mode Arithmetic
           0016           TOTAL = TOTAL + 1
        **Warning- Mixed Mode Arithmetic
           0017         ENDIF
           0018         WRITE(6, 20) I
           0019         I = I + 1
        **Warning- Mixed Mode Arithmetic
           0020       REPEAT
           0021
           0022 C FINALIZE RESULT AND DISPLAY
           0023       PI = TOTAL / N * 4
        **Warning- Mixed Mode Arithmetic
           0024       WRITE(6, 30) PI
           0025
           0026 10    FORMAT('+', C12, M1.1, 'Number of iterations? ', I8)
           0027 20    FORMAT('+', M12.1, 'Iteration # ', I8)
           0028 30    FORMAT('+', M23.1, 'Approximate PI = ', F1.6)
           0029 9999  STOP
           0030       END
     
    1 PICALCFT  Allocation          Version 4.42                Page   0002                    .
    0 Statement Labels:
     
        0010 01DC         0020 0208         0030 0228         9999 024C
    0 Subprogram References:
     
             IRAND             DI$               DADD$             DCMP$
             J4DIV$            J4MUL$            STOP$             CALL$
             IDCVT$            JDCVT$
    0 Local Data Area:
     
      000C j TOTAL      0010 j I          0014 j N          0018 d PI
      0020 d D          0028 d Y          0030 d X
    0 Logic Size:   0254
      Data Size:    0038
    0 Module Size:  028C
        0004  Warning(s)
        0000  Error(s)

     

    I should also mention that 80 column works perfectly fine with Classic99 and on real iron with the F18A. Just set it up from the Fortran 99 Utilities menu.


  13. 2 hours ago, Tursi said:

    Thanks! I gave it a try but it's working okay here? Are you on the latest? (399.018?) I recently fixed a bug that caused the emulator to incorrectly parse files on disk images files with more than two fragments. Shouldn't happen on a new disk, but maybe something else was also fixed by that...?

     

    (Also, I assume you are using the "DSK Image" option, and not "TI DSK Controller". The latter has no checks for improperly sized disk images, for instance, and that might be biting you if the image is greater than 180k...)

     

    Yup, I am using version 399.018 and the DSK Image option for all the drives 1-3. Below is a video of the issue. Note that the source file is truncated at the end when I reload it. Weird that you are not able to duplicate the issue...

     

     


  14. 32 minutes ago, Jeff White said:

    I agree.  However, let's remember that more people have gotten influenza (flu), been hospitalized, and died.  The mortality rate for COVID-19 is higher than flu, but which spreads faster?  At least we can get a flu shot each year.

     

    I am confident that a vaccine for COVID-19 (including similar strains) will be available in the next 36 months.

    COVID-19 has a much higher infectivity rate than influenza, and up to 10x the mortality rate. And it continues to mutate, with the current strain already different from the original Wuhan virus. The silver lining here is that this novel strain appears to be slightly less dangerous than the original strain, so fingers crossed that this trend will continue. If on the other hand a more virulent strain appears, well all bets are off then. So while a vaccine will help, it all depends on whether we can keep up with the mutation rate.

    This is uncharted territory for all of us, and we all need to take it seriously and do our small part to fight this. The alternative is unthinkable...

    • Like 4

  15. 6 hours ago, dhe said:

    Attacking from another end. Can you post the compiler output?

    Do you get any comments from the package when you try to load and or run?

    Thanks,

    dano

    Here you go. I should mention that I merged the 2 library disks into a single one called FORTLIB. The original disks are SSSD, so I just dumped them into a DSSD disk using TI99Dir. That way I don't need to swap disks when linking.

     

    FORTLIB.dsk

     

     

    • Like 1

  16. 4 hours ago, Tursi said:

    Can you give me a package/sequence of steps to reproduce the source file corruption in Classic99? I'm assuming we are assuming it's not Fortran's fault.

     

    Create a blank disk image (I use TI99Dir) and set it up as DSK3. Start up XB with the compiler disk in DSK1 and one of the library files in DSK2. It will autoload Fortran 99. Press 1 for Edit from the menu then press 2 to start the editor. Paste the program source I posted earlier using Paste (not Paste XB to preserve formatting) and press Fctn-9 when done. Press 3 from the menu to save the source file to DSK3. Now press 7 to exit the edit menu, then go back into it again by pressing 1. Load the source file from disk by pressing 1 then press 2 to edit again. The file will be truncated and sometimes "rearranged". None of this is an issue when using a FIAD.


  17. So I played with the Fortran 99 package today.  

    In emulation under Classic 99, you have to use a FIAD disk as your source file disk. If you use a disk image instead, the source file you edit will get corrupted. I am using the latest Classic 99 version. Also Fortran 99 will not run with js99er at all. Not sure why.

    I was able to successfully edit, compile, link and run the sample program included in Beard's introduction, so I thought OK let me try something a little more interesting and went ahead a made a Fortran version of the simple PI approximation program we discussed in another thread. Unfortunately the compiled and linked program would not run. I have absolutely no idea where the issue is. When I compile, I get 4 warnings about using mixed variable types in computations which is fine, but no errors. The program uses the Fortran and Math libraries (for the IRAND function) and the linker does not throw any errors either and produces the proper executable files. I tried this in Classic 99 as well as real iron with similar results. 

    Here's the program listing: anything looks out of order?

     

    C CALCULATING AN APPROXIMATION OF PI
     
          PROGRAM PICALCFT
     
          INTEGER *4 N, I, TOTAL
          REAL *8 X, Y, D, PI
     
    C GET NUMBER OF ITERATIONS
    10    FORMAT('+', C12, M1.1, 'Number of iterations? ', I8)
          READ(6, 10) N
     
    C MAIN PROGRAM LOOP
    20    FORMAT('+', M12.1, 'Iteration # ', I8)
          I = 1
          DO WHILE(I .LE. N)
            X = IRAND(10) / 10
            Y = IRAND(10) / 10
            D = X**2 + Y**2
            IF (D .LE. 1) THEN
              TOTAL = TOTAL + 1
            ENDIF
            WRITE(6, 20) I
            I = I + 1
          REPEAT
     
    C FINALIZE RESULT AND DISPLAY
    30    FORMAT('+', M23.1, 'Approximate PI = ', F1.6)
          PI = TOTAL / N * 4
          WRITE(6, 30) PI
          STOP
          END

     

×
×
  • Create New...