// : allows comments in a program // [] // next line scans name field ! : non-executable marker used for invalid lines during ENTER ! [] ! open file 2,"comal0.14'file",unit 8,15 ABS : gives the absolute value ABS() PRINT ABS(standard'number) ACS : gives the arc cosine ACS() PRINT ACS(SQR(3)/2) AF : set or fetch z80 register AF [] AF 0 PRINT AF AND : logical AND AND IF number>0 AND number<100 THEN APPEND : start at end of file for writing OPEN [FILE] ,,APPEND OPEN FILE 2,"test",APPEND ASN : gives the arc sine ASN() PRINT ASN(0.5) AT : begin at specified location PRINT AT ,: [[]] PRINT AT 1,1: "Section number:": num; ATN : arc tangent ATN() PRINT ATN(num1+num2) AUTO : automatic line numbering AUTO [][,] AUTO 9000 AUTO ,2 BC : set or fetch z80 register BC [] BC 5 PRINT BC BIN$ : returns a number in binary form BIN$( PRINT BIN$(128) BITAND : bitwise AND BITAND show(bnum BITAND %00001000) BITOR : bitwise OR BITOR PRINT (bnum BITOR flag) BITXOR : bitwise XOR BITXOR bnum=(num1+num2) BITXOR %10000000 BYE : exit COMAL and return to CP/M BYE BYE CALL : call a machine language routine CALL CALL print'char CASE : multiple choice decisions CASE [OF] CASE reply$ OF CAT : gives disk directory CAT [] CAT "prog*.*" CHAIN : load & run program on disk CHAIN CHAIN "menu" CHANGE : change text - space bar means no, RETURN means yes CHANGE "","" CHANGE "zz","print'report" CHR$ : gives the character specified CHR$() PRINT CHR$(num) CLOSE : closes files CLOSE [[FILE] ] CLOSE FILE 2 CLOSED : all proc/func variables local PROC [(params)] [CLOSED] FUNC [(params)] [CLOSED] PROC newpage(header$) CLOSED FUNC odd(number) CLOSED CODE : execute sequence of instructions CODE [,[,...] CODE $11,x MOD 256,x DIV 256 CON : continue program execution after STOP CON CON COS : cosine COS() PRINT COS(number) CREATE : create RANDOM file on disk CREATE ,, CREATE "names",128,300 CURCOL : returns the cursor column position CURCOL column:=CURCOL CURROW : returns the cursor row position CURROW row:=CURROW CURSOR : positions the cursor CURSOR , CURSOR 1,1 DATA : provides data for a READ DATA [,][,...][,END] DATA "Sam",3.134,"Fred",22,"Gloria",END DE : set or fetch z80 register DE [] DE 32768 PRINT DE DEL : deletes lines DEL DEL DEL DEL DEL DEL 460 DEL 500-600 DEL pause DEL odd DEL TRACE DELETE : deletes a file from disk DELETE DELETE "test5.sav" DIM : reserve string/numeric array space DIM OF DIM () OF DIM () DIM name$ of 30 DIM player$(1:4) of 10 DIM scores(min:max) DIR : display directory of disk DIR [] DIR "prog*.*" DISCARD : discards one or all packages DISCARD [] DISCARD DISCARD "mouse" DISPLAY : display program lines without line numbers DISPLAY [] [] DISPLAY [] DISPLAY DISPLAY 10-100 DISPLAY "readrec" readrec DIV : division with integer answer DIV result=guess DIV count DO : used with FOR and WHILE DO WHILE ok DO WHILE NOT error DO ask'question FOR x:=1 TO max DO show'item(x) DOWNTO : used in FOR loop for -1 STEP DOWNTO FOR x:=10 DOWNTO 1 DO PRINT x DPEEK : returns double byte from memory DPEEK() PRINT DPEEK(memory'address) DPOKE : sets double byte in memory DPOKE , DPOKE memory'address,value+2 DS : set/reset screen output DS DS+ EDIT : list and edit lines without indentations EDIT [] EDIT EDIT EDIT 20 EDIT 500- EDIT pause ELIF : short for ELSE IF condition ELIF [THEN] ELIF reply$ IN "AEIOU" THEN ELSE : alternative IF struc statements ELSE ELSE END : halt program & show message END [] END "All Done." ENDCASE : end of CASE structure ENDCASE ENDCASE ENDFOR : end of FOR structure ENDFOR [] ENDFOR sides ENDFUNC : end of function ENDFUNC [] ENDFUNC pause ENDIF : end of IF structure ENDIF ENDIF ENDLOOP : end of LOOP structure ENDLOOP ENDLOOP ENDPROC : end of procedure ENDPROC [] ENDPROC show'item ENDTRAP : end of TRAP structure ENDTRAP ENDTRAP ENDWHILE : end of WHILE structure ENDWHILE ENDWHILE ENTER : retrieve ASCII program lines ENTER ENTER "testing" EOD : End Of Data flag EOD WHILE NOT EOD DO EOF : End Of File flag EOF() WHILE NOT EOF(infile) DO ERR : returns current error number ERR CASE err OF ERRTEXT$ : returns error message ERRTEXT$ PRINT ERRTEXT$ ESC : escape key pressed flag ESC TRAP ESC UNTIL ESC TRAP ESC+ EXEC : execute a procedure [EXEC] [()] EXEC show'item(number) EXIT : use to leave any looping structure EXIT EXIT EXIT WHEN : conditional exit to looping structures EXIT WHEN EXIT WHEN errors>3 EXP : natural log e to n EXP() PRINT EXP(number) EXTEND : increase number of records in a RANDOM file EXTEND ,, EXTEND "startrek",192,150 EXTERNAL : external proc/funcs or program section PROC [] [EXTERNAL ] FUNC [] [EXTERNAL ] EXTERNAL PROC sum(section) EXTERNAL "sum" FUNC rec'size(name$) EXTERNAL "rec" EXTERNAL FALSE : predefined value equal to 0 FALSE ok:=FALSE FILE : specifies a file is to be used INPUT FILE [,]: [] PRINT FILE [,]: [] READ FILE [,]: [] WRITE FILE [,]: [] OPEN [FILE] ,[,] CLOSE [[FILE] ] INPUT FILE 2: text$ PRINT FILE outfile,count:name$ READ FILE infile,sub:name$,phone$ WRITE FILE 3,1:total'records OPEN FILE 2,"scores",READ CLOSE FILE infile FILESIZE : returns size of file in bytes FILESIZE() PRINT FILESIZE("test.txt") FIND : finds text in a program FIND "" FIND " PROC " FLOAT : returns a number (integer or real) as a real. FLOAT() WRITE FILE 2: FLOAT(count) FOR : start of FOR loop structure FOR := TO | DOWNTO [STEP ] DO FOR := TO | DOWNTO [STEP ] DO FOR sides:=1 TO 4 DO FOR x:=1 TO 10 STEP 2 DO FOR countdown:=10 DOWNTO 1 do print countdown FRAC : returns fractional part of number FRAC() PRINT FRAC(3.14) FREE : returns amount of free program memory FREE PRINT FREE FUNC : start of a multiline function FUNC [()] [CLOSED] FUNC [()] EXTERNAL FUNC odd(number) CLOSED FUNC call'answered EXTERNAL "call" GET$ : returns # of characters from open file GET$(,<# of characters>) text$=GET$(2,16) GOTO : go to line after label named GOTO