1 (edited by zxy 2018-08-27 06:39:03)

Topic: New .TRD command

Hello,
a new .TRD command is attached to this message. It works in this way :
.trd is equivalent to RANDOMIZE USR 15616
.trd <some TRD-DOS command> is equivalent to RANDOMIZE USR 15619:REM:<some TR-DOS command>
   Enjoy or ignore it :-)

MIME-Version: 1.0
Content-Type: application/octet-stream; name="TRD"
Content-Transfer-Encoding: base64
Content-Disposition: attachment; filename="TRD"

881MIDhD9TpIXB8fH+YHRxcXF7AhtyBOIQBbRe1CQXcjEPzx7Xs9XP02AP8htyBOIQBYEbggp+1C
69XtsCEAPacoBhEFAOHlGa/7yX20yFRdBiAaE/4NIAKvybgo9f4vKC3+LSgp/j8oJQ4ABjsR8iB+
IxITDP4NKAIQ9T46gTK3ICEuWAYAT6ftQiLBIMkhmiB+I6c3yNcY+FVzZSA6IC50cmQgW1RSLURP
UyBjb21tYW5kXQ0ABdPjw/sfzbAWIQAAfuXNgQ/hfv4NKAMjGPIqWVwiXVz9ywH+/TYA//02CgHD
ihv5wDAOAAADPQA66joNDQ0NDQ0NDQ0NDQ0NDQ0NDQ0NDQ0NDQ0NDQ0NDQ0NDQ0NDQ0NDQ0NDQ0N
DQ0NDQ0NDQ0NDQ0NDQ0NDQ0AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA
AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA
AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA
AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA=

2 (edited by Luzie 2018-09-17 18:55:01)

Re: New .TRD command

Hi,

thank you. I just give it a short try and a

.TRD CAT give me "No such COMMAND, 0:1"

However .TRD brings me directly into TR-DOS prompt :-)

Are you willing to release your source-code?

I will include it into "Almost (In-) Complete List of esxDOS DOT-Commands" ( http://board.esxdos.org/viewtopic.php?id=98 )

3

Re: New .TRD command

Hello Luzie,
thanks you for "feedback", unfortunately you haven't gave me more information
(a description of "testing environment" and so on) ...
In my case ".trd cat" works (here https://www.dropbox.com/s/qt0ugt85hd5b14b/trd.zip?dl=0
is animated GIF = the output from Spin emulator).
I have used TRD executable from my previous post and tried it
with emulated Speccy 16, 48, +128, +2, +2A and +3 with "classic" DivIDE ...

4

Re: New .TRD command

Hi zxy,

sorry for the delay, but it takes a little more time to test and write back to you...
I use Emulator SpecEmu for testing. More details soon here...

Regards,

Luzie

5 (edited by Luzie 2019-05-01 17:35:33)

Re: New .TRD command

OK, find some minutes to test again with SpecEmu (Latest version 3.1.b160318.zip, Downloadlink here:
https://www.worldofspectrum.org/forums/ … ent_946163 )

After having a look at you fantastic .GIF-Video-example I tried:

.VDISK 0 TRDDISK1.TRD
and
.TRD cat      (cat typed in as c a t) -> this works

.TRD CAT     (CAT as keyword on key 9): it works, but only, when I enter a additional "SPACE" between .TRD and CAT.
Without the addional SPACE it also display .TRD CAT on the commandline (as Keyword contains a blank), but his gives me the described error "No such COMMAND, 0:1"

So the clue was to enter an SPACE after .TRD and than enter the Keyword "CAT" from Key "9".

6

Re: New .TRD command

Thanks for your time, "the mystery" is explained. We should realize that .TRDCAT is different (and unknown ...) command than .TRD CAT (command .TRD with argument CAT). The printing of token CAT at command line is confusing because BASIC's printing routine adds spaces BUT ONLY ON SCREEN (so input of sequence : .trd+<EXTEND MODE>+<SYM.SHITF & 9> is not "WYSIWYG" :-) )

7

Re: New .TRD command

A modification of .TRD command :

.trd [TR-DOS command]

assumes mounted TRD image by vdisk command

or

.trd ! <TRD image>

does :

- mounting TRD image as unit 0
- executing TR-DOS command RUN

MIME-Version: 1.0
Content-Type: application/octet-stream; name="trd"
Content-Transfer-Encoding: base64
Content-Disposition: attachment; filename="trd"

zUwg8zhD9TpIXB8fH+YHRxcXF7AhUyFOIQBbRe1CQXcjEPzx7Xs9XP02AP8hUyFOIQBYEVQhp+1C
69XtsCEAPacoBhEFAOHlGa/7yX20yFRdBiAaE/4NIAKvybgo9f4vKDT+LSgw/j8oLP4hzKEgOCUO
AAY7EY4hfiMSEwz+DSgCEPU+OoEyUyEhLlgGAE+n7UIiXSHJIRohfiOnN8jXGPjlxdUaE6coWv4N
KFb+OihSuCjwGyGOIeXrfqcoDP4NKAj+OigE7aAY8K8SPmDPhT5g0dViawEqAM+A0TgVPg0GPBIT
EPzh5T4NNg0rPvd3rxgRIQghzZkg682ZICEQIc2ZIDfRweHJRGV2aWNlIAAgZXJyb3IuDQ0AVXNl
IDogLnRyZCBbVFItRE9TIGNvbW1hbmRdDRcMIG9yDRcGIC50cmQgISA8VFJEIGltYWdlPg0ABdPj
w/sfzbAWIQAAfuXNgQ/hfv4NKAMjGPIqWVwiXVz9ywH+/TYA//02CgHDihv5wDAOAAADPQA66joN
DQ0NDQ0NDQ0NDQ0NDQ0NDQ0NDQ0NDQ0NDQ0NDQ0NDQ0NDQ0NDQ0NDQ0NDQ0NDQ0NDQ0NDQ0NDQ0N
DQ0AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA=

8 (edited by Luzie 2019-05-17 12:01:04)

Re: New .TRD command

Dear zxy,

could you please tell me how .TRD works or are you willing to release source code for it?

I tried to write my own "TRDOS v5 CAT" .DOT command as programming test sample. The ASM-code works assembled into main memory e.g. from adress 32768. But it´s not workung as .DOT-command with ORG from adresse 8192 dez:

;Compiled with: sjasmplus-1.12.0.win
    device zxspectrum48
    org 0x2000

    CALL $3D21
;Drive A: = 0    
    LD A,0
;Function 1 = Select Drive    
    LD C,1
    CALL $3D13
    LD A,($5CF6)
    LD ($5CF9),A
    LD A,2
    LD C,7
    CALL $3D13

    RET

9

Re: New .TRD command

zxy wrote:

A modification of .TRD command :

.trd [TR-DOS command]

assumes mounted TRD image by vdisk command

or

.trd ! <TRD image>

does :

- mounting TRD image as unit 0
- executing TR-DOS command RUN

Could you please add a version number to .TRD?! Will help me much to include it my "Almost (In-) Complete List of esxDOS DOT-Commands" ( http://board.esxdos.org/viewtopic.php?id=98 )

10

Re: New .TRD command

Added current version to "Almost (In-) Complete List of esxDOS DOT-Commands" ( http://board.esxdos.org/viewtopic.php?id=98 )

11

Re: New .TRD command

Hello Luzie,
I have little bit modified your example of dot command - you can look at
https://www.dropbox.com/s/bpp7fahtrzvqu … l.zip?dl=0

Your original example cannot work because you call TR-DOS services from ESXDOS RAM bank 2
but (emulator of) TR-DOS is accessible in ESXDOS RAM bank 0 ...

TRD dot command does not use calls via #3D13 entry point:
the dot command prepares BASIC command line RANDOMIZE USR 15619:REM:<the copy of TRD dot command parameters>
into E-LINE area of Spectrum RAM and then the execution continues in BASIC interpreter loop.
So the result is similar to the BASIC command entered manually in the BASIC line editor and executed by pressing Enter key.

The part of TRD dot command code responsible for creating and executing of TR-DOS command
is moved into Spectrum RAM, then ESXDOS RAM bank 0 is paged in and then whole ESXDOS memory
is paged out (i.e. Spectrum ROM is accessible) - the preparation and execution of the TR-DOS command can start ...

Little bit complicated but I have not found different easier and fully working way ...

12

Re: New .TRD command

zxy wrote:

Hello Luzie,
I have little bit modified your example of dot command - you can look at
https://www.dropbox.com/s/bpp7fahtrzvqu … l.zip?dl=0

Your original example cannot work because you call TR-DOS services from ESXDOS RAM bank 2
but (emulator of) TR-DOS is accessible in ESXDOS RAM bank 0 ...

...

Little bit complicated but I have not found different easier and fully working way ...

Dear zxy,

sorry for my late reply!

Thank you very much for your extensive explanations and the Source-Code-Sample "TRDCall.$C".

13

Re: New .TRD command

Luzie wrote:
zxy wrote:

Hello Luzie,
I have little bit modified your example of dot command - you can look at

Dear zxy,

sorry for my late reply!

Thank you very much for your extensive explanations and the Source-Code-Sample "TRDCall.$C".

Update: I tried a little bit with your ASM-Code but could only get the Non-.DOT-command-version to work.
Maybe because I don´t tried with the Assembler ZASM v2.5 you mentioned. The Assemblers I used was SJASM and SJASMPLUS-1.13.1.win. Maybe they don´t like some directives you used in your sourcecode.

I´m using SpecEmu for testing together with HDFmonkey-Tool to stuff the compiled code into an .HDF-File.

Maybe it hangs on switching ESXDOS RAM banks. Or maybe the used buffer area (Printerbuffer) creates a problem. I don´t know yet...

If you like, could you please send me a working .DOT-command-version for trying it on SpecEmu?

Regards,

Luzie

14

Re: New .TRD command

Hello Luzie,
"mea culpa" - please remove or comment the line with instruction "CALL #3D21".
Corrected assembler source in Hobeta file is at https://www.dropbox.com/s/n62na3wmv1k2j … l.zip?dl=0
Compiled result (ESXDOS "dot" command) is at https://www.dropbox.com/s/yh26lenlwtssuqx/X?dl=0

  Regards

15 (edited by Luzie 2019-09-13 14:26:23)

Re: New .TRD command

Dear zxy,

in your "TRDCall.$C" you write:

; Unfortunately the initialization TR-DOS
; variables in ESXDOS TR-DOS emulator
; by calling #3D21 does not work.
; I have not found out the way of TR-DOS
; emulator's initialization by calling
; the ESXDOS code at some specific address,
; so before running of this dot-command
; run:
; .trd return

On the .C-Source extract\extract.c of Download: http://board.esxdos.org/viewtopic.php?pid=414#p414
= Download: https://drive.google.com/file/d/0B6XhJJ … sp=sharing

I found this:

esxdos_f_read(fin, buffer, 1);   // reported bug: esxdos cannot seek unless r/w has occurred first
esxdos_f_seek(fin, options.offset, ESXDOS_SEEK_SET);

maybe this help somehow?