My "from PACKAGE import *" (Python) simulation project (reflection)

Anything QL Software or Programming Related.
User avatar
Popopo
Gold Card
Posts: 430
Joined: Wed Apr 07, 2021 10:37 am

Re: My "from PACKAGE import *" (Python) simulation project

Post by Popopo »

ql_freak wrote: Sat May 03, 2025 2:44 am This is DEFINITELY working (sQLux with Minerva)! See my current project:

viewtopic.php?p=64237#p64237
I will check it out. Thanks


ql_freak wrote: Sat May 03, 2025 2:44 am p.s.: Are you the one who sells memory expansion and this Microdrive emulator SD-interface on ebay? I think I must order...
Yes I am.
But for a while I will not offer more on ebay, 29 items/year limit reached.
So I give only directly from me, not by ebay. Unless for a while (weeks or months). Feel free to contact to me by PM.
Another option is to built by yourself any of those, I would assist you in the process if you need any help with soldering or whatever to built them up by yourself. Happy to help


User avatar
ql_freak
Gold Card
Posts: 493
Joined: Sun Jan 18, 2015 1:29 am

Re: My "from PACKAGE import *" (Python) simulation project

Post by ql_freak »

First version of my reflection S(uper)BASIC machine code toolkit (library):

See attachement (packed on PC with 7-Zip [can it be unpacked with zip on the QL?], tested on Minerva and QPC2).
Attachments
reflection0v0v0.zip
(965 Bytes) Downloaded 22 times


http://peter-sulzer.bplaced.net
GERMAN! QL-Download page also available in English: GETLINE$() function, UNIX-like "ls" command, improved DIY-Toolkit function EDLINE$ - All with source. AND a good Python 3 Tutorial (German) for Win/UNIX :-)
Derek_Stewart
Font of All Knowledge
Posts: 4693
Joined: Mon Dec 20, 2010 11:40 am
Location: Sunny Runcorn, Cheshire, UK

Re: My "from PACKAGE import *" (Python) simulation project

Post by Derek_Stewart »

Hi Peter,

Excellent toolkit utility.

Could there be enhancement to display the last Superbasic Line number and if posible the increment of Suprbasic program lines?


Regards,

Derek
User avatar
ql_freak
Gold Card
Posts: 493
Joined: Sun Jan 18, 2015 1:29 am

Re: My "from PACKAGE import *" (Python) simulation project

Post by ql_freak »

To get the last line just subtract 1 from REF_GETLNFREE%. But it shouldn't be a problem to ad a function which returns the last line number. For the second enhancement: There is no fixed increment or I do not see what you mean.

Unfortunately I'm currently very short of time, so it may take some time.


http://peter-sulzer.bplaced.net
GERMAN! QL-Download page also available in English: GETLINE$() function, UNIX-like "ls" command, improved DIY-Toolkit function EDLINE$ - All with source. AND a good Python 3 Tutorial (German) for Win/UNIX :-)
User avatar
ql_freak
Gold Card
Posts: 493
Joined: Sun Jan 18, 2015 1:29 am

Re: My "from PACKAGE import *" (Python) simulation project

Post by ql_freak »

For Derek: New FuNction REF_GETLNHI% returns the highest line number of the currently loaded SuperBASIC program.

I still do not know, for what this is needed (especially as REF_GETLNFREE%-1 is the same), but it was easy to add.

reflection_txt has also been extended(!).

(Packed with 7-Zip on Windows 10)

Edith: Version is 0.0.1
Attachments
reflection.zip
(1.32 KiB) Downloaded 12 times


http://peter-sulzer.bplaced.net
GERMAN! QL-Download page also available in English: GETLINE$() function, UNIX-like "ls" command, improved DIY-Toolkit function EDLINE$ - All with source. AND a good Python 3 Tutorial (German) for Win/UNIX :-)
User avatar
Popopo
Gold Card
Posts: 430
Joined: Wed Apr 07, 2021 10:37 am

Re: My "from PACKAGE import *" (Python) simulation project (reflection)

Post by Popopo »

Hi,

If I understood right, your work (this one) allows to get the last free line, or rephrasing it, it allows to get the next numerable line.
Have I understood right?

This is to work with Minerva OS, or also with others like JS, JM...?

And... what I didn't catch yet, why do you remark Python here? What is the bound with Python?

I must re-read the whole thread but another question, did you programmed it in ASM or SuperBasic?

And finally!!! :)...
How do you think would be the cost to implement a keylogger that allows to get back in last 10 sentences?
What about to add to the Minerva ROM or a revision of TK2 (if possible) the function to get which unit was accessed last?


Thanks


User avatar
tofro
Font of All Knowledge
Posts: 3100
Joined: Sun Feb 13, 2011 10:53 pm
Location: SW Germany

Re: My "from PACKAGE import *" (Python) simulation project (reflection)

Post by tofro »

Popopo wrote: Sat May 10, 2025 8:44 am And finally!!! :)...
How do you think would be the cost to implement a keylogger that allows to get back in last 10 sentences?
What about to add to the Minerva ROM or a revision of TK2 (if possible) the function to get which unit was accessed last?
Both is already there:
  1. Look for the History device on the QL home page - this allows you to get back (and edit) an adjustable history of input lines.
  2. Look for the RECENT Thing (I think it's only implemented for SMSQ/E because it may be a bit heavyweight for the QL). So, may be not exactly what you're looking for, but quite a bit of a head start.


ʎɐqǝ ɯoɹɟ ǝq oʇ ƃuᴉoƃ ʇou sᴉ pɹɐoqʎǝʞ ʇxǝu ʎɯ 'ɹɐǝp ɥO
User avatar
ql_freak
Gold Card
Posts: 493
Joined: Sun Jan 18, 2015 1:29 am

Re: My "from PACKAGE import *" (Python) simulation project (reflection)

Post by ql_freak »

Popopo wrote: Sat May 10, 2025 8:44 am If I understood right, your work (this one) allows to get the last free line, or rephrasing it, it allows to get the next numerable line.
Have I understood right?
Exactly.
Popopo wrote: Sat May 10, 2025 8:44 am This is to work with Minerva OS, or also with others like JS, JM...?
This should work with any really compatible S(uper)BASIC language. I'm using only things which are clearly documented in Jan Jones SuperBASIC manual.
Popopo wrote: Sat May 10, 2025 8:44 am And... what I didn't catch yet, why do you remark Python here? What is the bound with Python?
In Python most programs start with a lot of import statements, e.g.:

Code: Select all

import os
import tkinter
import ...
Later the functions/methods of these imported routines may be used in your program, e.g.:

Code: Select all

myfile = os.path.join(os.getcwd(), 'myfile.txt')
with open (myfile, 'r') as mf:
    # do something with myfile.txt
My project wants to simulate the import statement with the MERGE command. Therefore I have written the rn program in C (see here which gets as arguments the line number and the increment and renumbers the program accordingly. Therefore I have needed a function, which return the first unused line number. See my example here.
Popopo wrote: Sat May 10, 2025 8:44 am And finally!!! :)...
How do you think would be the cost to implement a keylogger that allows to get back in last 10 sentences?
What about to add to the Minerva ROM or a revision of TK2 (if possible) the function to get which unit was accessed last?
Totally different thing and there is already the HISTORY device from Boris Jakubith.

Thanks
[/quote]


http://peter-sulzer.bplaced.net
GERMAN! QL-Download page also available in English: GETLINE$() function, UNIX-like "ls" command, improved DIY-Toolkit function EDLINE$ - All with source. AND a good Python 3 Tutorial (German) for Win/UNIX :-)
User avatar
ql_freak
Gold Card
Posts: 493
Joined: Sun Jan 18, 2015 1:29 am

Re: My "from PACKAGE import *" (Python) simulation project (reflection)

Post by ql_freak »

EJC (Erling Jacobsen C)

For those lucky user who have a copy of EJC:

The manual states that DATAD$ and PROGD$ must point (be) the directory of EJC.

At least with the PTH-Device from Phil Borman it is working if just DATAD$ is pointing to the EJC directory (where your C source must be present).
ejcDatadOnly01.png
I will try to improve this (if I find time), so that DATAD$ may point to another directory than the EJC directory (the cc compiler driver is delivered in source code :-)).

p.s.: I have installed EJC in "WIN1_bin_ejc", i.e. the EJC executables (compiler phases and linker are even found, if the PTH1 only includes WIN1_bin and not WIN1_bin_ejc :-)


http://peter-sulzer.bplaced.net
GERMAN! QL-Download page also available in English: GETLINE$() function, UNIX-like "ls" command, improved DIY-Toolkit function EDLINE$ - All with source. AND a good Python 3 Tutorial (German) for Win/UNIX :-)
User avatar
ql_freak
Gold Card
Posts: 493
Joined: Sun Jan 18, 2015 1:29 am

Re: My "from PACKAGE import *" (Python) simulation project (reflection)

Post by ql_freak »

One problem exists: If there is an old version of the program (rn in my case), which appears in PTH1 before the ejc-directory (in my case e.g. WIN1_bin_), then you must enter the FQPN (fully qualified pathname), if you want to test your new compiled program, i.e.

ex'WIN1_bin_ejc_rn';'...' instead of ex'rn';'...'


http://peter-sulzer.bplaced.net
GERMAN! QL-Download page also available in English: GETLINE$() function, UNIX-like "ls" command, improved DIY-Toolkit function EDLINE$ - All with source. AND a good Python 3 Tutorial (German) for Win/UNIX :-)
Post Reply