You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
An ADL=1 binary, written in C with the standard init.asm from the 'Hello World' example, that opens a file using the bare minimum assembly code for mos_fopen, mos_fopen only works when no bbcbasic.bin has been running previously.
After *bye from bbcbasic, mos_fopen just returns 0
Before running bbcbasic, manually, or from the autoexec.txt, mos_fopen returns a valid filehandle.
I'm attaching a minimalistic example that just fopens/fcloses 'autoexec.txt', and does it statically to avoid using the C arg parser. But opening other existing files behave similarly. fopenbug.zip
I have reverted back to running MOS 1.02/VDP 1.02 and also tried bbcbasic 1.02/1.03/1.04.
Thnx!
The text was updated successfully, but these errors were encountered:
I think I have found the culprit. I used the latest C init.asm, but that isn't saving the MBASE register to stack.
When I save it before main and clear it / recover it from stack after main, everything works as it should.
Several MOS calls check the value in MBASE. For 24-bit apps calling to MOS API, it's more important that they set MBASE to 0, or get it set to 0 before starting.
Hi Dean,
An ADL=1 binary, written in C with the standard init.asm from the 'Hello World' example, that opens a file using the bare minimum assembly code for mos_fopen, mos_fopen only works when no bbcbasic.bin has been running previously.
After *bye from bbcbasic, mos_fopen just returns 0
Before running bbcbasic, manually, or from the autoexec.txt, mos_fopen returns a valid filehandle.
I'm attaching a minimalistic example that just fopens/fcloses 'autoexec.txt', and does it statically to avoid using the C arg parser. But opening other existing files behave similarly.
fopenbug.zip
I have reverted back to running MOS 1.02/VDP 1.02 and also tried bbcbasic 1.02/1.03/1.04.
Thnx!
The text was updated successfully, but these errors were encountered: