Babbage (programming language)


Babbage is the high level assembly language for the GEC 4000 series minicomputers. 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 OF BYTE ANSWER = "factorial x = xxxxxx"
HALF COUNT
HALF VALUE
FULL RESULT
//******************************************************************************
ROUTINE FACT
// return factorial of RA.
VALUE => RESULT
WHILE DECREMENT VALUE GT //0// DO
<<
RESULT * VALUE => RESULT
>>
RETURN
END
//******************************************************************************
ENTRYPOINT:
OPEN
// Print factorials for numbers 1 through 9
1 => RA
REPEAT
<<
RA => COUNT
FACT => RA
TOCHAR
TOCHAR
PUT
COUNT + 1 => RA
>>
WHILE RA LT 10
CLOSE
STOP
END
//******************************************************************************