Code: Select all
[code] 1000 Print x
Or
Code: Select all
[code]
1000 Print 'Hello Norm!'
2000 goto 1000
To get code blocks in a posting.
Cheers,
Norm.
Code: Select all
[code] 1000 Print x
Code: Select all
[code]
1000 Print 'Hello Norm!'
2000 goto 1000
The toolkit in question was included with the example I gave above, Test.zip. It is a kind of PRINT command, except it can take a real channel ID. The other command, CHANID simply converts a S*BASIC channel number to a channel ID. So job#1 (Master) passes its channel ID to job#2 (Slave) so job#2 can print to job#1's window.Tinyfpga wrote:<>
Does via a toolkit mean via a Knoware toolkit. If so which might it be ? If not, can a general purpose toolkit be written?
The reason the SBASIC code is line-numbered is so you can EXecute it directly. In the case in point, if both master_bas and slave_bas are in ram1_, all you have to do is EX ram1_master. master_bas needs to EXecute ram1_slave_bas by itself so it can send it its channelID in the command line.Tinyfpga wrote:I downloaded pjw's Test.zip code and unziped it to ram1 in SMSQ/E. After a bit of faffing around I manged to EX (as interpret, I think) the two _bas programs
successfully. I can sort of see what is going on but I do not use the SMSQ/E interpreter so the programs are not in a form I am familiar with..
When I get the time I will try to work out what the code does and see If I can make use of the two new functions ( PRTSTR% and CHANID ) you so kindly provided.
As an aside; Why do Qlers use the SMSQ/E interpreter with line numbered code, rather than the freeform code I use with the QD/Qliberator combination?
Code: Select all
100 JOB_NAME 'Master'
110 ch = FOPEN("con"): rem All slaves will write here
120 PAPER#ch; 7: CLS#ch
130 :
140 FOR n% = 1 TO 5: rem 5 slaves is enough
150 cl$ = n% & HEX$(CHANID(#ch), 32): rem Command line
160 EX_M 'ram1_slave_bas'; cl$: rem Slave n%, owned by me
170 SUSJB -1, 0: rem Reschedule
180 END FOR n%
190 SUSJB -1, 1200: rem Wait for slaves to finish
200 QUIT
Code: Select all
100 COLOUR_24
110 :
120 cl$ = CMD$
130 y% = cl$(1): rem Slave number
140 ch = HEX(cl$(2 TO)): rem Channel ID
150 :
160 JOB_NAME "slave " & y%
170 :
180 SPJOB -1, y% * 8: rem Test different priorities..
190 :
200 SELect ON y%: rem Each slave a different colour
210 = 1: col = $FF0000
220 = 2: col = $FF00
230 = 3: col = $FF
240 = 4: col = $FF00FF
250 = 5: col = $FFFF00
260 END SELect
270 :
280 t% = -1: rem Timeout
290 x% = 1: rem columnn 1
300 :
310 FOR i = 1 TO 999999: rem Massive count
320 i$ = i & ' '
330 er% = PRTSTR%(#ch, t%! x%, y%\ col; i$)
340 IF er% < 0: EXIT i
350 SUSJB -1, 0: rem Enter scheduler briefly
360 END FOR i
370 :
380 QUIT
Right now I was fascinated to see how the slaves, all working at different priorities, incremented their numbers at different speeds! Ive never seen this so clearly before. Of course, one needs to use a better choice of colours than I used. Also, no reason to stop at 5 slaves.., Then just set the master to wait a bit more patiently for the slaves to finish their work..Tinyfpga wrote:pjw your latest code samples and very useful associated notes look very interesting. When I find the time I will be cheekily converting your (much easier to read now you have added some : and REMs) code, into the form I like for compiling.
Sure. Ive been waiting since I first heard Leon Heller (of QUANTA fame. Remember him?) talk of Transputers..As to your thoughts of this being useful, I would say it is for two reasons:
Firstly the main use of a Q68 at the moment is as a leisure activity. Removing a limit to writing multi tasking, and with networked Q68s, multi processing
applications is, for those of a certain predisposition, enjoyable.
I doubt that will ever materialise now..Secondly for Stella ( you know;Tony Tebby's ultimate OS ) running in large multiprocessing/memory FPGAs arrays, this kind of thing will be essential.
After this week, I wouldnt dare to ask for any more for a good long whileAll you have to do is convince Peter Graf, Marcel Kilgus, Wolfgang Lenerz et al. to see this future as a Quantum Leap. Then you really, will have a QL.
Add the toolkit to line 10, remove the REM line at 200 (not Qlib compatible) and get rid of the inline hex. It compiles for me.Tinyfpga wrote:pjw wrote:- After this week, I wouldn't dare to ask for any more for a good long while.
I have decided to take the risk that you are not referring to me so, here goes:-
Can one compile your sample code with Qliberator set to no-win?. I have tried and failed.
Code: Select all
10 REMark $$asmb=win1_prg_test_chn_PSTST_BIN,0,10
100 COLOUR_24
110 :
120 cl$ = CMD$
130 y% = cl$(1): REMark Slave number
140 ch = HEX(cl$(2 TO)): REMark Channel ID
150 :
160 JOB_NAME "slave " & y%
170 :
180 SPJOB -1, y% * 8: REMark Test different priorities..
190 :
200 SELect ON y%
210 = 1: col = HEX('F0000')
220 = 2: col = HEX('FF00')
230 = 3: col = 255
240 = 4: col = HEX('FF00FF')
250 = 5: col = 0
260 END SELect
270 :
280 t% = -1: REMark Timeout
290 x% = 1: REMark columnn 1
300 :
310 FOR i = 1 TO 999999: REMark Massive count
320 i$ = i & ' '
330 er% = PRTSTR%(#ch, t%! x%, y%\ col; i$)
340 IF er% < 0: EXIT i
350 SUSJB -1, 0: REMark Enter scheduler briefly
360 END FOR i
370 :
380 QUIT