Focal (HP-41)

Focal (HP-41)

The Forty-one calculator language (Focal) is the language used to program the HP-41 range of expandable science/engineering calculators from Hewlett-Packard.

As with most other calculator programming languages of the 1980s, a Focal program is a linear list of instructions. Each instruction (or "step") roughly correspond to a key (or key combination)press, and thus correspond to what the user would do if he was to perform the computation himself on the calculator. This paradigm made Focal programming relatively easy for the newcomer, but program maintenance could be a nightmare.Add to that the use of GOTO instructions—including going to a program step based on a value in a data register ("GTO IND"), a technique known as "computed goto"—and you had all the ingredients for the dreaded spaghetti code syndrome.

Program steps are numbered starting from 1, but this numbering has no intrinsic meaning, and can change as new instructions areadded or removed in the middle of a program. A special instruction LBL is used to create a label, that can be used by theuser to invoke the program, or by the program itself, as target of a GTO (unconditional go-to) or XEQ (execute) instruction.

Here's a very simple Focal program :

001 LBL "DOUBLE" 002 2 003 * 004 END

*The LBL "DOUBLE" instruction is a label, indicating that the user can invoke the program by XEQ "DOUBLE". As this function can also be assigned to any key on the calculator's keyboard, this effectively adds a new function to the calculator.

*The next two steps correspond to what the function does, mainly multiply the X register by 2 (the HP-41 uses RPN notation.)

*The END instruction indicates the end of the program.

Note that contrary to many other programmable calculators, each Focal step could be stored in memory as more than one byte.While the calculator memory could hold 2233 bytes of program code, no reported program actually reached this number of steps.

External links

* [http://www.hpmuseum.org/prog/hp41prog.htm HP-41C/CV/CX Programming] – From The Museum of HP Calculators (MoHPC)


Wikimedia Foundation. 2010.

Игры ⚽ Поможем сделать НИР

Look at other dictionaries:

  • FOCAL-69 — was the landmark version of the FOCAL programming language, more widely publicized than the original version of the language created in 1968. FOCAL 69, created by Richard Merrill is important because: * It was the basis for all later derivatives… …   Wikipedia

  • focal — focal, ale, aux [ fɔkal, o ] adj. et n. f. • 1812; du lat. focus « foyer » 1 ♦ Phys. Qui concerne le foyer, les foyers d un instrument d optique. ⇒ bifocal. Axe focal, plan focal. N. f. Distance focale. Objectif à focale variable. ⇒ zoom. 2 ♦… …   Encyclopédie Universelle

  • Focal — may refer to:*Focal (lexicographical website), an Irish lexicographical website *FOCAL (programming language) **FOCAL 69 **Focal (HP 41) *Relating to focusee also*Focal point (disambiguation) *Focal adhesion *Focal character *Focal dystonia… …   Wikipedia

  • focal — FOCÁL, Ă, focali, e, adj. (fiz.) Privitor la focarul lentilelor sau al oglinzilor. ♢ Distanţă focală = distanţa dintre centrul unei lentile şi focarul său. – Din fr. focal. Trimis de zaraza joe, 13.09.2007. Sursa: DEX 98  focál adj. m., pl.… …   Dicționar Român

  • FOCAL (HP-41) — FOCAL ist die am meisten verbreitete Bezeichnung der Programmiersprache für die Taschenrechnerserie HP 41 von Hewlett Packard, die mit dem Modell HP 41C gestartet wurde. FOCAL ist ein Akronym aus Forty One CAlculator Language. FOCAL bietet mehr… …   Deutsch Wikipedia

  • Focal — Fo cal, a. [Cf. F. focal. See {Focus}.] Belonging to,or concerning, a focus; as, a focal point. [1913 Webster] {Focal distance, or length, of a lens or mirror} (Opt.), the distance of the focus from the surface of the lens or mirror, or more… …   The Collaborative International Dictionary of English

  • FOCAL — steht für zwei verschiedene Programmiersprachen: FOCAL (HP 41) (für Forty One CAlculator Language) auf programmierbaren Taschenrechnern von Hewlett Packard (HP) FOCAL (für FOrmular CALculator), insbesondere FOCAL 69, ist eine Programmiersprache… …   Deutsch Wikipedia

  • focal — focal, ale (fo kal, ka l ) adj. Terme de géométrie et de physique. Qui a rapport au foyer d un miroir ou d une lentille.    Distance focale, intervalle compris entre le centre optique d une lentille et son foyer principal ou l objet qui s y… …   Dictionnaire de la Langue Française d'Émile Littré

  • focal — adjetivo 1. Área: física, geometría Del foco: distancia focal …   Diccionario Salamanca de la Lengua Española

  • focal — adj. Fís. y Geom. Perteneciente o relativo al foco. Distancia focal …   Diccionario de la lengua española

  • Focal... — Focal... (v. lat.), den Focus, s.d. 3), betreffend, z.B. Focaldistanz, die Entfernung vom Brennpunkte …   Pierer's Universal-Lexikon

Share the article and excerpts

Direct link
https://en-academic.com/dic.nsf/enwiki/351446 Do a right-click on the link above
and select “Copy Link”