Babbage (programming language)

Print Print
Reading time 2:59

Babbage
Paradigmprocedural, structured, High-level assembler
First appearedaround 1971; 50 years ago (1971)
Stable release
308
OSCOS, GEC DOS, OS4000
Influenced by
BCPL

Babbage is the high level assembly language for the GEC 4000 series minicomputers.[1] It was named after Charles Babbage, an English computing pioneer.

Example

PROCESS CHAPTER FACTORIAL

ENTRY LABEL ENTRYPOINT

LITERAL TO = 4                              // Assume using the default proforma

EXTERNAL ROUTINE
     OPEN,
     PUT,
     CLOSE,
     TOCHAR

VECTOR [0,19] OF BYTE ANSWER = "factorial x = xxxxxx"
 
HALF COUNT
HALF VALUE
FULL RESULT

//******************************************************************************

     ROUTINE FACT(VALUE)
     // return factorial of RA.

     VALUE => RESULT

     WHILE DECREMENT VALUE GT //0// DO
     <<
          RESULT * VALUE => RESULT
     >>
     RETURN(RESULT)
     END

//******************************************************************************

ENTRYPOINT:

     OPEN(TO, 1)

     // Print factorials for numbers 1 through 9
     1 => RA
     REPEAT
     <<
          RA => COUNT
          FACT(RA) => RA
          TOCHAR(RA, 7, ANSWER + 13)
          TOCHAR(COUNT, 2, ANSWER + 9)
          PUT(TO, 20, ANSWER)
          COUNT + 1 => RA
     >>
     WHILE RA LT 10

     CLOSE(TO)
     STOP(0)
     END

//******************************************************************************

See also

  • GEC 4000 series
  • OS4000

References

  1. ^ Salomon, David (February 1993). "6.1.4 BABBAGE". In Chivers, Ian D. (ed.). Assemblers and Loaders (PDF). Ellis Horwood Series In Computers And Their Applications (1 ed.). Chicester, West Sussex, UK: Ellis Horwood Limited / Simon & Schuster International Group. pp. 184–185. ISBN 0-13-052564-2. Archived (PDF) from the original on 2020-03-23. Retrieved 2008-10-01. [1] (xiv+294+4 pages)


By: Wikipedia.org
Edited: 2021-06-18 18:11:49
Source: Wikipedia.org