Action programming language
Encyclopedia
Action!
Developer
Software developer
A software developer is a person concerned with facets of the software development process. Their work includes researching, designing, developing, and testing software. A software developer may take part in design, computer programming, or software project management...

:
Optimized Systems Software
Optimized Systems Software
Optimized Systems Software was a small company producing operating systems and programming languages for the Atari 8-bit and Apple II computer families...

Latest Release: 3.6
Release date: 1983
Platform: Atari 400/800/XL/XE
Atari 8-bit family
The Atari 8-bit family is a series of 8-bit home computers manufactured from 1979 to 1992. All are based on the MOS Technology 6502 CPU and were the first home computers designed with custom coprocessor chips...

Genre
Computer and video game genres
Video game genres are used to categorize video games based on their gameplay interaction rather than visual or narrative differences. A video game genre is defined by a set of gameplay challenges. They are classified independent of their setting or game-world content, unlike other works of fiction...

:
Programming Language
Media: cartridge
License: Copyright © 1994 Fine Tooned Engineering


Action! is a programming language
Programming language
A programming language is an artificial language designed to communicate instructions to a machine, particularly a computer. Programming languages can be used to create programs that control the behavior of a machine and/or to express algorithms precisely....

, with integrated editor, debugger, and 6502
MOS Technology 6502
The MOS Technology 6502 is an 8-bit microprocessor that was designed by Chuck Peddle and Bill Mensch for MOS Technology in 1975. When it was introduced, it was the least expensive full-featured microprocessor on the market by a considerable margin, costing less than one-sixth the price of...

 compiler
Compiler
A compiler is a computer program that transforms source code written in a programming language into another computer language...

, for the Atari 8-bit family
Atari 8-bit family
The Atari 8-bit family is a series of 8-bit home computers manufactured from 1979 to 1992. All are based on the MOS Technology 6502 CPU and were the first home computers designed with custom coprocessor chips...

 of microcomputers. Action! was created by Clinton Parker and released on cartridge by Optimized Systems Software
Optimized Systems Software
Optimized Systems Software was a small company producing operating systems and programming languages for the Atari 8-bit and Apple II computer families...

 in 1983. Its syntax is similar to that of ALGOL 68
ALGOL 68
ALGOL 68 isan imperative computerprogramming language that was conceived as a successor to theALGOL 60 programming language, designed with the goal of a...

.

Action! is significant for its high performance, which allows games and graphics demos to be written in a high-level language without use of hand-written assembly language
Assembly language
An assembly language is a low-level programming language for computers, microprocessors, microcontrollers, and other programmable devices. It implements a symbolic representation of the machine codes and other constants needed to program a given CPU architecture...

 code. Action! language constructs were designed to map cleanly to 6502 opcodes.

A development library was available as a separate product called the Action! Toolkit. Action! was used to develop at least two commercial products: the Homepak
Homepak
Homepak by Batteries Included, was an integrated application for the Commodore 64 and Atari 8-bit personal computers.Homepak combined word-processor, database and communications modules into one application.*Hometext*Homefind*Hometerm...

 productivity suite and Games Computers Play
Games Computers Play
In the 1980s, Games Computers Play was an online service and one of the first multiplayer online games to offer a graphical user interface ....

 client program. The language was never ported to other systems.

In 2007 it inspired Effectus - a cross-compiler currently running on Windows targeting the Atari 8-bit. Effectus resembles Action! syntax and is intended to be as compatible as possible with it.

BYTE

Internally represented as an unsigned
Signedness
In computing, signedness is a property of data types representing numbers in computer programs. A numeric variable is signed if it can represent both positive and negative numbers, and unsigned if it can only represent non-negative numbers .As signed numbers can represent negative numbers, they...

 8-bit
Bit
A bit is the basic unit of information in computing and telecommunications; it is the amount of information stored by a digital device or other physical system that exists in one of two possible distinct states...

 integer. Values range from 0 to 255.

The CHAR keyword can also be used to declare BYTE variables.

BYTE age=[21] ; declare age and initialize it to the value 21
BYTE leftMargin=82 ; declare leftMargin and store it at address 82

CARDinal

Internally represented as an unsigned
Signedness
In computing, signedness is a property of data types representing numbers in computer programs. A numeric variable is signed if it can represent both positive and negative numbers, and unsigned if it can only represent non-negative numbers .As signed numbers can represent negative numbers, they...

 16-bit
Bit
A bit is the basic unit of information in computing and telecommunications; it is the amount of information stored by a digital device or other physical system that exists in one of two possible distinct states...

 integer. Values range from 0 to 65,535.

CARD population=$600 ; declare population and store it at address 1536 and 1537
CARD prevYear, curYear, nextYear ; use commas to declare multiple variables

INTeger

Internally represented as a signed
Signedness
In computing, signedness is a property of data types representing numbers in computer programs. A numeric variable is signed if it can represent both positive and negative numbers, and unsigned if it can only represent non-negative numbers .As signed numbers can represent negative numbers, they...

 16-bit
Bit
A bit is the basic unit of information in computing and telecommunications; it is the amount of information stored by a digital device or other physical system that exists in one of two possible distinct states...

 integer. Values range from -32,768 to 32,767.

INT veryCold = [-10]
INT profitsQ1, profitsQ2, ; declaring multiple variables can
profitsQ3, profitsQ4 ; span across multiple lines

Action! also has ARRAYs, POINTERs and user-defined TYPEs. No floating point
Floating point
In computing, floating point describes a method of representing real numbers in a way that can support a wide range of values. Numbers are, in general, represented approximately to a fixed number of significant digits and scaled using an exponent. The base for the scaling is normally 2, 10 or 16...

 support was provided.

An example of a user-defined TYPE:

TYPE CORD=[CARD x,y]
CORD point
point.x=42
point.y=23

Keywords

A "keyword" is any word or symbol that the ACTION! compiler recognizes as something special. It can be an operator, a data type name, a statement, or a compiler directive.

AND FI OR UNTIL = (
ARRAY FOR POINTER WHILE <> )
BYTE FUNC PROC XOR # .
CARD IF RETURN + > [
CHAR INCLUDE RSH - >= ]
DEFINE INT SET * < "
DO LSH STEP / <= '
ELSE MOD THEN & $ ;
ELSEIF MODULE TO % ^
EXIT OD TYPE ! @

Programming

Programming in Action! requires working with the editor and compiling/debugging in the monitor. The editor features a full-screen, scrolling display capable of displaying two windows. The editor also includes block operations and global search and replace. Compiling takes place in the monitor, a mode that allows compiling and debugging.

Action! is a one-pass compiler
One-pass compiler
In computer programming, a one-pass compiler is a compiler that passes through the source code of each compilation unit only once. In other words, a one-pass compiler does not "look back" at code it previously processed. Another term sometimes used is narrow compiler, which emphasizes the limited...

, which compiles the source code
Source code
In computer science, source code is text written using the format and syntax of the programming language that it is being written in. Such a language is specially designed to facilitate the work of computer programmers, who specify the actions to be performed by a computer mostly by writing source...

 entirely in memory or from a file. This allows great speed, but limits the amount of code that may be compiled.

Local variables are assigned fixed addresses in memory, instead of being allocated on the stack. This enables tight code to be generated for the 6502, but precludes the use of recursion
Recursion
Recursion is the process of repeating items in a self-similar way. For instance, when the surfaces of two mirrors are exactly parallel with each other the nested images that occur are a form of infinite recursion. The term has a variety of meanings specific to a variety of disciplines ranging from...

.

Example code

The following is example code for Sieve of Eratosthenes
Sieve of Eratosthenes
In mathematics, the sieve of Eratosthenes , one of a number of prime number sieves, is a simple, ancient algorithm for finding all prime numbers up to a specified integer....

 written in Action!. In order to increase performance, it disables the ANTIC
ANTIC
Alphanumeric Television Interface Controller is an early video system chip used in the Atari 8-bit family of microcomputers as well as the Atari 5200 in the 1980s. The chip was patented by Atari, Inc. in 1981...

 graphics co-processor, preventing its DMA
Direct memory access
Direct memory access is a feature of modern computers that allows certain hardware subsystems within the computer to access system memory independently of the central processing unit ....

engine from "stealing" CPU cycles during computation.

BYTE RTCLOK=20, ; addr of sys timer
SDMCTL=559 ; DMA control

BYTE ARRAY FLAGS(8190)

CARD COUNT,I,K,PRIME,TIME

PROC SIEVE

SDMCTL=0 ; shut off Antic
RTCLOK=0 ; only one timer needed

COUNT=0 ; init count
FOR I=0 TO 8190 ; and flags
DO
FLAGS(I)='T ; "'T" is a compiler-provided constant for True
OD

FOR I=0 TO 8190 ; and flags
DO
IF FLAGS(I)='T THEN
PRIME=I+I+3
K=I+PRIME
WHILE K<=8190
DO
FLAGS(K)='F ; "'F" is a compiler-provided constant for False
K

+PRIME
OD
COUNT

+1
FI
OD
TIME=RTCLOK ; get timer reading
SDMCTL=34 ; restore screen

PRINTF("%E %U PRIMES IN",COUNT)
PRINTF("%E %U JIFFIES",TIME)
RETURN

External links

The source of this article is wikipedia, the free encyclopedia.  The text of this article is licensed under the GFDL.
 
x
OK