Swapping drive numbers

Started by MIRKOSOFT, July 31, 2010, 04:11 PM

Previous topic - Next topic

0 Members and 1 Guest are viewing this topic.

MIRKOSOFT

Hi!

I have very simple program to swap drive in BASIC:
 

10 open 15,8,15
20 print#15,"u0>";chr$(9)
30 close 15
35 rem moved 8 to 9
40 open 15,10,15
50 print#15,"u0>";chr$(8)
60 close 15
65 rem moved 10 to 8
70 open 15,9,15
80 print#15,"u0>";chr$(10)
85 rem moved 9 to 10


But I don't have choice to set any device (in this case temporary) to another with this style.
So, I can't move 8 > 9 then 10 > 8 'cause 9 is used.
I want to ask if is possible to swap drive numbers with one line e.g.
8 > 10 / 10 > 8 with temporary disabling, then enabling or so...

Many thanks for every reply.

Miro
MIRKOSOFT of megabytes

Commodore 64 was great, Commodore 128 is bigger, better, faster and more!!!

http://www.mirkosoft.sk

BigDumbDinosaur

Quote from: MIRKOSOFT on July 31, 2010, 04:11 PM
Hi!

I have very simple program to swap drive in BASIC:
 

10 open 15,8,15
20 print#15,"u0>";chr$(9)
30 close 15
35 rem moved 8 to 9
40 open 15,10,15
50 print#15,"u0>";chr$(
60 close 15
65 rem moved 10 to 8
70 open 15,9,15
80 print#15,"u0>";chr$(10)
85 rem moved 9 to 10


But I don't have choice to set any device (in this case temporary) to another with this style.
So, I can't move 8 > 9 then 10 > 8 'cause 9 is used.
I want to ask if is possible to swap drive numbers with one line e.g.
8 > 10 / 10 > 8 with temporary disabling, then enabling or so...

Many thanks for every reply.

Miro
Another example  of a question with an obvious answer:

10 open 1,8,15 : open 2,10,15
20 print#1,"u0>";chr$(9) : rem move 8 to 9
30 print#2,"u0>";chr$(8) : rem move 10 to 8
60 close 1 : close 2 : rem done
x86?  We ain't got no x86.  We don't need no stinking x86!

LokalHorst

the above would work if dev#9 weren't present - it's almost everytime possible to use dev no. 30 as temporary one.
In general the u0> cmd only exists on 1570/71/81 but not on 1541 (or emulated) drives.

Hydrophilic

I agree with LokalHorst, use device 30 as temporary drive to avoid conflicts.  I've never seen any real device assigned #30!


0 rem swap device a with b
10 a=8: b=9: open a,a,15: open b,b,15
20 print#a, "u0>" + chr$(30): close a: open 30,30,15
30 print#b, "u0>" + chr$(a): close b
40 print#30, "u0>" + chr$(b): close 30



I'm kupo for kupo nuts!

MIRKOSOFT

Hi!


As finally Q:
print#file, "m-w:" chr$(119) chr$(0) chr$(2) chr$( number + 32) chr$( number +64)
will this command work on emulated drives?
I tested it only on real 1541/1570/1571/1581...


Many many thanks!
MIRKOSOFT of megabytes

Commodore 64 was great, Commodore 128 is bigger, better, faster and more!!!

http://www.mirkosoft.sk

wte

#5
You have to check the drive change command. U1541 and IEC2ATA (NLQ-Version) should work correctly. Most other emulation drives might fail.

Regards WTE

PS: U0>[devicenumber] works on CMD-Hardware and on the IEC2ATA (NLQ-Version). You should try it also on the IEC2SD.