PERSONAL COMPUTER FX-890P / Z-1 / Z-1GR OWNER’S MANUAL This manual has been written by a non-Japanese speaking CASIO fan to help other non-Japanese speaking CASIO fans to make the best out of their FX-890P, Z-1GR, Z-1GRa or Z-1GR pocket computer. It is based on the Japanese Z-1 users’ manual, the FX-880 & PB2000C English manuals, and all kind of other information gathered on the web.
CONTENTS 1 Unit Configuration .................................................................................................. 5 1.1 General Guide ................................................................................................. 5 1.2 Operational Functions ..................................................................................... 6 1.3 Symbol Display................................................................................................
5.5.4 END ........................................................................................................ 33 5.5.5 IF – THEN............................................................................................... 33 5.5.6 GOTO ..................................................................................................... 34 5.5.7 FOR/NEXT.............................................................................................. 34 5.5.
6.3 C Command Reference............................................................................... 111 6.3.1 Manual Commands............................................................................... 111 6.3.1 Fundamental commands ...................................................................... 112 6.3.1 Mathematical Functions........................................................................ 118 6.3.2 String Functions...................................
1 Unit Configuration 1.
1.2 Operational Functions 1 Power Switch Slide up to switch power ON and down to switch power OFF. 2 Shift Key ( S ) Used to enter BASIC commands and symbols noted above the keys of the keyboard. Each press of this key causes the symbol “[S]” to switch on and off on the display. Throughout this manual, this key is represented by Shift in order to distinguish it from the alphabetic S key.
Switches the alphabet keys between upper case and lower case characters. The upper case mode is indicated by the “CAPS” symbol on the display. 14 Cursor Keys ( , , , ) Move the cursor on the screen. Each press moves the cursor in the direction noted on the keys pressed, while holding down the keys causes continuous, high speed movement. Each cursor key also takes on a different function when pressed in combination with the [Shift] key. KEY FUNCTION [Shift] + Moves to beginning of logical line (L.
19 Menu / Sub Menu Key ( MENU / SUB MENU) Used in combination with numeric keys to specify operational modes. MENU 1 …. Serial Port communication mode MENU 2 …. BASIC mode (program writing/editing) MENU 3 …. C mode (program writing/editing) MENU 4 …. CASL mode (program writing/editing) MENU 5 …. ASSEMBLER mode (program writing/editing) MENU 6 …. FX Statistics mode MENU 7 ….
1.3 Symbol Display The symbols noted on the display illustrated below appear to show the current status of a calculation CAPS . S. BASIC . DEG . RAD . GRA .
1.4 Keyboard A look at the keyboard of the unit reveals characters and symbols located above the keys. These are accessed using the CAPS and Shift keys. 1.4.1 Keytop Functions Normal Mode In this mode, each key inputs the characters, symbols, or commands noted on the keys themselves. (this status is automatically set when power is switched ON and immediately following a RESET procedure.
1.4.2 Functions Noted Above the Keys The BASIC one-key commands, and the symbols and commands noted above the keys are entered when the corresponding keys are pressed following the Shift key. Note, however, that pressing the numeric keys ( 0 - 9 ) after Shift in the CAL mode executes the BASIC program in the corresponding program area. EXAMPLE: Operation Shift Z Shift * Display PRINT NPR( 1.5 Screen The screen is a 32-column x 2-line liquid crystal display.
1.5.3 Screen Editor Any program lines or data included on the virtual screen can be edited. First the portion of the program or data is brought onto the actual screen, and then the cursor is located at the position to be edited 1.5.4 Display Contrast CONTRAST The display may appear dark or dim depending upon the strength of the batteries or the viewing angle.
Characters which cannot be displayed using keyboard input can be displayed using the CHR$ function. 1.7 Power Supply This unit is equipped with a main power supply (four AA Alkaline batteries) and a backup power supply (one CR2032 lithium battery). Batteries should be replaced whenever the display remains dim, even after contrast adjustment. Batteries should also be replaced once every two years regardless of how much the unit has been used.
Note: This hardware test will erase all programs and data stored in the unit. Selecting one of the options of the self-test menu will allow following tests 0. Test of the Read Only Memory, computing check sum and XOR check 1. Test of the symbol displays, outside pixels, uneven pixels, even pixels, all pixels together. Go from one test to another with the . . key. 2. Test of each key, starting with MENU and finishing with . .
2 Fundamental Operation This section covers the various modes available with the computer using a series of simple examples. These procedures should be mastered before attempting more complex operations. 2.1 CAL Mode The CAL mode is in effect each time the power of the unit is switched ON. Arithmetic calculations, function calculations, formula storage calculations, program execution can be performed in this mode. EXAMPLE: 2.5+3.5-2= OPERATION: 2 . 5 + 3 . 5 - 2 . . 3.5+3.5–2 4 The touch . .
Now, calculate the selling prices of the following: PURCHASE PRICE PROFIT $1000 30% $960 25% CALC PURCHASE?_ 1000 . . PURCHASE?1000 PROFIT?_ 0 . 3 . . PURCHASE?1000 PROFIT?0.3 SELL= 1428.571429 CALC PURCHASE?_ 960 . . PURCHASE?960 PROFIT?_ . 25 . . PURCHASE?960 PROFIT?.25 SELL= 1280 As can be seen in this example, once a formula is input, it can be used repeatedly by simply assigning values for the variables. See PART 4 FORMULA STORAGE FUNCTION for details.
2.4 C Mode The C mode is used for the creation, execution and editing of C programs. The C mode can be entered from another mode by pressing MENU 3 . EXAMPLE: Create and execute a program that prints HELLO. PROGRAM INPUT MENU 32 < C > F 0 1 2 3 4 5 6 7 8 9 F0>Run/Load/Source You can use the cursor keys to select the program area 0 - 9 Press R (Run) to run the C program Press L (Load) to load the C program for the interpreter Press S (Source) to edit the C source code. 51113B S.
3 Calculation Function This section covers fundamental arithmetic calculations and function calculations, which are performed manually. 3.1 Manual Calculation Preparations Switch the power of the unit ON CAPS . S . BASIC . DEG . RAD . GRA . _ The display illustrated above appears whenever the power is switched ON. It indicates the CAL mode in which manual calculations can be performed. Currently specified angle units, however, is retained even when the power is switched OFF. 3.
EXAMPLE: 33 x 5 + 16 = 181 For the sake of the example, the above calculation will be performed with the value 33 mistakenly entered as 34. 34 * 5 + 16 . . 34*5+16 186 . . (Move cursor to position for correction.) 34*5+16 186 3 33*5+16 186 . . (Re-execute calculation.) 33*5+16 181 Correction of entries can use following keys: The INS key is used to insert spaces at the current cursor location for input of characters or symbols.
EXAMPLE 3: (4.5 x 1075) x (-2.3 x 10-78) = -0.01035 OPERATION: 4.5 IE 75 * - 2.3 IE - 78 . . 4.5E75*-2.3E-78 -0.01035 Exponents are entered by pressing the IE key (or the alphabetic E key) before entering the value. EXAMPLE 4: (23 + 456) x 567 = 271593 OPERATION: 23 + 456 . . * 567 . . 23+456 479*567 271593 The last result obtained can be entered at any point in a subsequent calculation by pressing the ANS key. EXAMPLE 5: 81.3 / (5.6 + 8.9) = 5.6 ↑ This process performed first OPERATION: 5.6 + 8.9 . .
3.1 Scientific Calculations The scientific functions can be used either with BASIC programs or for manual calculations. For the sake of the explanation, all the examples here will cover only manual calculations. 3.1.1 Trigonometric and Inverse Trigonometric Functions SIN (Sine), COS (Cosine), TAN (Tangent), ARCSIN (Arc Sine), ARCCOS (Arc Cosine), ARCTAN (Arc Tangent). These functions return a trigonometric function value for a given angle, or an angle value of a given trigonometric function value.
4 Formula Storage Function The formula Storage function is very useful when performing repeat calculations. Three different keys are used when working with the formula Storage function. IN key……. Stores presently displayed formula. OUT key…… Displays formula stored in memory. CALC key…. Assigns values to variables in formula, and displays formula calculation result. Sample Application EXAMPLE: Obtain the value for each of the value assigned to x when y = 3.43 cosx. (Calculate in three decimal places.
Y= 3.397 X?15 Y=3.313 X?_ 22 . . X?15 Y=3.313 X?22 Y= 3.180 . . Y=3.313 X?22 Y= 3.180 X?_ 27 . . X?22 Y= 3.180 X?27 Y= 3.056 . . Y= 3.180 X?27 Y= 3.056 X?_ 31 . . X?27 Y= 3.056 X?31 Y= 2.940 BRK Y= 3.056 X?31 Y= 2.940 _ The CALC key can be used in place of the . . key to perform repeat calculations. The BRK key can be used to terminate this function to automatically return to the CAL mode. 4.1 Utilization for Preparing Tables Multiple formulas can be written by separating with colons ( : ).
OPERATION: SHIFT SET F 3 . . Specification of number of decimal places P = X * Y : Q = X / Y IN. Storing the formula CALC X?_ 4 . 27 . . X?4.27 Y?_ 1 . 17 . . X?4.27 Y?1.17 P= 4.996 . . X?4.27 Y?1.17 P= 4.996 Q= 3.650 Continue to input the values of X and Y in this manner, and the values of P and Q will be calculated in successive order and the table will be completed as shown below. X 4.27 8.17 6.07 2.71 Y 1.17 6.48 9.47 4.36 P=X*Y 4.996 52.942 57.483 11.816 Q=X/Y 3.650 1.261 0,641 0.
CALC RADIUS[M]?_ 1 . 205 . . RADIUS[M]?1.205 HEIGHT[M]?_ 2 . 227 . . RADIUS[M]?1.205 HEIGHT[M]?2.227 CYLINDER[M3]= 10.16 . . RADIUS[M]?1.205 HEIGHT[M]?2.227 CYLINDER[M3]= 10.16 CONE[M3]= 3.39 . . HEIGHT[M]?2.227 CYLINDER[M3]= 10.16 CONE[M3]= 3.39 RADIUS[M]?_ 2 . 174 . CYLINDER[M3]= 10.16 CONE[M3]= 3.39 RADIUS[M]?2.
5 BASIC Programming Standard BASIC is employed as the programming language for this unit, and this section covers application of the BASIC language. 5.1 Features of BASIC 1. BASIC is much easier to use than other programming languages such as FORTRAN, making it suitable even for novices. 2. Writing programs is also easier because program creation, editing and execution are all performed by interacting with the computer itself. The following functions are also available: 1.
5.2 BASIC Program Configuration 5.2.1 BASIC Program Format The following is a typical BASIC program, which calculates the volume of a cylinder. EXAMPLE: 10 REM CYLINDER 20 R=15 30 INPUT “H=”;H 40 V=PI*R^2*H 50 PRINT “V=”;V 60 END As can be seen, the BASIC program is actually a collection of lines (six lines in the above program). A line can be broken down into a line number and a statement. 20 R=15 Line Statement number Computers execute programs in the order of their line numbers.
5.3 BASIC Program Input 5.3.1 Preparation First, switch the power of the computer ON. At this time, the display should appear as illustrated below. CAPS . _ S . BASIC . DEG . RAD . GRA . This is the CAL mode, so the operation MENU 2 should first be performed to allow input of BASIC programs. The display should now appear as illustrated below. CAPS . S . BASIC . DEG . RAD . GRA .
EXAMPLE: Line 50 input 50 Shift PRINT Shift “ V = Shift “ ; V . . 5.3.3 Program Editing The procedure used for making corrections or changes to a program depends upon what step of program input the changes are to be made. 1. Changes in a line before . . key is pressed 2. Changes in a line after . . key is pressed 3. Changes within a program already input 4. Changes within a program following the EDIT command Changes in a line before . .
Again, the . . key must be pressed to store the corrected line into memory after changes are made. Changes within a program already input The LIST command displays the program stored in the current program area form beginning to end. Shift LIST . . 10 REM CYLINDER 20 R=15 30 INPUT “H=”;H 40 V=PI*R^2*H … 40 V=PI*R^2*H 50 PRINT “V=”;V 60 END Ready P0_ The last line of the program is displayed when the LIST operation is complete. .. .. .. .. .. ..
.. .. (displays line 30 to 60) 30 INPUT “H=”;H 40 V=PI+R^2*H 50 PRINT “V=”;V 60 END Here, a correction will be made in line 40. .. (Displays line 40 to 60, line 40 at the upper line of the display) .. (Enables program editing) 40 V=PI+R^2*H .. .. .. .. .. .. .. .*. . . (Moves cursor and makes correction) 40 V=PI*R^2*H 50 PRINT “V=”;V 60 END BRK ( BRK key exits EDIT mode) Ready P0 5.4 BASIC Program Execution 5.4.
1. Executions that produce errors 2. Irregular execution that do not produce errors (mostly logic errors) Execution that produce errors Simple programming errors. This is the most common type of program error and is generally caused by mistakes in program syntax. Such errors result in the following message being displayed: SN error P0-10 This message indicates that a syntax error has been detected in line 10 of the program stored in program area 0.
of the data read from line 180, followed by the square root and cube root of the sum. Program execution is terminated when the operator enters a zero.
and assigns a value of 5 to N when the original value is greater. When a value of 5 or less is originally assigned to N, execution proceeds to the next line, with N retaining its original value. Line 50 checks whether or not value assigned to N is zero. In the case of zero, program execution jumps to nine 130, while execution proceeds to next line (line 60) when N is any other value besides zero. Note: Line 50 can also be abbreviated as follows: 50 IF N=0 THEN 130 5.5.
Note: GOSUB routines can also be used to branch to other program areas, as in GOSUB #3 (branches to program area 3). Note, however, that a return must be made back to original program area using the RETURN command before an END command is executed. 5.5.10 Labels You have the possibility to assign label names to program lines. This feature allows an easier understanding of the program structure, especially GOTO and GOSUB statements. We will modify the program of chapter 5.
5.6 Operators The following are the operators used for calculations, which involves variables.
Logical Operators The operands of logical operations are truncated to integers and the operation is performed bit-by-bit to obtain the result. X 0 0 1 1 Y 0 1 0 1 X AND Y 0 0 0 1 X OR Y 0 1 1 1 X XOR Y 0 1 1 0 NOT X 1 1 0 0 NOT Y 1 0 1 0 String Operators Strings may be concatenated using a + sign. The result of the operation (including intermediate results) may not exceed 255 characters. EXAMPLE: A$=”AD”+”1990” The above example results in the string “AD1990” being assigned to variable A$.
5.7.2 Variables Numeric Variables The following shows the numeric variables included in the sample program on page 33: PROGRAM 20 R=15 30 INPUT “H=”;H 40 V=PI*R^2*H NUMERIC VARIABLES R H V Numeric variables are so named because their contents are handled as numbers. Numeric variable names can be up to 15 characters long, and are used within programs to store calculation results or constants in memory.
EXAMPLE: Declare array variable A for storage of 9 numeric data items. 10 DIM A (8) Note: a declared value of 8 makes possible to store 9 data items. A(0) A(1) A(2) A(3) A(4) A(5) A(6) A(7) A(8) EXAMPLE: Recall value stored in element 4 of array A Y=A(4) Or X=4:Y=A(X) The value that specifies an element in an array (4 above) is called a subscript. Until now, the only arrays covered have been those formed by a single line of elements or “boxes”. These are known as “one-dimensional” arrays.
5.7.3 Summary Variable types The three following types of variable are available for use with this unit. 1. Numeric variables (up to 12-digit mantissa) A, a, NUMBER, POINTS 2. String variables (up to 255 characters) A$, STRING$ 3. Array variables Numeric array A(10), XX(3,3,3) String array A$(10), ARRAY$(2,2) Variable names Variable names can consist of upper, lower case or numeric characters, but a numeric character cannot be used in the first position of the variable name (i.e. 1AE, 3BC$ are illegal).
5.8 BASIC Command Reference 5.8.1 Format elements The method for entering statements is explained below. • Words in bold type are command or functions, and they must be entered as shown. • Braces indicate that one of the parameters enclosed must be specified. • Commas contained in braces must be written in the position shown. • Brackets indicate that the parameters enclosed may be omitted. Brackets themselves are not entered. • An asterisk indicates that the term preceding it may appear more than once.
5.8.2 Manual Commands A 0 PASS PURPOSE: Specifies or cancels a password FORMAT: PASS “password” String expression EXAMPLE: PASS”TEXT” PARAMETERS: 1. Registering a single password makes it the password for all BASIC program areas (P0-P9) and for C language and Assembler program areas (F0-F9). 2. The password must be a string of 1-8 characters. 3. All characters after the first 8 are ignored when 9 or more characters are entered. EXPLANATION: 1. The password is used to protect programs. 2.
A 0 CLEAR PURPOSE: Clears all variables and determines the memory mapping in accordance with the parameters entered. FORMAT: CLEAR [ [strings area size] [ , assembler area size , variables area size ] ] Numeric expression Numeric expression Numeric expression EXAMPLE: CLEAR CLEAR 400 CLEAR 4096,512,6144 PARAMETERS: 1. Strings area size: Determines the area used for strings. The initial setting when ALL RESET is executed is 4096. The current value can be obtained through FRE 3. 2.
M m 0 SYSTEM PURPOSE: Shows main system status. FORMAT: SYSTEM EXAMPLE: SYSTEM PRINT OFF TRACE OFF CLEAR 4096,512,6144 FREE 83703 V:4096 _ EXPLANATION: Data returned by the SYSTEM statement are: 1. PRINT mode (ON/OFF) 2. TRACE mode (ON/OFF) 3. CLEAR followed by 3 numbers. These are the parameters of the last CLEAR statement entered. - First number is the memory area size in Bytes. This is what returns FRE 3. - Second number is the assembler area size in Bytes.
M 0 LIST [ALL] PURPOSE: Displays all or part of the currently specified program. FORMAT: [start line number] [ - [end line number] ] Line number LIST Line number [.] [ALL] *Label Label name EXAMPLE: LIST LIST 100 LIST 100-300 LIST -400 LIST*Root PARAMETERS: 1. Start line number: integer in the range of 1≤ line number ≤ 65535 (first line number when omitted) 2. End line number: integer in the range of 1≤ line number ≤ 65535 (end line number when omitted) 3. Label: Name of a label in the program.
M 0 EDIT PURPOSE: Enters the BASIC edit mode. FORMAT: [start line number] Line number or period EDIT [.] *Label Label name EXAMPLE: EDIT 100 PARAMETERS: 1. Start line number: integer in the range of 1 ≤ line number ≤ 65535 (first line number when omitted) 2. Label: Name of a label in the program. EXPLANATION: 1. Enters the BASIC edit mode and displays the program at the specified line number, or at the specified label. The cursor is displayed and editing becomes possible with either the .. or ..
M 0 RUN PURPOSE: Executes a program. FORMAT: [start line number] Line number or period RUN *Label Label name EXAMPLE: RUN RUN 100 RUN*Root PARAMETERS: 1. Start line number: Interger in the rage of 1 ≤ line number ≤ 65535 2. Label: Name of a label in the program.. Entering an unknown label will generate an “UL error”. EXPLANATION: 1. Execution starts from the beginning of the program when the line number or label name is omitted. 2.
5.8.3 Fundamental Commands P 0 END PURPOSE: Terminates program execution. EXPLANATION: 1. Terminates program execution, and the computer stands for command input 2. Closes all files that are open 3. Variables and arrays are not cleared. 4. Any number of END statements can be used in a single program. Program execution is terminated and open files are closed automatically at the end of a program even if an END statement is not included. P 0 STOP PURPOSE: Temporarily halts program execution.
P 0 GOTO PURPOSE: Branches unconditionally to a specified branch destination. FORMAT: branch destination line number Line number GOTO # program area number Single character; 0-9 *Label Label name EXAMPLE: GOTO 1000 GOTO #7 GOTO *Finish PARAMETERS: 1. Branch destination line number: integer in the range of 1≤ line number ≤65535 2. Program area number: single character, 0-9 3. Label: Name of a label in the program. EXPLANATION: 1.
P 0 GOSUB PURPOSE: Jumps to a specified subroutine. FORMAT: branch destination line number Line number GOSUB # program area number Single character; 0-9 *Label Label name EXAMPLE: GOSUB 100 GOSUB #6 GOSUB *Root PARAMETERS: 1. Branch destination line number: integer in the range of 1≤ line number ≤65535 2. Program area number: single character, 0-9 3. Label: Name of a label in the program. EXPLANATION: 1. Program execution branches to the subroutine that starts at the specified line number or label.
P 0 ON GOTO PURPOSE: Jumps to a specified branch destination in accordance with a specified branching condition. FORMAT: branch destination line number Line number ON Condition GOTO [ # program area number Numeric expression ] Single character; 0-9 *Label Label name branch destination line number Line number [,[ # program area number ] ]* Single character; 0-9 *Label Label name EXAMPLE: ON A GOTO 100, 200, 300 PARAMETERS: 1. Branch condition: Numeric expression truncated to an integer 2.
P 0 ON GOSUB PURPOSE: Jumps to a specified subroutine in accordance with a specified branching condition. FORMAT: branch destination line number Line number ON Condition GOSUB [ # program area number Numeric expression ] Single character; 0-9 *Label Label name branch destination line number Line number [,[ # program area number ] ]* Single character; 0-9 *Label Label name EXAMPLE: ON A GOSUB 1000, 1100, 1200 PARAMETERS: 1. Branch condition: Numeric expression truncated to an integer 2.
P 0 IF-THEN-ELSE / IF-GOTO-ELSE PURPOSE: Executes the THEN statement or GOTO statement when the specified condition is met. The ELSE statement is executed when the specified condition is not met.
P 0 FOR-NEXT PURPOSE: Executes the program lines between the FOR statement and NEXT statement and increments the control variable, starting with the initial value. Execution is terminated when value of the control variable exceeds the specified final value.
7. The control variable retains the value that exceeds the final value (and terminates the loop) when loop execution is complete. With the loop FOR I=3 to 10 STEP 3 for example, the value of control variable I is 12 when execution of the loop is complete. 8. Jumping out of a FOR – NEXT loop is also possible. In that case, the current control variable value is retained in memory, and the loop can be resumed by returning with a GOTO statement.
P 0 DATA PURPOSE: Holds data for Reading by the READ statement. FORMAT: DATA [ data ] [ , [ data ] ] * Constant Constant EXAMPLE: DATA 10,5,8,3 DATA CAT,DOG,LION PARAMETERS: 1. Data: String constants or numeric constants 2. String constants: Quotation marks are not required unless the string contains a comma that is part of the data. A null data string (length 0) is assumed when data is omitted from this statement.
5.8.4 Mathematical Functions F 0 ABS PURPOSE: Returns the absolute value of the argument. FORMAT: ABS (argument) Numeric expression The parenthesis enclosing the argument can be omitted when the argument is a numeric value or variable. EXAMPLE: ABS (-1.1) PARAMETERS: argument : numeric expression SEE: SGN F 0 ACS PURPOSE: Returns the angle value for which cosine (angle value) = argument.
F 0 ASN PURPOSE: Returns the angle value for which sine (angle value) = argument. FORMAT: ASN (argument) Numeric expression The parenthesis enclosing the argument can be omitted when the argument is a numeric value or variable. EXAMPLE: ASN (0.1) PARAMETERS: argument must be within the [-1 , +1] range EXPLANATION: 1. The unit of the returned value is specified using the ANGLE function. 2. The returned value is in the [0 , 180°] or [0 , π Radians ] range.
F 0 CUR PURPOSE: Returns the cubic root of the argument. FORMAT: CUR (argument) Numeric expression The parenthesis enclosing the argument can be omitted when the argument is a numeric value or variable. EXAMPLE: Y = CUR (X) PARAMETERS: argument: numeric expression. SEE: SQR F 0 EXP PURPOSE: Returns the value of e(argument). FORMAT: EXP (argument) Numeric expression The parenthesis enclosing the argument can be omitted when the argument is a numeric value or variable.
F 0 FIX PURPOSE: Returns the integer part of the argument. FORMAT: FIX (argument) Numeric expression The parenthesis enclosing the argument can be omitted when the argument is a numeric value or variable. EXAMPLE: FIX (-1.5) PARAMETERS: argument : numeric expression SEE: INT, FRAC F 0 FRAC PURPOSE: Returns the fractional part of the argument. FORMAT: FRAC (argument) Numeric expression The parenthesis enclosing the argument can be omitted when the argument is a numeric value or variable.
F 0 HYPASN PURPOSE: Returns the value for which hyperbolic sine (value) = parameter. FORMAT: HYPASN (argument) Numeric expression The parenthesis enclosing the argument can be omitted when the argument is a numeric value or variable. EXAMPLE: HYPASN (-150) PARAMETERS: argument must be within the ]-5x1099 , 5x1099[ range EXPLANATION: 1. The mathematical formula for reverse hyperbolic sine is : 2 asinh(x) = ln ( x + √ x + 1 ) where ln is the natural logarithm . 2. The returned value is in the [-230.
F 0 HYPSIN PURPOSE: Returns the value of the hyperbolic sine of the argument. FORMAT: HYPSIN (argument) Numeric expression The parenthesis enclosing the argument can be omitted when the argument is a numeric value or variable. EXAMPLE: HYPSIN (1.5) PARAMETERS: argument must be within the [-230.2585092 , +230.2585092] range. EXPLANATION: 1. The mathematical formula for hyperbolic sine is : sinh(x) = (ex - e-x) / 2 where e is 2.7182818284590452353602874713526... 2.
F 0 LOG PURPOSE: Returns the common logarithm of the argument. FORMAT: LOG (argument) Numeric expression The parenthesis enclosing the argument can be omitted when the argument is a numeric value or variable. EXAMPLE: LOG (7922) PARAMETERS: argument must be within the ]10-100 , 10100[ range. EXPLANATION: 1. The returned value is in the ]-100 , +100[ range.
F 0 NPR PURPOSE: Returns the permutation nPr for the values of n and r. FORMAT: NPR ( n value , r value ) Numeric expression Numeric expression EXAMPLE: X = NPR(69,20) PARAMETERS: n value and r value should follow: 0 ≤ r ≤ n < 1010 EXPLANATION: 1. Returns the permutation: nPr = n! / (n-r)! 2. A fractional value as either n or r generates an error. SEE: FACT, NCR F 0 PI PURPOSE: Returns the value of π. FORMAT: PI EXPLANATION: 1. Returns the value of π. 2.
F 0 RAN# PURPOSE: Returns a random value in the range of 0 to 1. FORMAT: RAN# (argument) Numeric expression The parenthesis enclosing the argument can be omitted when the argument is a numeric value or variable. EXAMPLE: RAN# * 10 PARAMETERS: argument : numeric expression EXPLANATION: 1. Returns a random value in the ]-1, 1[ range. 2. Random numbers are generated from the same table when X=1. 3. The last random number generated is repeated when X=0. 4.
F 0 ROUND PURPOSE: Rounds the argument at the specified digit. FORMAT: ROUND ( argument , digit ) Numeric expression Numeric expression The parenthesis enclosing the argument can be omitted when the argument is a numeric value or variable. EXAMPLE: ROUND (A, -3) PARAMETERS: 1. argument : numeric expression 2. digit: numeric expression truncated to an integer in the ]-100, 100[ range. EXPLANATION: Rounds the argument (to the nearest whole number) at the specified digit.
F 0 SQR PURPOSE: Returns the square root of the argument. FORMAT: SQR (argument) Numeric expression The parenthesis enclosing the argument can be omitted when the argument is a numeric value or variable. EXAMPLE: SQR (4) PARAMETERS: argument must be positive. SEE: CUR F 0 TAN PURPOSE: Returns the value of the tangent of the argument. FORMAT: TAN (argument) Numeric expression The parenthesis enclosing the argument can be omitted when the argument is a numeric value or variable.
5.8.5 String Functions F 0 ASC PURPOSE: Returns the character code corresponding to the character in the first (leftmost) position of a string. FORMAT: ASC (string) String expression EXAMPLE: ASC (“A”) PARAMETERS: String : string expression EXPLANATION: 1. Returns the character code corresponding to a character. The character code for the first (leftmost) character only is returned for a string of two or more characters long. 2. A value of 0 is returned for a null string.
A 0 &H PURPOSE: Converts the 1 through 4-digit hexadecimal value following &H to a decimal value. FORMAT: &H argument Hexadecimal value EXAMPLE: A = &HAF PARAMETERS: Hexadecimal value in the [0, FFFF] range. EXPLANATION: 1. The hexadecimal value is expressed using values 0 to 9, plus characters A to F. 2. In the manual mode, &H is entered followed by the hexadecimal value. Pressing . . produces the decimal equivalent. Example: Shift &H 1 B 7 F . . → 7039 3.
F 0 LEFT$ PURPOSE: Returns a substring of a specified length counting from the left of a string. FORMAT: LEFT$ ( string , number of characters ) String expression Numeric expression EXAMPLE: LEFT$ (“ABCDEF”, 3) PARAMETERS: 1. String: string expression 2. Number of characters: numeric expression truncated to an integer in the [0 , 256[ range. EXPLANATION: 1. Returns the substring of a specified length from the left of a string. 2.
F 0 MID$ PURPOSE: Returns a substring of a specified length from a specified position within a string. FORMAT: MID$ ( string , position [ , number of characters ] ) String expression Numeric expression Numeric expression EXAMPLE: MID$ (A$, 5, 3) PARAMETERS: 1. String: string expression 2. Position: numeric expression truncated to an integer in the [0 , 256[ range. 3. Number of characters: numeric expression truncated to an integer in the [0 , 256[ range.
F 0 STR$ PURPOSE: Converts the argument (numeric value or numeric expression value) to a string. FORMAT: STR$ (argument) Numeric expression EXAMPLE: STR$ (123), STR$ (255+3) PARAMETERS: Argument: numeric expression EXPLANATION: 1. Converts decimal values specified in the argument to strings. 2. Converted positive values include a leading space and converted negative values are preceded by a minus sign SEE: VAL F 0 VAL PURPOSE: Converts a numeric character string to a numeric value.
5.8.6 Graphical Functions F 0 DRAW PURPOSE: Draws a line segment between two graphic coordinates. FORMAT: DRAW [ ( x1 , y1 ) ] - ( x2 Numeric expression Numeric expression Numeric expression , y2 ) Numeric expression EXAMPLE: DRAW (0,0)-(50,50) DRAW-(100,50) PARAMETERS: 1. (x1, y1) are the coordinates of the first graphic coordinate. When omitted, the computer will use the last graphic coordinate used in the program. 2. (x2, y2) are the coordinates of the second graphic coordinate. 3.
F 0 POINT PURPOSE: Returns the status of a pixel FORMAT: POINT (x ,y) Numeric expression Numeric expression EXAMPLE: POINT(50,50) PARAMETERS: (x, y) is a graphic coordinate. 1. x should be in the [0 , 191] range. 2. y should be in the [0 , 63] range. EXPLANATION: Value returned is 1 if the pixel is active (black), 0 if the pixel is inactive.
5.
6 C Programming 6.1 The Basics of C 6.1.1 C and the other programming languages Early history of C C is a programming language that incorporates such concepts as module programming and structural syntax along the lines of ALGOL. Another well-known offshoot of ALGOL is PASCAL, and forebears of C are the CPL and BCPL languages. Both CPL and ECPL were early innovations by Britain's Cambridge University in an attempt to make ALGOL 60 easier to use.
6. Pointer control Unlike the memory addresses used in FORTRAN, COBOL and BASIC, C employs a pointer to indicate memory locations. 7. Efficient use of memory Memory and data management functions, as well as programs are very compact, for more efficient memory utilization. Thanks to this, C gives you the high level programming capabilities of FORTRAN and Pascal, with all of the detailed processing of machine language. 6.1.
The few differences between the Casio interpreted C language and an ANSI standard compiled C will be highlighted in this manual 6.2 C Program Input 6.2.1 About the C Interpreter and Editor The unit provides you with both a C interpreter and editor. The interpreter is used to execute programs. The editor is used for program creation and editing. Before getting into the actual operations of the unit, perhaps it might be a good idea to first look at these two functions in a little more detail.
3. Pressing the key 3 will lead to the C sub-menu allowing writing, compiling, running and editing programs in C language. .3. < C > F 0 1 2 3 4 5 6 7 8 9 F1>Run/Load/Source You can use the cursor keys to select the program area 0 - 9 The S key allows to start writing the source code with the editor. .S. . 51113B Note that the C language is case sensitive. Key words have to be written in lower case characters only. Make sure the CAPS symbol is switched OFF before entering a keyword. .
To create a new program from the MENU mode 1. Press the MENU key to enter in the main menu. MENU < MENU > 1:F.COM 2:BASIC 3:C 5:ASMBL 6:FX 7:MODE 2. Press the key 3 to enter in the C mode .3. < C > 4:CASL F 0 1 2 3 4 5 6 7 8 9 51113B F1>Run/Load/Source Use the cursor keys to select an empty program area among areas 0 - 9 Enter the editor typing the S key. .S. . You can start writing the new program.
Editing a C program Once in the editor, there are two modes for editing: the INSERT mode and the OVERWRITE mode. Switch between these two modes by pressing the INS key. The INSERT mode is automatically specified when you enter the editor. The insert mode is indicated by a cursor thet looks like “_”. While the computer is in the INSERT mode, any characters that you enter from the keyboard are inserted between any characters already on the display. You can specify the OVERWRITE mode by pressing the INS key.
}↵ < Note that the line number displayed at the lower right is the one requested. Now, let’s execute our program. 3> 6.1 C Program Execution 6.1.1 To execute a program You can exit the editor by pressing the SUB MENU key, which will go back to the C mode menu. Shift SUB MENU < C > F 0 * 2 3 4 5 6 7 8 9 51113B F1>Run/Load/Source Note that the program area 1 you just used for the short program is now shown as occupied with a “*”. You need to load the program into the interpreter, using the L key. L.
To illustrate operation of the TRACE mode, we will add a sub() procedure at the top of our HELLO program, and call it in the main(). Here is how the modified program will look like: sub(){ printf(“WORLD¥n”); } main(){ printf(“HELLO¥n”); sub(); } Loading and running this program will generate following output: HELLO WORLD >_ With the TRACE function, it is possible to follow step by step the execution: .T R O N . . >tron >_ .R U N . .
To interrupt execution of the TRACE mode Lets run again the program in TRACE mode: .R U N . . >run (F1-5) printf(“HELLO¥n”); Break?_ 1. You can press T or . . to execute the line and carry on the TRACE mode. 2. You can press BRK to exit the program, but stay in TRACE mode. This is useful if you want to re-run the program because you missed something. To exit the TRACE mode There are four different methods that you can use to exit the TRACE mode. 1. Enter the TROFF command and press . ..
Enter the following program: .M A I N ( ) Shift { . . SPC .P R I N T F ( “ .Y. .O. .U. Shift .?. Shift ¥ N SPC .P R I N T F ( “ SPC .Y. .O. .U. Shift ¥ N ” Shift } . . CAPS H CAPS O W SPC A R E SPC ” .). .;. . . CAPS F CAPS I N E , T H A N. .K. .). .;. . .
Making your program easy to read You have probably noticed by now that we have been writing and editing our C programs in a certain format. The previous program was written and entered as: main(){ printf(“How are you?¥n”); printf(“Fine,thank you¥n”); } We could have just as easily written and input it as: main(){ printf(“How are you?¥nFine,thank you¥n”); } Or even: main(){printf(“How are you?¥nFine,thank you¥n”);} The computer would execute the program identically in either case.
Note that there is a direct relationship with • the 1st % construction and the 2nd argument • the 2nd % construction and the 3rd argument • the 3rd % construction and the 4th argument. printf(“D=%d H=%x F=%f¥n”65,65,65.0); You just have to be careful to ensure that the proper % construction is matched with the proper value, or else you will get strange results. Here is a list of some other % constructions in addition to those noted above.
The following results would be displayed: .R U N . . >run D=65 O=101 H=41 C=A >_ 6.2.2 Variable types and operations Declaring variable types With C programs, you have to declare the type of data that will be assigned to each variable before you can use the variable. The following statement, for example, tells the computer that the variable “x” will be used for the storage of integers: int x; The following table shows the other declarations that can be made for variables.
} The first four operations are addition, subtraction, multiplication and division. The value for “e” will be the modulus (remainder) of 49 divided by 12. When you execute the program, the display should appear as follows: .R U N . . >run 61 37 588 4 1 >_ The following statement in the first line of the program declares that all five variables will be for the storage of 16-bit integers.
6.2.3 Entering characters and values Entering a single character from the keyboard Here we will create a program that outputs a character and its corresponding character code in hexadecimal format. If you press the key for the letter “B”, for example, the format will be: Char=B Hex=0x42 The standard function getchar() is used to tell the computer to get one character input from the keyboard.
Entering Values Now, let’s try a program that calculates the sine and cosine of values that you enter from the keyboard. Since we can be expecting decimal values for input and output, we will be defining the variable as floating-point. The program to accomplish this task would appear as follows: /* Compute sine & cosine */ /* #include */ /* #include
6.2.4 Using selection statements Using the “if” selection statement You can use the “if” statement to tell the computer to shift the flow of control if certain conditions are met. The “if” statement has two basic formats. 1. if (condition) statement. Here, the statement is executed if the condition is met (true = any value other than 0), and not executed if the condition is not met (false = 0). 2.
/* Quadratic equation */ /* #include */ /* #include */ main(){ double a,b,c,D,q,r; scanf(“%lf %lf %lf“,&a,&b,&c); D=b*b-4.0*a*c; if (d>=0){ q=(-b+sqrt(D))/a/2.0; r=(-b-sqrt(D))/a/2.0; printf(“%If, %If¥n“,q,r); } else{ r=sqrt(-D)/a/2.0; q=-b/a/2.0; printf(“%lf+%lfi “,q,r); printf(“%lf-%lfi¥n“,q,r); } } The variables “a”, “b” and “c” correspond to the “a”, “b”, and “c” in the quadratic equation, while the “D” variable is the “D” of the discriminant.
6.2.5 Using loops Using the “while” loop The “while” loop makes it possible to repeat execution of statements until a specific condition is met. The format of the “while” loop is as follows: while (condition) Statement The “while” loop first executes the condition. If the condition is met (true, returning a value other than 0), the statement is executed, and execution loops back to the “while” loop to evaluate the condition again.
Using the #define statement Lines 3 and line 4 of the program contain the #define statement. The #define statement defines a name for a particular string of characters. In the above program, “#define STR ‘0’ “ tells the computer that anytime it comes across the name “STR”, it should replace it with the character “0”. Likewise, “#define END ‘Z’ “ tells the computer that the name “END” is to be replaced by the character ‘Z’.
Using the “do – while” loop The “do – while” loop is another method that you can use for repeat execution. The format of the “do – while” loop is as follows: do Statement while (condition); Unlike the “while” loop, the “do – while” loop executes the statement first and then checks whether or not the condition has been met or not. Note also the semicolon at the end of the “while” line cannot be omitted. Let’s use the “do – while” to find the Greatest Common Measure for two values.
Note the following: for (i=0; i<10; i++) printf(…) This tells the computer to execute the printf() statement starting from a count of 0 which is incremented by 1 which each pass of the loop, until the count reaches 10. As with the “if” and “while” loops, multiple statements within a “for” loop are enclosed in braces. Let’s write a program that squares all of the integer from 1 to 100. /* 100 squares */ /* #include
Nested loops The term nested loop means simply “loops inside of loops”. To better understand how nested loops work, let’s have a look at a very short, simple representative program. /* nested loops example */ /* #include */ main(){ float a[3][3]; int i,j; for (i=0; i<3; i++) for (j=0; j<3; j++) scanf(“%f”,&a[i][j]); } The program uses a pair of “for” loops to read values from the keyboard and assign them to a 3x3 2-dimensional array a[3][3].
We have now the value assignment nested loop we saw before, followed by a similar set of loops to read and display the values after they are stored. The only new item is the “%8.2f” which specifies that each value will be displayed in an area of at least 8 characters, with two decimal places (right flush). .R U N . . 1 . . 2 . . 3 . . 4 . . 5 . . 6 . . 7 . . 8 . . 9 . . 1.00 2.00 3.00 4.00 5.00 6.00 7.00 8.00 9.00 >_ 6.2.
Arguments Arguments are used to pass values to the function when it is called. If no values are passed, the arguments can be omitted. If the arguments are omitted, the following argument type declaration is also omitted. Argument type declaration Declares the types of the arguments specified above. Note that ANSI C allows declaring arguments directly inside the parenthesis. The C interpreter does not allow such a declaration.
/* 100 squares 3 */ /* #include */ double dsquare(x) /* square */ double x; { return (x*x); } main(){ double d; for (d=1.0; d<=100.0; d+=1.0) printf(“(%lf)^2=%f¥n”,i,dsquare(d)); getchar(); /* waits ret key */ } Variables are now declared as double precision floating-point. Variables declaration has to happen before using them in a statement. Note that we have to start the program with the function, in order to allow calling it further down.
6.1 Constants and Variables 6.1.1 Local variables and global variables Local variables A local variable is one that is declared within a function for use within that particular function only. Since such variables are local, you can use the same variable name in multiple functions without any problem – each variable is treated independently, even though they have the same name. Have a look at the program listed below. /* Local variable */ /* #include
Here, variable “i” is declared outside of any function, so “i” will be treated as a global variable. Consequently, it will retain its current value regardless of whether execution is in main() or pr(). In this program, variable “i” is assigned a value by the “for” loop in main(), and then the value of “i” is printed by function pr(). Note that any function has access to “i”, not only to read it but as well to modify it.
Finally, the printf() statement displays the value of “xy” which is the result, no matter which arithmetic operation is performed. 6.1.3 Data types and lengths The following table shows the data types and their respective lengths for the interpreter. These are almost identical on all computers, except for the integer (int) that may change.
Code ¥a ¥n ¥t ¥b ¥r ¥f ¥¥ ¥’ ¥” ¥0 ¥nnn ¥xmm Hex Code 0x07 0x0A 0x09 0x08 0x0D 0x0C 0x5C 0x27 0x22 0x00 0xmm Name Bell (BEL) New Line (NL) Horizontal tab (HT) Backspace (BS) Carriage return (CR) Form feed Yen symbol Single quote Double quote Null Octal notation Hexadecimal notation Meaning Sound buzzer Carriage return + Line feed Horizontal tab Backspace (one character) Returns to line start Change page Character ” ¥ ” Character “ ‘ “ Character “ “ “ Equivalent to zero Character code for octal value nnn.
Floating-point constants and double precision floating-point constants Decimal values can be defined as float type or double type constants using the format shown below. Exponents are indicated by the letter “E” or “e”. Example: 3.1416 -1.4141 1.0e-4 1.23456E5 The following shows the ranges of float and double. float double 0, ±1e-63 0, ±1e-99 - ±9.99999e+63 ±9.999999999e+99 String constants String constants are contained in double quotation marks.
Note: The interpreter does not allow declaring a local “auto” variable within the code of a function. func(a) double a; { int i,j,x; float fx,fy; long lx,ly; for(i=0;i<5;i++){ … } } func(a) double a; { int i,j,x; long lx,ly; for(i=0;i<5;i++){ float fx,fy; … } } Program A: OK Program B: Error func(a) double a; { int i,j; float fx,fy; long lx,ly; for(i=0;i<5;i++){ … int x; } } Program C: Error 6.1.
You can also use a pointer within a character string to isolate single characters from the string. /* Pointer example */ /* #include */ main(){ char *p; p=”Casio”; printf(“%c %s¥n”,*p,p); } Execution of this program will produce the following result: C Casio >_ This is because a string is actually a pointer to the first character, the “null” character (0) being added after the last character to close the string. Now, lets assume we want to access the third letter of the string “Casio”.
The following table shows all of the operators used by C and their functions, explained in their order of precedence. Primary Operators ( ), func( ) Parenthetical, function argument operations. x[ ], y[ ][ ] Specify array elements. Unary Operators *px Specifies content indicated by a pointer. &x Address of variable x. -x Negative value x. ++x, --x +1 / -1 before using variable x. x++, x-+1 / -1 after using variable x. ~x NOT performed on each bit (inversion).
The following table shows the precedence of associativity of the C operators.
6.3 C Command Reference 6.3.1 Manual Commands RUN PURPOSE: Execution of a C program. EXAMPLE: RUN run RUN>”PRN:” PARAMETERS: You can specify the output console being the printer instead of the screen. EXPLANATION: Execution starts at the beginning of the main() function of the program currently loaded. EDIT PURPOSE: Writing or editing a C program. EXAMPLE: EDIT edit EXPLANATION: Enters the editor and opens the program area F 0-9 currently selected.
6.3.1 Fundamental commands abort() PURPOSE: Program termination. FORMAT: void abort(); EXPLANATION: 1. Calling abort() function will cause the program to terminate immediately, indicating an unsuccessful termination. 2. The following may occur: file buffers are not flushed, streams are not closed, and temporary files are not deleted. 3. In ANSI C, abort() function is part of library stdlib. exit() PURPOSE: Program termination. FORMAT: void exit(); EXPLANATION: 1.
if() else PURPOSE: Executes one statement when the specified condition is true (not zero). A second optional statement following the “else” is executed when the specified condition is false (0). FORMAT: if (condition) statement 1 else statement 2 PARAMETERS: Condition can be any variable or expression that will be considered true if not 0. EXPLANATION: 1. The most simple conditional structure is: if (condition) statement. statement is executed only if condition is true (not 0) 2.
while() PURPOSE: Executes repeatedly a statement as long as the specified condition is true (not zero). . FORMAT: while (condition) statement PARAMETERS: Condition can be any variable or expression that will be considered true if not 0. EXPLANATION: 1. The “while” loop first executes the condition. If the condition is met (true, returning a value other than 0), the statement is executed, and execution loops back to the “while” loop to evaluate the condition again. 2.
for() PURPOSE: Executes repeatedly a statement as long as the specified condition is true (not zero). FORMAT: for (expression 1; condition; expression 2) statement PARAMETERS: 1. expression 1 sets initial state. 2. condition allows the loop to repeat. 3. expression 2 is executed after the statement. EXPLANATION: 1. First, expression 1 is executed on first pass only (initialization). 2. Then, condition is evaluated. If true (not 0), the statement is executed. If false, loop ends. 3.
switch() case default PURPOSE: executes various statements depending on the value of the parameter. FORMAT: switch (expression) { [case constant i: statement i ]; default: statement; }; PARAMETERS: 1. expression must be an integer type (char, int, long, signed or unsigned). 2. constant i (there is no limit to the number of “case: constant i” statements) is a constant from the same type as expression. EXPLANATION: 1. expression is evaluated, and compared to each constant. 2.
goto PURPOSE: Branches unconditionally to a specified destination label. FORMAT: goto label; PARAMETERS: label is the name of a label defined within the same function. EXPLANATION: 1. the goto statement and label concept are similar to the ones used in BASIC. 2. a label is defined writing an identifier followed by a colon. 3. it is possible and recommended to avoid using the goto statement in a C program.
6.3.1 Mathematical Functions The math functions are part of a standard library in ANSI C, and it is recommended to add the following comment at the beginning of your program: /* #include */ abs() PURPOSE: Returns the absolute value of an integer. FORMAT: int abs(n) int n; angle() PURPOSE: Specifies the unit of angular measurement. FORMAT: void angle(n) unsigned int n; PARAMETERS: n = 0: unit = Degrees. n = 1: unit = Radians.
asinh() PURPOSE: Returns the value for which hyperbolic sine (value) = parameter. FORMAT: double asinh(x) double x; PARAMETERS: x must be within the ]-5x1099, 5x1099[ range EXPLANATION: 1. The mathematical formula for reverse hyperbolic sine is: 2 asinh(x) = ln ( x + √ x + 1 ) where ln is the natural logarithm. 2. The returned value is in the [-230.2585092, +230.2585092] range. SEE: sinh(), log() atan() PURPOSE: Returns the angle value for which tangent (angle value) = parameter.
cosh() PURPOSE: Returns the value of hyperbolic cosine (parameter). FORMAT: double cosh(x) double x; PARAMETERS: x must be within the [-230.2585092, +230.2585092] range. EXPLANATION: 1. The mathematical formula for hyperbolic cosine is: cosh(x) = (ex + e-x) / 2 where e is 2.7182818284590452353602874713526... 2. The returned value is in the [-1, 5x1099[ range. SEE: acosh(), log() exp() PURPOSE: Returns the value of e(parameter). FORMAT: double exp(x) double x; PARAMETERS: x must be within the [-230.
pow() PURPOSE: Returns x to the power of y. FORMAT: double pow(x, y) double x,y; PARAMETERS: 1. x is a double precision floating-point number. 2. y is the power. EXPLANATION: 1. pow(x,y) is essentially computed using the method xy = exp(y * log(x)). This means that any negative x may generate a mathematical error, despite the fact that xy is mathematically valid. Example: (-8)1/3 generates an error. SEE: log(), log10() sin() PURPOSE: Returns the value of sine (parameter).
tan() PURPOSE: Returns the value of tangent (parameter). FORMAT: double tan(x) double x; PARAMETERS: x must be within the ]-1440°, +1440°[ or [-8π , 8π Radians ] range. EXPLANATION: 1. The unit of the parameter x is specified using the angle() function. 2. x must be different from 90° or 270° (π/2 or 3π/2 Radians). 3. The returned value is in the ]-1x10100, 10100[ range. SEE: angle(), atan() tanh() PURPOSE: Returns the value of hyperbolic tangent (parameter).
6.3.2 String Functions The string functions are part of a standard library in ANSI C, and it is recommended to add the following comment at the beginning of your program: /* #include */ strcat() PURPOSE: Appends a source string after the destination string. FORMAT: char *strcat(dest, source) char *dest, *source; PARAMETERS: 1. Destination string. 2. Source string. EXPLANATION: 1. The source string stays untouched. 2.
strcpy() PURPOSE: Copies the source string into the destination string. FORMAT: char *strcpy(dest, source) char *dest, *source; PARAMETERS: 1. Destination string. 2. Source string. EXPLANATION: 1. The source string stays untouched. 2. The content of the source string is copied to the memory pointed by the destination string parameter. Note that no control is made on the memory available for the destination string.
6.3.3 Graphical Functions clrscr() PURPOSE: Clears display and moves cursor to upper left of screen FORMAT: void clrscr() ; getpixel() PURPOSE: Returns the status of a pixel FORMAT: int getpixel(x, y) unsigned int x, y; PARAMETERS: (x, y) is a graphic coordinate. 1. x should be in the [0, 191] range. 2. y should be in the [0, 63] range. EXPLANATION: Value returned is 1 if the pixel is active (black), 0 if the pixel is inactive. line() PURPOSE: Draws a line segment between two graphic coordinates.
6.