Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Running RVBASIC from PiEconetFS crashes with exception #178

Closed
mincebert opened this issue Sep 5, 2023 · 7 comments
Closed

Running RVBASIC from PiEconetFS crashes with exception #178

mincebert opened this issue Sep 5, 2023 · 7 comments

Comments

@mincebert
Copy link
Contributor

I'm unclear if this is a RISC-V BASIC issue, or a PiTubeDirect Indigo issue, or a problem with PiTubeDirect, or I'm doing something monumentally stupid, but I get an uncaught exception if I try and execute RVBASIC from my PiEconetBridge.

I have the load and execute addresses set to &F80000 and I get the same error if I *LOAD and *GO, rather than just */, if I *MOVE the file from NET to ADFS, it then runs OK.

*NET
*INFO RVBASIC
RVBASIC    00F80000 00F80000   02328C    WR/       05/09/23 020716
*/RVBASIC
00F8578A:00000000:
Uncaught Exception
*LOAD RVBASIC F80000
*GO F80000
00F8578A:00000000:
Uncaught Exception
*MOVE RVBASIC -ADFS-$.TEMP.RVBASIC
*ADFS
*INFO $.TEMP.RVBASIC
RVBASIC    WR (54)  00F80000  00F80000  0002328C  003B25  
*/$.TEMP.RVBASIC
BBC BASIC for RISC-V Co Processor 1.36a
(C) Copyright R. T. Russell, 2023
>

Apologies if I've missed something not implemented yet, or misunderstood something!

@mincebert
Copy link
Contributor Author

This is on a Master with MOS 3.50 and ANFS 4.25, BTW.

@hoglet67
Copy link
Owner

hoglet67 commented Sep 6, 2023

This is a good find - I don't think I've tested the two-byte transfer mode that ANFS uses.

Can you spot the cut-paste error?

Type3:
    lb      t0, R4STATUS(gp)            # Test for an pending interrupt signalling end of transfer
    bltz    t0, Release
    lb      t0, R3STATUS(gp)
    bgez    t0, Type3
    lb      t0, R3DATA(gp)
    sb      t0, (t2)                    # store lo byte to memory
    lb      t1, R3DATA(gp)
    sb      t0, 1(t2)                   # store hi byte to memory
    addi    t2, t2, 2
    j       Type3

I'll fix this today and post a dev-build to this thread for you to test.

@mincebert
Copy link
Contributor Author

mincebert commented Sep 6, 2023

I only started looking at RISC-V yesterday , but is it the second store should be t1 instead of t0?

Or, more probably, the load should be t0 instead of t1, since I don’t think there’s a reason to use another register there.

If so, that does explain why, when I compared a copy loaded via ANFS and another via ADFS that there were a lot of differences. I hadn’t noticed they were every second byte, though!

@hoglet67
Copy link
Owner

hoglet67 commented Sep 6, 2023

Yes indeed, the second load should be t0.

@mincebert
Copy link
Contributor Author

Oh yes, so it is - every odd-numbered byte is wrong and the same as the even-numbered byte before it!

hoglet67 added a commit that referenced this issue Sep 6, 2023
Change-Id: I69b2e293e70418638021e393452d28b720848aec
hoglet67 added a commit that referenced this issue Sep 6, 2023
Change-Id: I69b2e293e70418638021e393452d28b720848aec
@hoglet67
Copy link
Owner

hoglet67 commented Sep 6, 2023

I've fixed the LOAD issue, but there also now seems to be an issue with SAVE that I'm investigating....

@hoglet67
Copy link
Owner

hoglet67 commented Sep 6, 2023

I've created a seperate issue (#179) for the SAVE bug, as that looks like an error in the ULA code.

I'll close this one now.

@hoglet67 hoglet67 closed this as completed Sep 6, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants