Constructing an Identity Matrix

Description

GSB 4

Matrix A is dimensioned as a 4x4 matrix.

The program zeros all elements except the diagonal which is set to 1.

This is a 4x4 identity matrix.
The end sequence 1000,0100,0010,0001 are the elements read out from register (i) which in this case points to A.

When running matrix programs don't set USER mode.
The program will set this if needed.

Program Resources

Labels

Name Description
 4 GSB 4 to run program
 9 Test loop

Storage Registers

Name Description
 0 Test
 1 Test
I Register pointing to A in this program

Flags

Number Description
8 CF8 clear complex mode

Program

Line Display Key Sequence Line Display Key Sequence Line Display Key Sequence
000 018 u 44 24 USER STO (i) 036 u 45 24 USER RCL (i)
001 42,21, 4 f LBL 4 019 22 9 GTO 9 037 42 31 f PSE
002 43, 5, 8 g CF 8 020 u 45 24 USER RCL (i) 038 u 45 24 USER RCL (i)
003 42,16, 0 f MATRIX 0 021 42 31 f PSE 039 42 31 f PSE
004 4 4 022 u 45 24 USER RCL (i) 040 u 45 24 USER RCL (i)
005 36 ENTER 023 42 31 f PSE 041 42 31 f PSE
006 4 4 024 u 45 24 USER RCL (i) 042 u 45 24 USER RCL (i)
007 42,23,11 f DIM A 025 42 31 f PSE 043 42 31 f PSE
008 45,16,11 RCL MATRIX A 026 u 45 24 USER RCL (i) 044 u 45 24 USER RCL (i)
009 44 25 STO I 027 42 31 f PSE 045 42 31 f PSE
010 42,16, 1 f MATRIX 1 028 u 45 24 USER RCL (i) 046 u 45 24 USER RCL (i)
011 42,21, 9 f LBL 9 029 42 31 f PSE 047 42 31 f PSE
012 45 0 RCL 0 030 u 45 24 USER RCL (i) 048 u 45 24 USER RCL (i)
013 45 1 RCL 1 031 42 31 f PSE 049 42 31 f PSE
014 43,30, 6 g TEST x≠y 032 u 45 24 USER RCL (i) 050 u 45 24 USER RCL (i)
015 43 35 g CLx 033 42 31 f PSE 051 31 R/S
016 43,30, 5 g TEST x=y 034 u 45 24 USER RCL (i) 052 43 32 g RTN
017 26 EEX 035 42 31 f PSE