Tagged: Fortran
I’m sharing a small document I made after managing to start compiling in Fortran with the Altair Mini 8800.
You need to mount CP/M on drive 0 and Fortran on drive 1!
FORTRAN 80
Hello World
– Step by Step:
Instruction -> A>ED B:HOLA.FOR
NEW FILE
*I
PROGRAM HOLA
WRITE(1,10)
10 FORMAT (‘ Hello World’)
STOP
END
(Note: at this point, press Ctrl+Z to finish code input)
*E
Instructions ->
A>B:
B>DIR
B: CPMIO MAC : CRCKLIST CRC : CREF80 COM : DSKDRV MAC
B: DTBF MAC : F80 COM : FCHAIN MAC : FORLIB REL
B: INIT MAC : IOINIT MAC : L80 COM : LIB COM
B: LPTDRV MAC : LUNTB MAC : M80 COM : TTYDRV MAC
B: HOLA BAK : HOLA FOR : HOLA REL : FORT07 DAT
B: CPMIO REL : IOINIT REL : TTYDRV REL
B>F80 HOLA=HOLA
HOLA
B>L80 HOLA,CPMIO/S,IOINIT/S,FORLIB/S,HOLA/N/E
Output:
Link-80 3.44 09-Dec-81 Copyright (c) 1981 Microsoft
Data 0103 1A89 < 6534>
FORLIB RQUEST
35018 Bytes Free
[0112 1A89 26]
Intruction -> B>HOLA
output -> HOLA MUNDO STOP
CLARIFICATIONS →
When writing FORTRAN code, indentation is critically important.
Everything that is code not associated with a line must start being written with 6 leading spaces, from the seventh cursor position. (see image)
When a line has a reference number (line number), it must be declared in the first two columns of the indentations, and the code, as usual, starting from the seventh cursor position.
• FORTRAN code lines:
WRITE(7,10)
WRITE(7,10) = “Writes using logical unit 7 (which points to the console), with format number 10 (the line that starts with 10 in the code), which contains the text HELLO WORLD.”
Regarding the 7, 5 is the standard input (keyboard), 6 the standard output (screen or printer, depending on configuration). Right now it is configured to 7 (console).
• CP/M command lines:
B>F80 HOLA=HOLA
Left side of “=”: name of the object file to generate (HOLA.REL).
Right side of “=”: name of the source file to compile (HOLA.FOR).
What is the .REL file?
It is the result of compiling a source file (.FOR in Fortran).
B>L80 HOLA,CPMIO/S,IOINIT/S,FORLIB/S,HOLA/N/E
What each part does:
• HOLA → is your object file (HOLA.REL) that you want to link.
• CPMIO/S, IOINIT/S → are input/output modules (CP/M drivers) in .REL format. The /S indicates “Search”, that is, look for them in the library if they are needed.
• FORLIB/S → is the Fortran routines library. The /S tells the linker to search in that library for all the subroutines your program needs.
• HOLA/N/E →
• N = creates the executable file named HOLA.COM.
• E = after linking, executes the program directly.
Flow
1. F80 HOLA=HOLA → generates HOLA.REL.
2. L80 HOLA,CPMIO/S,IOINIT/S,FORLIB/S,HOLA/N/E → combines your object, the I/O modules and the Fortran library, and produces HOLA.COM.
3. Immediately executes HOLA.COM.
Hobby Model Roma di Giuseppe Convertino
P.Iva IT 09336871000 © 2026 Altair Mini
Design & Developed by Buy WordPress Templates