On 08/06/2018 14:29, Jan Bredenbeek via Ql-Users wrote:
On 8 June 2018 at 13:26, pjwitte via Ql-Users <ql-users@lists.q-v-d.com>
wrote:

It appears that, on an error, QDOS doesnt return here at all!
Correct.


Under SMSQ/E it may return an error (IMEM), but the error code is not
always set! That implies that you could get a wrong result, depending on
what was in D0 before the call.

I've tested this earlier using this code on SMSQmulator:

result   dc.l     0
          move.l   #16*1024*1024,D1
          move.w   $11a,a2
          jsr      (a2)
          lea      result(pc),a1
          move.l   d0,(a1)
          moveq    #0,d0
          rts

When loading this into RESPR and then doing CALL base+4 I get an
'insufficient memory' error. But PEEK_L(base) returns 0 so the code never
got to the point where it stores the result.
Sure, but this is not the whole story. For example when I ran your code just now in a daughter SBASIC, with no free memory, it returns ok, but peeking result I get an err.ipar! Depending on circumstances, there are a number of possible paths this routine can take. From my own investigations (I wish Id written up what I did, not only the conclusion!) in some cases this routine forgets to set error code on a successful return.

Per
_______________________________________________
QL-Users Mailing List

Reply via email to