updated listing/saving algos
This commit is contained in:
+12
-5
@@ -226,6 +226,16 @@ Run the program currently loaded into the working memory.
|
||||
|
||||
Output program listing.
|
||||
|
||||
Two algorithms are provided: for the platforms that can extract associative array keys and for those that cannot.
|
||||
|
||||
Algorithm 1:
|
||||
|
||||
1. Extract key list `LNOS` from `PROGMEM` associative array. Sort the list in the integer numeric order.
|
||||
2. Fetch the next key `LNO` from `LNOS`. Upon exhaustion, return from the routine.
|
||||
3. If `PROGMEM[LNO]` is not empty, output the value of `LNO`, TAB character (ASCII 9) and `PROGMEM[LNO]` with a newline at the end. Go to step 2.
|
||||
|
||||
Algorithm 2:
|
||||
|
||||
1. Set `I = 1`.
|
||||
2. If `PROGMEM[I]` exists and is not empty, output the value of `I`, TAB character (ASCII 9) and `PROGMEM[I]` with a newline at the end.
|
||||
3. Increment `I` by 1.
|
||||
@@ -263,11 +273,8 @@ Program saving routine into external storage media. The provided algorithm works
|
||||
1. Prompt the user for a file name/path `FNAME`.
|
||||
2. If the file name/path isn't writable, notify the user about this error and return.
|
||||
3. Open a file handle `FH` for writing into the file under the path `FNAME`.
|
||||
4. Set `I = 1`.
|
||||
5. If `PROGMEM[I]` exists and is not empty, write the value of `I`, space character (ASCII 32) and `PROGMEM[I]` with a newline at the end to the file handle `FH`.
|
||||
6. Increment `I` by 1.
|
||||
7. If `I > 0` and `I < 32768`, go to step 5.
|
||||
8. Close the handle `FH` and notify the user about successful program saving.
|
||||
4. Perform the algorithm described for the `LIST` routine, but using the specified file handle instead of standard output and space character (ASCII 32) instead of TAB character (ASCII 9).
|
||||
5. Close the handle `FH` and notify the user about successful program saving.
|
||||
|
||||
## Closing notes
|
||||
|
||||
|
||||
Reference in New Issue
Block a user