Running Cport from Win1_

Anything QL Software or Programming Related.
Martin_Head
Aurora
Posts: 847
Joined: Tue Dec 17, 2013 1:17 pm

Re: Running Cport from Win1_

Post by Martin_Head »

NormanDunbar wrote:Thanks Martin.

I'll get in these ASAP. Tking MrsD for her first vaccination today.

Much obliged.

Cheers,
Norm.
Had mine as well. So far, still feeling OK, no flu symptoms yet


User avatar
NormanDunbar
Forum Moderator
Posts: 2251
Joined: Tue Dec 14, 2010 9:04 am
Location: Leeds, West Yorkshire, UK
Contact:

Re: Running Cport from Win1_

Post by NormanDunbar »

I had the A-Z vaccine. No symptoms at all. Mind you, I did sleep for two solid hours on Saturday afternoon - possibly related? But most likely because I was awake at 1 Am the night before!

Alison has also had the A-Z one, and she's had no symptoms either.

Looking forward to my second.


Cheers,
Norm.


Why do they put lightning conductors on churches?
Author of Arduino Software Internals
Author of Arduino Interrupts

No longer on Twitter, find me on https://mastodon.scot/@NormanDunbar.
bixio60
Brittle Membrane
Posts: 110
Joined: Sun May 04, 2014 7:05 am

Re: Running Cport from Win1_

Post by bixio60 »

NormanDunbar wrote:I had the A-Z vaccine. No symptoms at all. Mind you, I did sleep for two solid hours on Saturday afternoon - possibly related? But most likely because I was awake at 1 Am the night before!

Alison has also had the A-Z one, and she's had no symptoms either.

Looking forward to my second.


Cheers,
Norm.
Hi,
Off-topic:
I had the A-Z vaccine last Saturday....well not good.... 2 days (Sunday and Monday) in the bed with fever, nausea, pains all over my body, especially where I got the injection ... today all fine ... phew :)

Back on topic:
I am working on the results of decompiling (thanks Martin) DP Astrologer and Astronomer. The _bas resulting is not too bad in respect of the result I got from Cport_bas

Fabrizio


EmmBee
Trump Card
Posts: 240
Joined: Fri Jan 13, 2012 5:29 pm
Location: Kent

Re: Running Cport from Win1_

Post by EmmBee »

bixio60 wrote: I am working on the results of decompiling (thanks Martin) DP Astrologer and Astronomer. The _bas resulting is not too bad in respect of the result I got from Cport_bas

Fabrizio
Hi Fabrizio,

In DP Astrologer and Astronomer, are you getting any ** Stack empty ** 's ? In Cport_bas there are quite a few of these showing up. The question is what to do about them. I reckon we need to replace these either with a 0 or a null string as appropriate. However, this may be problematic for some keywords, such as POKE$, POKE_L and PEEK$.

Michael


Martin_Head
Aurora
Posts: 847
Joined: Tue Dec 17, 2013 1:17 pm

Re: Running Cport from Win1_

Post by Martin_Head »

EmmBee wrote:
bixio60 wrote: I am working on the results of decompiling (thanks Martin) DP Astrologer and Astronomer. The _bas resulting is not too bad in respect of the result I got from Cport_bas

Fabrizio
Hi Fabrizio,

In DP Astrologer and Astronomer, are you getting any ** Stack empty ** 's ? In Cport_bas there are quite a few of these showing up. The question is what to do about them. I reckon we need to replace these either with a 0 or a null string as appropriate. However, this may be problematic for some keywords, such as POKE$, POKE_L and PEEK$.

Michael
Here's an example

Code: Select all

11866 procFun13057 : IF (** Stack empty ** < (var94A4 * 1024)) THEN 
procFun13057 is almost certainly a function, so the line should be

Code: Select all

11866 IF (procFun13057 < (var94A4 * 1024)) THEN 
The decompiler tries to identify functions, but defaults to procedures if it's not sure.
The ** Stack empty ** is a warning that the compiler was expecting to find something on the stack, and it was not there. As the compiler incorrectly identified procFun13057 as procedure, it did not place it on the stack, as a function would have been.

Once you have identified which are Functions, and which are Procedures. It gets easier to spot what's going on.

I notice there are also some Stack empties by some READ's. Let me know if you have problems with them that I need to sort out.


EmmBee
Trump Card
Posts: 240
Joined: Fri Jan 13, 2012 5:29 pm
Location: Kent

Re: Running Cport from Win1_

Post by EmmBee »

There is one such line here ...

Code: Select all

11413 FOR var9400 = 1 TO 12 STEP 1 : READ  : var9AA0$(** Stack empty ** TO var9400%) = var9400% : END FOR var9400%
I was going to interpret this as

Code: Select all

11413 FOR var9400 = 1 TO 12 : READ var9AA0$(var9400)
Note the index name of var9400 only would be used - and not var9400%


Martin_Head
Aurora
Posts: 847
Joined: Tue Dec 17, 2013 1:17 pm

Re: Running Cport from Win1_

Post by Martin_Head »

EmmBee wrote:There is one such line here ...

Code: Select all

11413 FOR var9400 = 1 TO 12 STEP 1 : READ  : var9AA0$(** Stack empty ** TO var9400%) = var9400% : END FOR var9400%
I was going to interpret this as

Code: Select all

11413 FOR var9400 = 1 TO 12 : READ var9AA0$(var9400)
Note the index name of var9400 only would be used - and not var9400%
If var9AA0$ is an array, that looks likely. I seem to remember having some problems with READing into arrays. I would have to do a manual decompile to be sure of what's going on.

var9400 probably had an IMPLICIT somewhere to make it integer. I think in the compiled code, FOR just specifies that its var9400 and there is no indication that it's integer. So the decompiler does not know to add a '%' on the end of the FOR.

I think you will find that tidying up a Turbo decompile, is harder than a Qlib decompile. QLib seems to me to be a lot more consistent and simpiler, and it also offloads a lot to QDOS, that Turbo handles internally.


Post Reply