Category:XPL0
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. Some tasks were implemented using EXPL-32.
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!")
Pages in category "XPL0"
The following 200 pages are in this category, out of 812 total.
(previous page) (next page)P
- Pangram checker
- Parse command-line arguments
- Parsing/RPN calculator algorithm
- Parsing/Shunting-yard algorithm
- Pascal matrix generation
- Pascal's triangle
- Pascal's triangle/Puzzle
- Password generator
- Pathological floating point problems
- Peano curve
- Penholodigital squares
- Pentagram
- Perfect numbers
- Perfect shuffle
- Perfect totient numbers
- Periodic table
- Peripheral drift illusion
- Perlin noise
- Permutation test
- Permutations
- Permutations by swapping
- Permuted multiples
- Pernicious numbers
- Pick random element
- Pierpont primes
- Pig the dice game
- Pinstripe/Display
- Piprimes
- Plasma effect
- Playing cards
- Plot coordinate pairs
- Pointers and references
- Polynomial derivative
- Polyspiral
- Population count
- Positive decimal integers with the digit 1 occurring exactly twice
- Power set
- Pragmatic directives
- Price fraction
- Primality by trial division
- Primality by Wilson's theorem
- Prime decomposition
- Prime numbers p for which the sum of primes less than or equal to p is prime
- Prime numbers which contain 123
- Prime numbers which sum of digits is also prime
- Prime triplets
- Prime words
- Primes which contain only one odd digit
- Primes whose first and last number is 3
- Primes whose sum of digits is 25
- Primes with digits in nondecreasing order
- Priority queue
- Probabilistic choice
- Problem of Apollonius
- Product of divisors
- Product of min and max prime factors
- Program termination
- Proper divisors
- Pseudo-random numbers/Middle-square method
- Pseudorandom number generator image
- Pythagoras tree
- Pythagorean quadruples
- Pythagorean triples
R
- Radical of an integer
- Random number generator (device)
- Random number generator (included)
- Random numbers
- Range expansion
- Range extraction
- Rate counter
- Read a file line by line
- Read a specific line from a file
- Read entire file
- Real constants and functions
- Reduced row echelon form
- Remove duplicate elements
- Remove lines from a file
- Remove vowels from a string
- Repeat a string
- Resistor mesh
- Return multiple values
- Reverse a string
- Reverse the order of lines in a text file while preserving the contents of each line
- Reverse words in a string
- Roman numerals/Decode
- Roman numerals/Encode
- Roots of a function
- Rot-13
- Round-robin tournament schedule
- RPG attributes generator
- Run-length encoding
- Runge-Kutta method
- Ruth-Aaron numbers
S
- Safe and Sophie Germain primes
- Safe primes and unsafe primes
- Sattolo cycle
- Scope/Function names and labels
- Search a list
- SEDOLs
- Selectively replace multiple instances of a character within a string
- Self-describing numbers
- Semiprime
- Semordnilap
- SEND + MORE = MONEY
- Sequence of non-squares
- Sequence of primes by trial division
- Sequence: smallest number greater than previous term with exactly n divisors
- Sequence: smallest number with exactly n divisors
- Set
- Sexy primes
- Shift list elements to left by 3
- Shoelace formula for polygonal area
- Show ASCII table
- Show the (decimal) value of a number of 1s appended with a 3, then squared
- Sierpinski arrowhead curve
- Sierpinski carpet
- Sierpinski pentagon
- Sierpinski triangle
- Sierpinski triangle/Graphical
- Sieve of Eratosthenes
- Simple windowed application
- Singly-linked list/Element definition
- Singly-linked list/Element insertion
- Singly-linked list/Reversal
- Singly-linked list/Traversal
- Sleep
- Sleeping Beauty problem
- Smallest multiple
- Smallest square that begins with n
- Smarandache prime-digital sequence
- Smith numbers
- Snake
- Snake and ladder
- Soloway's recurring rainfall
- Solve equations with substitution method
- Solve hanging lantern problem
- Solve the no connection puzzle
- Sort an array of composite structures
- Sort an integer array
- Sort disjoint sublist
- Sort primes from list to a list
- Sort stability
- Sort the letters of string in alphabetical order
- Sorting algorithms/Bead sort
- Sorting algorithms/Bogosort
- Sorting algorithms/Bubble sort
- Sorting Algorithms/Circle Sort
- Sorting algorithms/Cocktail sort
- Sorting algorithms/Cocktail sort with shifting bounds
- Sorting algorithms/Comb sort
- Sorting algorithms/Counting sort
- Sorting algorithms/Cycle sort
- Sorting algorithms/Gnome sort
- Sorting algorithms/Heapsort
- Sorting algorithms/Insertion sort
- Sorting algorithms/Merge sort
- Sorting algorithms/Pancake sort
- Sorting algorithms/Quicksort
- Sorting algorithms/Selection sort
- Sorting algorithms/Shell sort
- Sorting algorithms/Stooge sort
- Soundex
- Special characters
- Special divisors
- Special neighbor primes
- Special pythagorean triplet
- Sphenic numbers
- Spinning rod animation/Text
- Spiral matrix
- Split a character string based on change of character
- Square but not cube
- Stack
- Stair-climbing puzzle
- Start from a main routine
- Statistics/Basic
- Steady squares
- Stem-and-leaf plot
- Stirling numbers of the first kind
- Strange numbers
- Strange plus numbers
- Strange unique prime triplets
- String append
- String case
- String comparison
- String concatenation
- String interpolation (included)
- String length
- String matching
- String prepend
- Strip a set of characters from a string
- Strip comments from a string
- Strip control codes and extended characters from a string
- Strip whitespace from a string/Top and tail
- Strong and weak primes
- Sub-unit squares