BASIC Commands and Memory Address

BASIC Command List:

CommandInternal CodeDescription
ABSF170HReturns absolute value of a number
ACSF174HArc cosine function
ANDF150HLogical AND operation
AREADF18OHReads analog input
ARUNF181HAuto-run a program
ASCF160HReturns ASCII code of a character
ASNF173HArc sine function
ATNF175HArc tangent function
BEEPF182HProduces a sound from the device speaker
BREAKF0B3HInterrupts program execution
CALLF18AHCalls a machine language subroutine
CHAINF0B2HLinks to another program
CHR$F163HConverts ASCII code to character
CLEARF187HClears variables and resets memory
CLOADF089HLoads program from tape
CLSF088HClears the display
COM$F858HCommunicates via serial port
CONSOLEF0B1HSwitches to console mode
CONTF183HContinues from a STOP or BREAK
COLORF0B5HSets display text color
COSF17EHCosine function
CSAVEF095HSaves program to tape
CSIZEE680HSets character size for printing
CURSORF084HPositions cursor
DATAF18DHHolds data for READ statements
DEFF165HDefines a function
DEGREEF18CHSets angle mode to degrees
DEV$E857HDevice name for serial communication
DIMF179HDeclares an array with specified dimensions
DMSF166HDegree-minute-second (DMS) conversion
DTEE884HDate function
ENDF19EHMarks end of program
ERLF053HReturns line number of error
ERNF052HReturns error number
ERRORF1B4HError handling function
EXPF176HCalculates e^x
FEEDF0B0HPaper feed on printer
FORF1A5HBegins a FOR loop
GCURSORF093HGraphics cursor control
GLCURSORE682HLower graphics cursor control
GOSUBF194HJumps to subroutine, returning with RETURN
GOTOF192HUnconditional jump to a line number
GPRINTF09FGraphics print
GRADF186HSets angle mode to gradients
GRAPHE681HSwitches to graphics mode
IFF196HConditional branching
INKEY$F15CHReturns last pressed key
INPUTF091HTakes input from the user
INSTATE859FChecks input status
INTF171HConverts to integer
LCURSORE683HLower cursor control
LEFT$F17AHReturns left substring
LENF164HReturns length of a string
LETF198HAssigns a value to a variable
LFF0B6HLine feed
LINEF0B7HDraws line in graphics mode
LISTF090HDisplays program code
LLISTF0B8HList program to printer
LNF176HNatural logarithm
LOCKF1B5HLocks program for editing
LOGF177HNatural Logarithmic function
LPRINTF0B9HPrint to line printer
MEMF158HDisplays memory usage
MERGEF08FHMerges another program into current program
MID$F17BHExtracts a substring
NEWF19BHClears program and data areas
NEXTF19AHEnds a FOR loop
NOTF16DHLogical NOT
OFFF19EHTurns off power (optional in certain models)
ONF19CHHandles events based on specific conditions
OPNF19DHOpens file for I/O
ORF151HLogical OR
OUTSTATE880HChecks output status
PAUSEF1A2HPauses program execution
PEEKF16FHReads data from a memory address
PEEK#F16EHExtended peek for memory data
PIF15DHReturns value of Pi
POINTF168HReturns graphics point color
POKEF1A1HWrites data to a memory address
POKE#F1A0HExtended poke for memory data
PRINTF097HDisplays text on screen
RADIANF1AAHSets angle mode to radians
RANDOMF1A8HReturns a random number
READF1A6HReads data from DATA statements
REMF1ABHComment statement
RESTOREF1A7HResets DATA pointer
RETURNF199HReturns from subroutine
RIGHT$F172HReturns right substring
RINKEY$E85AHReads last input key
RLINEF0BAHReads a line from printer
RMTE7A9HRemote command for communication
RNDF17CHReturns a random number (RANDOM?)
ROTATEE685HRotates graphics display
RUNF1A4HStarts program execution
SETCOME882HSets communication mode
SETDEVE886Sets device configuration
SGNF179HReturns sign of a number
SINF17DHSine function
SORGNE684HSets origin for graphics
SPAVCE$F061HReturns a string of spaces
SQRF16BHReturns the square root of a number
STATUSF167HDisplays status information
STEPF1ADHSpecifies increment in FOR loop
STOPF1ACHPauses program
STR$F161HConverts a number to a string
TABF0BBHMoves cursor to specified position
TANF17FHTangent function
TERMINALE883HSwitches to terminal mode
TESTF0BCHTests condition in program
TEXTE686HSwitches to text mode
THENF1AEHSpecifies action if condition in IF is met
TIMEF15BHReturns current time
TOF1B1HSpecifies range in FOR loop
TRANSMITE885HTransfers data via serial
TROFFF1B0HTurns trace off
TRONF1AFHTurns trace on
UNLOCKF1B6HUnlocks program for editing
USINGF086HFormats output
VALF162HConverts string to a numeric value
WAITF1B3HPauses execution until condition met
ZONEF0B4HSets tabulation zone for printing

System Subroutines List

1. Character Functions

NameMemory AddressDescription
Combination of CharactersD925HCombines multiple characters into a single string
CHR$D9B1HConverts an ASCII code to its corresponding character
STR$D9CFHConverts a string representation of a number back to a numeric value
VALD9D7HConverts a string to a numeric value
LEN, ASCD9DDHLEN: Returns the length of a string; ASC: Returns ASCII code of a character
RIGHT$D9F3HExtracts a specified number of characters from the right end of a string
MID$D9F3HExtracts a substring from a string, given a starting position and length
LEFT$D9F3HExtracts a specified number of characters from the left end of a string

2. Arithmetic Operations

NameMemory AddressDescription
SubtractEFB6HSubtracts one number from another
AddEFBAHAdds two numbers
MultiplyF01AHMultiplies two numbers
DivideF084HDivides one number by another
LNF161HComputes the natural logarithm of a number
LOGF165HComputes the base-10 logarithm of a number
EXPF1CBHCalculates the exponential function (e^x)
10^nF1D4HComputes 10 raised to the power of a specified exponent
COSF391HComputes the cosine of an angle
TANF39EHComputes the tangent of an angle
SINF3A2HComputes the sine of an angle
ACSF492HComputes the arc cosine (inverse cosine) of a value
ATNF496HComputes the arc tangent (inverse tangent) of a value
ASNF49AHComputes the arc sine (inverse sine) of a value
DEGF531HConverts a radian measure to degrees
DMSF564HConverts a degree measure to degrees, minutes, and seconds
ABSF597HComputes the absolute value of a number
SGNF59DHReturns the sign of a number (1 for positive, -1 for negative, 0 for zero)
INTF5BEHReturns the integer portion of a number, discarding any fractional part
Power RiseF89CHRaises a number to a specified power

Arithmetic Operations Table

3. Compare

NameMemory AddressDescription
Numerical ComparisonD0D2HCompares two numeric values and returns a result
Character String ComparisonD0F9HCompares two strings lexicographically to determine order

Compare String Memory Content

NameMemory AddressDescription
Line number SearchD2EAHSearches for a specific line number in the program
KEY Scan (1)E42CHScans the keyboard to detect key presses; single key detection
KEY Scan (2)E243HScans the keyboard for combinations
Variable SearchD461HSearches for a variable by name in the program’s memory

5. Display

NameMemory AddressDescription
Auto-power-offE33FHManages automatic power-off to conserve battery life
Program displayE8CAHDisplays the current program code on the screen
Graphic DisplayEDEFHEnables graphical display mode
HexadecimalED95HDisplays a value in hexadecimal format
One Character DisplayED3BHDisplays a single character at the current position
Cursor Move After One Character DisplayED4DHMoves the cursor one position after displaying
Cursor Move After n Character DisplayED00HMoves the cursor by n positions after displaying

NameMemory AddressDescription
Color DesignationA519HSets the color for subsequent text or graphics display
PrintA781HSends data to be printed
LinefeedA9F1HMoves the cursor or paper to the next line
Paper FeedAA04HAdvances the paper on a connected printer
Get TEXT Mode ReadyACBBHPrepares the system for text mode
Pen Up/DownAAE3HRaises or lowers the pen for drawing or plotting
Motor DriveA8DDHActivates the motor for peripherals like printers
Motor OffA769HTurns off the motor
Get GRAPHIC Mode ReadyABEFHPrepares the system for graphics mode

7. Cassette Tape

NameMemory AddressDescription
Remote OnBF11HActivates remote mode for external control or communication
Remote OffBF43HDeactivates remote mode
One Character SaveBDCCHSaves a single character to memory or storage
One Character LoadBDF0HLoads a single character from memory or storage
Header Input/OutputBCE8HManages input/output operations for data headers
CMT I/O ControlBBF5HControls cassette tape (CMT) input/output functions
Create HeaderBBD6HGenerates a data header for file storage or transmission
Transfer FileBD3CHTransfers a file between devices or storage media