That code would almost certainly crash a calc. Which calculator are you using? Do you want to create a matrix variable or just create a 2D byte array for use in the program?
Z80 Assembly>English>TI-BASIC>Python>French>C>0
The following should work:
DB04E608C8
210F27444D29292C09229B9D
21DB03299FE62DAD6F22B09D09
3E18CB2417EF044518D8
It incorporates its own pseudo-random number generator and quits when ON is pressed.
EDIT: Here is a basic description of what each part of the code does:
DB04 ;Read data from port 4, which has a bit that turns off when ON is pressed
E608 ;Mask out all but the third bit. If it is off, then the result will set the Z flag
C8 ;RETurn if the z flag is set. Exits the routine.
210F27 ;9999 -> HL "0F27" is seed1
444D ;H->B, L->C
2929 ;HL*2*2 -> HL
2C ;HL+1->HL
09 ;HL+BC->HL
229B9D ;HL -> (seed1)
21DB03 ;987 -> HL the DB03 is seed2
29 ;HL*2 -> HL
9F ;A-A-[overflow] -> A (basically sets A=-1=0xFF if the previous code overflowed, else A=0=0x00)
E62D ;A & 0x2D -> bitwise mask of A. 0x2D represents a special set of bits in a Galois LFSR.
AD ;A xor L -> A bitwise exclusive-or
6F ;A -> L
22B09D ;HL -> (seed2)
09 ;HL+BC -> HL
3E18 ;0x18 -> A
CB24 ;H*2->H
17 ;A*2+[overflow] -> A Doubles A and adds in the carry. This makes A=0x30 or A=0x31, the ASCII codes for "0" and "1"
EF0445 ;bcall(_PutC) ;display the ASCII char in A
18D8 ;jump to the start of the code (0xD8 = -40, so it jumps back 40 bytes)
A,H,L,D,E,B,C are similar to variables in TI-BASIC. H and L, D and E, B and C can be sort of combined to make a "variable" of double size. For example, suppose BASIC vars could only be 2-digits, like X=11, Y=23. 'HL' in assembly is like 'XY' being 1123.
Z80 Assembly>English>TI-BASIC>Python>French>C>0
Are you sure you typed it correctly? It works on my calc and I don't see any typos in what I posted.
Z80 Assembly>English>TI-BASIC>Python>French>C>0
Oh, good, thanks for the update!
Z80 Assembly>English>TI-BASIC>Python>French>C>0
Your are welcome. Now I need a code that does a matrix with ASCII characters.
Oh, that's actually easier and smaller!
take out the very ending stuff 3E18CB2417EF044518D8 and replace it with 7CEF044518DC.
Z80 Assembly>English>TI-BASIC>Python>French>C>0