mirror of
https://github.com/Asraelite/littlebigcomputer.git
synced 2025-07-18 00:26:50 +00:00
Fix V8 emulator bugs
This commit is contained in:
parent
c45ad79440
commit
476972f85a
29 changed files with 281 additions and 18 deletions
33
programs/parva_0.1/memtest_1.lbpasm
Normal file
33
programs/parva_0.1/memtest_1.lbpasm
Normal file
|
@ -0,0 +1,33 @@
|
|||
li x0, program_end ; x0 = start
|
||||
li x1, 0xff ; x1 = end
|
||||
|
||||
mv x2, x0
|
||||
|
||||
loop_write:
|
||||
|
||||
xori x3, x2, 0xaaa
|
||||
sw x3, 0(x2)
|
||||
addi x2, x2, 1
|
||||
ble x2, x1, loop_write
|
||||
|
||||
mv x2, x0
|
||||
|
||||
loop_read:
|
||||
|
||||
xori x3, x2, 0xaaa
|
||||
lw x4, 0(x2)
|
||||
bne x3, x4, error
|
||||
addi x2, x2, 1
|
||||
ble x2, x1, loop_read
|
||||
|
||||
success:
|
||||
|
||||
li x0, 0
|
||||
wfi
|
||||
|
||||
error:
|
||||
|
||||
mv x0, x2
|
||||
wfi
|
||||
|
||||
program_end:
|
Loading…
Add table
Add a link
Reference in a new issue