Post Reply 
Recalling X-MEM files information - RAMPAGE
06-29-2021, 10:28 PM
Post: #4
RE: Recalling X-MEM files information - RAMPAGE
Done! At least the initial work...
The first program saves the name of current X-File in use to another data X-File (already created with only one register), the XFLSTK (x-Filo stack):
I assume you have the RAMPAGE module installed (my in NovRam - thanks, Diego!)

1 LBL "BKXFL"
2 CLA
3 WORKFL here the important function from RAMPAGE that gets the current X-file's name
4 ALENGH
5 X=0? if no X-file in use, nothing to do.
6 RTN
7 ASTO L
8 "XFLSTK"
9 FLSIZE
10 ISG X
11 +
12 RESZFL
13 DSE X
14 SEEKPTA
15 X<> L
16 SAVEX
17 CLA
18 CLX
19 END


The second program restores the last saved file as current one:
1 LBL "RCXFL"
2 "XFLSTK"
3 FLSIZE
4 DSE X
5 SEEKPTA
6 X=0?
7 1/X
8 GETX
9 RDN
10 CHS
11 RESZFL
12 CLA
13 ARCL T
14 RCLPTA
15 SEEKPTA
16 END


How to use:
1 - Create the control X-file: ALPHA XFLSTK ALPHA 1 XEQ CRFLD (this is a one time execution);

2 - will you write a programm that uses X-files? If so, the first instruction after the label's name of program is to save current X-file in use. Don't worry, if there is no X-file in use, the routine will not do anything:
XEQ "BKXFL"

3 - write your programm, create your X-file - if more than one in your program, call BKXFL before create/access each X-file;

4 - each subroutine (other program or not) that creates/uses its own x-file, call BKXFL before trying to access its own X-file;

5 - at the end of each program/subroutine, call RCXFL (recall x-file) before doing RTN to the caller program.

If you call RCXFL more than there is saved file names, an erro occurs.

I believe these are simple but important routines for those who make intensive use of X-files.
I'll rewrite my own programs of menus and others that are a simplified version of units conversion to use registers in X-Memory instead of main memory.

Any improvement someone sees is very wellcome!

Best regards
Artur

ARTUR MARIO JUNIOR
BRAZIL
Find all posts by this user
Quote this message in a reply
Post Reply 


Messages In This Thread
RE: Recalling X-MEM files information - RAMPAGE - Artur - Brasil - 06-29-2021 10:28 PM



User(s) browsing this thread: 1 Guest(s)