I'd like to have a virtual variable for the alpha register.
STO "ALPHA" (or A-REG or A-MAT or ...) generates a 8x1 matrix named ALPHA (or ...) and saves the alpha register there.
RCL "ALPHA" (...) recalls the ALPHA matrix into the alpha register.
Proposal: virtual alpha variable?
-
- Posts: 85
- Joined: Wed Jan 03, 2018 3:48 pm
- Location: Nuremberg, Germany
Proposal: virtual alpha variable?
DM15L S/# 10584 FW v25
DM42 S/# 01015 FW v3.5
DM42 S/# 01015 FW v3.5
-
- Posts: 564
- Joined: Mon Apr 24, 2017 8:38 pm
Re: Proposal: virtual alpha variable?
It might be possible to write a little routine to do this yourself. I don't have time to ponder on it too much right now though, maybe tonight...
-
- Posts: 1107
- Joined: Tue May 02, 2017 5:48 pm
- Location: Netherlands
- Contact:
Re: Proposal: virtual alpha variable?
How about:
LBL "ATOM"
1
ENTER
NEWMAT
EDIT
GROW
LBL 00
ASTO ST X
ASHF
ALENG
X=0?
GTO 01
R↓
→
GTO 00
LBL 01
R↓
EXITALL
RTN
LBL "MTOA"
EDIT
LBL 02
ARCL ST X
→
FC? 77
GTO 02
EXITALL
RTN
LBL "ATOM"
1
ENTER
NEWMAT
EDIT
GROW
LBL 00
ASTO ST X
ASHF
ALENG
X=0?
GTO 01
R↓
→
GTO 00
LBL 01
R↓
EXITALL
RTN
LBL "MTOA"
EDIT
LBL 02
ARCL ST X
→
FC? 77
GTO 02
EXITALL
RTN
-
- Posts: 34
- Joined: Sat Jul 22, 2017 9:14 pm
Re: Proposal: virtual alpha variable?
Question - Do you just wish to store the contents of the ALPHA register for future restore? If so, the the two following routines will do that:
This will store the Numeric Codes for each of the Characters in the ALPHA register. It will size the MATRIX to be the same as the length of the string in the ALPHA Register.
You could add a ROLL DOWN before exiting the routines if you don't wish to have the MATRIX in the X-Register.
Bill
Smithville, NJ
Code: Select all
00 { 37-Byte Prgm }
01▸LBL "STOA"
02 1
03 ALENG
04 NEWMAT
05 EDIT
06▸LBL 00
07 ATOX
08 →
09 FC? 76
10 GTO 00
11 EXITALL
12 STO "ALPHA"
13 XTOA
14 RTN
15 END
Code: Select all
00 { 18-Byte Prgm }
01▸LBL "RCLA"
02 RCL "ALPHA"
03 XTOA
04 RTN
05 END
This will store the Numeric Codes for each of the Characters in the ALPHA register. It will size the MATRIX to be the same as the length of the string in the ALPHA Register.
You could add a ROLL DOWN before exiting the routines if you don't wish to have the MATRIX in the X-Register.
Bill
Smithville, NJ
Re: Proposal: virtual alpha variable?
Nicely done. However it doesn't work if the ALPHA register is empty. So here is a slightly modified version, combining your two programs and supporting an empty ALPHA register:Bill (Smithville NJ) wrote: ↑Tue Apr 10, 2018 3:14 amThis will store the Numeric Codes for each of the Characters in the ALPHA register. It will size the MATRIX to be the same as the length of the string in the ALPHA Register.
You could add a ROLL DOWN before exiting the routines if you don't wish to have the MATRIX in the X-register.
Code: Select all
00 { 63-Byte Prgm }
01▸LBL "STOA"
02 ASTO "ALPHA"
03 1
04 ALENG
05 X=0?
06 RTN
07 NEWMAT
08 EDIT
09▸LBL 00
10 ATOX
11 →
12 FC? 76
13 GTO 00
14 EXITALL
15 STO "ALPHA"
16 R↓
17▸LBL "RCLA"
18 CLA
19 RCL "ALPHA"
20 XTOA
21 R↓
22 END
DM42: 00425 - DM41X: β00066 - WP43: 00042
-
- Posts: 85
- Joined: Wed Jan 03, 2018 3:48 pm
- Location: Nuremberg, Germany
Re: Proposal: virtual alpha variable?
Thomas, Bill, dlachzie ... thanks for your help.
Bill, I have to save the alpha register to a named matrix since your graphics string programm "messes" the stack
Bill, I have to save the alpha register to a named matrix since your graphics string programm "messes" the stack
DM15L S/# 10584 FW v25
DM42 S/# 01015 FW v3.5
DM42 S/# 01015 FW v3.5
Re: Proposal: virtual alpha variable?
Of course, Thomas' program will need at most a 8x1 matrix and 8 loops to store the Alpha register, and just performing XTOA on the matrix in the X-reg will append it to the Alpha register, just like Bill's. And it works for an empty Alpha Register without modification.
Werner
Werner
41CV†,42S,48GX,49G,DM42,DM41X,17BII,15CE, DM15L