Category:XPL0: Difference between revisions
m Clarified need for 'code' declarations |
m Internal link: PL/0. |
||
Line 3:
by Peter J. R. Boyle, who designed it to run on a 6502 microprocessor as
an alternative to BASIC, which was the dominant language for personal
computers at the time. XPL0 is based on [[PL/0]], an example compiler in the
book ''Algorithms + Data Structures = Programs'' by Niklaus Wirth. The first
XPL0 compiler was written in ALGOL, which was then used to create a compiler
|
Revision as of 01:02, 2 February 2023
![Language](http://static.miraheze.org/rosettacodewiki/thumb/2/27/Rcode-button-language-crushed.png/64px-Rcode-button-language-crushed.png)
This programming language may be used to instruct a computer to perform a task.
See Also: |
|
---|
XPL0 is essentially a cross between Pascal and C. It looks somewhat like Pascal but works more like C. It was originally created in 1976 by Peter J. R. Boyle, who designed it to run on a 6502 microprocessor as an alternative to BASIC, which was the dominant language for personal computers at the time. XPL0 is based on PL/0, an example compiler in the book Algorithms + Data Structures = Programs by Niklaus Wirth. The first XPL0 compiler was written in ALGOL, which was then used to create a compiler written in XPL0's syntax.
XPL0 has been implemented on more than a dozen processors, but it's currently maintained on the Raspberry Pi and IBM-type PCs. Programs run under Linux, Windows, and DOS. Free, open-source versions of the compilers (interpreted, assembly-code compiled, and optimizing) are available from the official website: xpl0.org [1]. The 32-bit version of the DOS compiler, XPLPX, was used for most of these Rosetta Code tasks, but more recent tasks were implemented using the compilers for the Raspberry Pi.
Here's how the traditional Hello World program is coded:
code Text=12; Text(0, "Hello World!")
Text is a built-in routine, called an intrinsic, that outputs a string of characters. The zero (0) tells where to send the string. In this case it is sent to the display screen; but it could just as easily be sent to a printer, a file, or out a serial port by using a different number.
All names must be declared before they can be used. The command word code associates the name Text to the built-in routine number 12, which outputs strings. There are over a hundred of these built-in routines that provide capabilities such as input and output, graphics, and trig functions.
The 32-bit versions of the compilers (as opposed to the older, 16-bit versions) automatically declare code declarations. Thus the above program can simply be written as:
Text(0, "Hello World!")
Subcategories
This category has the following 2 subcategories, out of 2 total.
@
- XPL0 Implementations (1 P)
- XPL0 User (1 P)
Pages in category "XPL0"
The following 200 pages are in this category, out of 870 total.
(previous page) (next page)D
E
- Eban numbers
- Egyptian division
- EKG sequence convergence
- Elementary cellular automaton
- Emirp primes
- Empty program
- Empty string
- Enforced immutability
- Entropy
- Entropy/Narcissist
- Enumerations
- Environment variables
- Equal prime and composite sums
- Equilibrium index
- Erdős-Nicolas numbers
- Erdős-primes
- Esthetic numbers
- Ethiopian multiplication
- Euler method
- Euler's constant 0.5772...
- Euler's sum of powers conjecture
- Evaluate binomial coefficients
- Even numbers which cannot be expressed as the sum of two twin primes
- Even or odd
- Evolutionary algorithm
- Exactly three adjacent 3 in lists
- Exceptions
- Exceptions/Catch an exception thrown in a nested call
- Execute Computer/Zero
- Exponentiation operator
- Exponentiation order
- Extra primes
- Extract file extension
- Extreme floating point values
- Extreme primes
F
- Factorial
- Factorial primes
- Factorions
- Factors of an integer
- Fairshare between two and more
- Farey sequence
- FASTA format
- Feigenbaum constant calculation
- Fibonacci n-step number sequences
- Fibonacci sequence
- File extension is in extensions list
- File input/output
- File size
- Filter
- Find adjacent primes which differ by a square integer
- Find first and last set bit of a long integer
- Find first missing positive
- Find if a point is within a triangle
- Find limit of recursion
- Find minimum number of coins that make a given value
- Find prime n such that reversed n is also prime
- Find prime numbers of the form n*n*n+2
- Find square difference
- Find squares n where n+1 is prime
- Find the intersection of a line with a plane
- Find the intersection of two lines
- Find the last Sunday of each month
- Find the missing permutation
- Find words which contain the most consonants
- Find words which contains all the vowels
- Find words which contains more than 3 e vowels
- Find words whose first and last three letters are equal
- Find words with alternating vowels and consonants
- Finite state machine
- First 9 prime Fibonacci number
- First perfect square in base n with n unique digits
- Five weekends
- Fixed length records
- FizzBuzz
- Flow-control structures
- Floyd's triangle
- Forbidden numbers
- Fork
- Formatted numeric output
- Forward difference
- Four bit adder
- Four sides of square
- Fractal tree
- Frobenius numbers
- Function definition
- Function frequency
- Fusc sequence
G
- Galton box animation
- Gamma function
- Gapful numbers
- General FizzBuzz
- Generate Chess960 starting position
- Generate lower case ASCII alphabet
- Generate random numbers without repeating a value
- Generator/Exponential
- Generic swap
- Get system command output
- Giuga numbers
- Globally replace text in several files
- Goldbach's comet
- Golden ratio/Convergence
- Gray code
- Greatest common divisor
- Greatest element of a list
- Greatest prime dividing the n-th cubefree number
- Greatest subsequential sum
- Greyscale bars/Display
- Guess the number
- Guess the number/With feedback
- Guess the number/With feedback (player)
- GUI/Maximum window dimensions
H
- Hailstone sequence
- Halt and catch fire
- Hamming numbers
- Happy numbers
- Harmonic series
- Harshad or Niven series
- Hash from two arrays
- Haversine formula
- Hello world/Graphical
- Hello world/Line printer
- Hello world/Newline omission
- Hello world/Standard error
- Hello world/Text
- Here document
- Heronian triangles
- Hex dump
- Hilbert curve
- Hofstadter Q sequence
- Hofstadter-Conway $10,000 sequence
- Honaker primes
- Honeycombs
- Horizontal sundial calculations
- Horner's rule for polynomial evaluation
- Host introspection
- Humble numbers
I
- Identity matrix
- Idiomatically determine all the characters that can be used for symbols
- Idiomatically determine all the lowercase and uppercase letters
- Idoneal numbers
- Image noise
- Implicit type conversion
- Include a file
- Inconsummate numbers in base 10
- Increasing gaps between consecutive Niven numbers
- Increment a numerical string
- Infinity
- Input loop
- Input/Output for lines of text
- Input/Output for pairs of numbers
- Integer comparison
- Integer overflow
- Integer roots
- Integer sequence
- Inventory sequence
- ISBN13 check digit
- Iterated digits squaring
- Iterators
J
K
- K-means++ clustering
- Kahan summation
- Kaprekar numbers
- Kernighans large earthquake problem
- Keyboard input/Flush the keyboard buffer
- Keyboard input/Keypress check
- Keyboard input/Obtain a Y or N response
- Klarner-Rado sequence
- Knapsack problem/0-1
- Knapsack problem/Continuous
- Knapsack problem/Unbounded
- Knight's tour
- Knuth shuffle
- Koch curve