Category:XPL0
![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 MS-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 MS-DOS compiler, XPLPX, was used for many 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 rewritten 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 867 total.
(previous page) (next page)R
- Radical of an integer
- Rainbow
- Ramer-Douglas-Peucker line simplification
- Random number generator (device)
- Random number generator (included)
- Random numbers
- Range expansion
- Range extraction
- Raster bars
- 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
- Roots of a quadratic 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 numbers
- 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 curve
- Sierpinski pentagon
- Sierpinski triangle
- Sierpinski triangle/Graphical
- Sieve of Eratosthenes
- Simple turtle graphics
- 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
- Steffensen's method
- 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
- Subleq
- Subset sum problem
- Substring
- Substring primes
- Substring/Top and tail
- Successive prime differences
- Sudan function
- Sudoku
- Sum and product of an array
- Sum digits of an integer
- Sum multiples of 3 and 5
- Sum of a series
- Sum of divisors
- Sum of elements below main diagonal of matrix
- Sum of first n cubes
- Sum of primes in odd positions is prime
- Sum of square and cube digits of an integer are primes
- Sum of squares
- Sum of the digits of n is substring of n
- Sum of two adjacent numbers are primes
- Summarize primes
- Summation of primes
- Sunflower fractal
- Superellipse
- Superpermutation minimisation
- Symmetric difference
- Syntax highlighting using Mediawiki formatting
- System time
T
- Take notes on the command line
- Tau function
- Tau number
- Taxicab numbers
- Temperature conversion
- Terminal control/Clear the screen
- Terminal control/Coloured text
- Terminal control/Cursor movement
- Terminal control/Cursor positioning
- Terminal control/Dimensions
- Terminal control/Display an extended character
- Terminal control/Hiding the cursor
- Terminal control/Inverse video
- Terminal control/Positional read
- Terminal control/Preserve screen
- Terminal control/Restricted width positional input/No wrapping
- Terminal control/Ringing the terminal bell
- Test integerness
- Text between
- Text processing/Max licenses in use
- The Name Game
- The Twelve Days of Christmas
- Thue-Morse