## A Question about "The Matrix" ;)

General discussion about calculators, Swiss Micros or otherwise
mcc
Posts: 187
Joined: Fri Jun 23, 2017 3:10 am

### A Question about "The Matrix" ;)

Hi,

I still have not arrived at my DM42... (still on Christmas holidays...)...
In the meantime I am programming the Free42 on my Android tablet.

I have a question about flag 76 and 77. Reading the HP42 manual about these two flags I
think to understand -- and please correct me, if I am wrong -- that flag 76 gets set, if the
column counter wraps from max. to 1 and flag 77 gets sets if the row and column counter
wraps from max.,max. to 1,1.

Based on this I wrote this example, which does not work:

LBL "MATFIL"
CLV "TMPMAT"
2
2
DIM "TMPMAT"
INDEX "TMPMAT"
LBL01
RAND
STOEL
<LEFT>
FS? 76
<DOWN>
FS? 77
GTO 99
GTO 01
LBL 99

Purpose is to fill the created matrix with random values.
If this work, I will extend this to fill any matrix in the X-register....

(this is not a dump of the program of the Free42...I have limited possibilities here and cant transfer anything....)

Any help is very appreciated!
Thanks a lot and happy New Year 2018!
Cheers!
Meino
DM 42 - SN: 00373, Firmware v.:3.12. / 3.12. as compiled by SwissMicros

Thomas Okken
Posts: 503
Joined: Tue May 02, 2017 3:48 pm
Location: New Jersey, USA
Contact:

### Re: A Question about "The Matrix" ;)

mcc wrote:
Sat Dec 30, 2017 7:06 pm
I have a question about flag 76 and 77. Reading the HP42 manual about these two flags I
think to understand -- and please correct me, if I am wrong -- that flag 76 gets set, if the
column counter wraps from max. to 1 and flag 77 gets sets if the row and column counter
wraps from max.,max. to 1,1.
Not quite. Flag 76 signals "edge wrap," i.e. when "right arrow" or J+ go past the end of a row, or when "down arrow" or I+ go past the end of a column; flag 77 signals "end wrap," when you go past the corner (row and column wrap at the same time).
So, you can fill a matrix with a single loop, no double nested loop needed; just use "right arrow" and check flag 77.
mcc wrote:
Sat Dec 30, 2017 7:06 pm
(this is not a dump of the program of the Free42...I have limited possibilities here and cant transfer anything....)
As long as you have email on your tablet, you can share programs using Copy and Paste.

mcc
Posts: 187
Joined: Fri Jun 23, 2017 3:10 am

### Re: A Question about "The Matrix" ;)

Hi,

trust me....my tablet is not a smartphone (no way to connect to the mobile net) and no WLAN here...
as I said: Limited resources...
Therefore: good ole handcrafted code...

Thanks for the infos...

Cheers
Meino
DM 42 - SN: 00373, Firmware v.:3.12. / 3.12. as compiled by SwissMicros