Category:FOCAL: Difference between revisions

From Rosetta Code
Content added Content deleted
No edit summary
Line 1: Line 1:
{{stub}}{{language|FOCAL}}
{{stub}}{{language|FOCAL}}


FOCAL, which is allegedly short for "Formulating On-line Calculations in Algebraic Language", is an imperative, interpreted programming language similar to JOSS. It was first introduced in 1968, and FOCAL-69 was widely used on the PDP-8 minicomputer from Digital Equipment Corporation. Like JOSS and BASIC, FOCAL was not intended to be used for developing large applications; the manual said it was "designed to help scientists, engineers, and students solve numerical problems." The design goals thus emphasize simplicity and accessibility. It could also be used satisfactorily on quite small computers: the FOCAL interpreter would run on a PDP-8 with only 4k words (6k bytes) of storage and still leave some space for user programs.
FOCAL, which is allegedly short for "Formulating On-line Calculations in Algebraic Language", is an imperative, interpreted programming language similar to JOSS. It was first introduced in 1968, and FOCAL-69 was widely used on the PDP-8 minicomputer from Digital Equipment Corporation.

Like JOSS and BASIC, FOCAL was not intended to be used for developing large applications; the manual said it was "designed to help scientists, engineers, and students solve numerical problems." The design goals thus emphasize simplicity and accessibility.

FOCAL could also be used satisfactorily on quite small computers: its interpreter runs on a PDP-8 with only 4k words (6k bytes) of storage and still leaves some space for user programs.


==Running FOCAL in a PDP emulator==
==Running FOCAL in a PDP emulator==


There is a 256-line PDP-8 emulator in C which can run the included FOCAL binary tape image. Note that programs will run much faster than on a real PDP-8.
There is a tiny [https://jeelabs.org/2016/09/tfoc---pdp-8-in-256-lines-of-c/ PDP-8 emulator in C] which also includes a FOCAL binary tape image. Note that programs will run much faster on this emulator than on a real PDP-8.


Exit the emulator by pressing Ctrl-Backslash. The emulator will quit and dump the zero page of memory in octal.
To exit the emulator, use Ctrl-Backslash. The emulator will quit and dump the RAM zero page in octal.


Compiling and running the emulator on Linux (should also work on macOS):
Compiling and running the emulator on Linux (should also work on macOS):
Line 35: Line 39:
==External links==
==External links==
*[http://bitsavers.informatik.uni-stuttgart.de/pdf/dec/pdp8/focal/DEC-08-AJAB-D_FOCAL_Programming_Manual_Jan70.pdf FOCAL-8 Programming manual] (PDF) from Bitsavers
*[http://bitsavers.informatik.uni-stuttgart.de/pdf/dec/pdp8/focal/DEC-08-AJAB-D_FOCAL_Programming_Manual_Jan70.pdf FOCAL-8 Programming manual] (PDF) from Bitsavers
*[https://en.wikipedia.org/wiki/FOCAL_(programming_language) FOCAL] article in Wikipedia

Revision as of 00:43, 25 January 2021

This page is a stub. It needs more information! You can help Rosetta Code by filling it in!
Language
FOCAL
This programming language may be used to instruct a computer to perform a task.
See Also:


Listed below are all of the tasks on Rosetta Code which have been solved using FOCAL.

FOCAL, which is allegedly short for "Formulating On-line Calculations in Algebraic Language", is an imperative, interpreted programming language similar to JOSS. It was first introduced in 1968, and FOCAL-69 was widely used on the PDP-8 minicomputer from Digital Equipment Corporation.

Like JOSS and BASIC, FOCAL was not intended to be used for developing large applications; the manual said it was "designed to help scientists, engineers, and students solve numerical problems." The design goals thus emphasize simplicity and accessibility.

FOCAL could also be used satisfactorily on quite small computers: its interpreter runs on a PDP-8 with only 4k words (6k bytes) of storage and still leaves some space for user programs.

Running FOCAL in a PDP emulator

There is a tiny PDP-8 emulator in C which also includes a FOCAL binary tape image. Note that programs will run much faster on this emulator than on a real PDP-8.

To exit the emulator, use Ctrl-Backslash. The emulator will quit and dump the RAM zero page in octal.

Compiling and running the emulator on Linux (should also work on macOS):

$ git clone https://git.jeelabs.org/jcw/embello
$ cd embello/explore/1638-pdp8
$ make
$ ./p8 focal.bin 
LOAD 0000-7577 CHECK 1153

CONGRATULATIONS!!
YOU HAVE SUCCESSFULLY LOADED 'FOCAL,1969' ON A PDP-8 COMPUTER.


SHALL I RETAIN LOG, EXP, ATN ?:NO

SHALL I RETAIN SINE, COSINE ?:NO

PROCEED.

*W
C-FOCAL,1969
*T "HELLO WORLD FROM FOCAL"!
HELLO WORLD FROM FOCAL

External links

Pages in category "FOCAL"

The following 63 pages are in this category, out of 63 total.