The following warnings occurred:
Warning [2] Undefined array key 0 - Line: 1677 - File: showthread.php PHP 8.2.31 (Linux)
File Line Function
/inc/class_error.php 157 errorHandler->error
/showthread.php 1677 errorHandler->error_callback
/showthread.php 916 buildtree




Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Get a value after the call (*solved*)
#8
boriel Wrote:Could be. PAUSE statement uses ROM PAUSE implementation which relays on interruptions.
This could also indicate a problem with interruptions (EI, DI), vector interruptions, etc.
I usually used EmuZWin with its integrated debugger to debug the asm code generated by the compiler, BTW.

OK, I understand.

But going back to the previous question:

boriel Wrote:
Sinclair Wrote:Is there any way that a program in ZX BASIC returns a value?

That I need is, once end my program this return a value to the +3 BASIC as in the following example:

Code:
10 LOAD "program.bin" CODE 32768 20 LET r = USR 32768 30 PRINT r

Thank you.
This case is the same as in normal machine code. The value you can return is always a 16 bit integer stored in the BC register.
You can use END for that:

END 27613

Other than that, you must store the result in RAM and BASIC must PEEK from there.

Which is the reason for which this program always returns on the r variable of the Sinclair BASIC the value 10027 and not the N value of the ZX BASIC?

Code:
dim N as uinteger = 12345 end N
[Image: FootSign.jpg]
Reply


Messages In This Thread

Forum Jump:


Users browsing this thread: 1 Guest(s)