commit c8c8bcd
Devine Lu Linvega
·
2025-08-21 02:22:43 +0000 UTC
parent fb4af25
Testing file read/write
2 files changed,
+35,
-7
+31,
-3
1@@ -6,14 +6,34 @@
2 |100
3
4 @on-reset ( -> )
5- file/<create-file>
6-
7+ file/<create>
8+ file/<load>
9+ ( | test load )
10+ ;file/a1 LDA2 ;file/a2 LDA2 EQU2 ?{
11+ ;dict/failed str/<print>
12+ #010e DEO
13+ BRK }
14+ ;dict/passed str/<print>
15+ #800e DEO
16 BRK
17
18-@file/<create-file> ( -- )
19+(
20+@|File )
21
22+@file/<create> ( -- )
23+ ;&name .File/name DEO2
24+ #0004 .File/length DEO2
25+ ;&data .File/write DEO2
26 JMP2r
27
28+@file/<load> ( -- )
29+ ;&name .File/name DEO2
30+ #0004 .File/length DEO2
31+ ;&buf .File/read DEO2
32+ JMP2r
33+
34+ &name "test.txt $1
35+
36 (
37 @|Utils )
38
39@@ -22,3 +42,11 @@
40 #18 DEO
41 INC2 !/<print>
42
43+(
44+@|Data )
45+
46+@dict/failed "Failed. 0a $1
47+ &passed "Passed. 0a $1
48+
49+@file/data &a1 1234 &b1 5678 &buf &a2 $2 &b2 $2
50+
M
makefile
+4,
-4
1@@ -19,13 +19,13 @@ gui: bin/uxncli bin/uxn11 bin/uxn11-debug bin/screen.rom
2 bin/uxn11-debug bin/screen.rom
3
4 mouse: bin/uxn11-debug bin/mouse.rom
5- bin/uxn11-debug bin/mouse.rom
6+ @ bin/uxn11-debug bin/mouse.rom
7
8 controller: bin/uxn11-debug bin/controller.rom
9- bin/uxn11-debug bin/controller.rom
10+ @ bin/uxn11-debug bin/controller.rom
11
12-file: bin/uxn11-debug bin/file.rom
13- bin/uxncli-debug bin/file.rom
14+file: bin/uxncli-debug bin/file.rom
15+ @ bin/uxncli-debug bin/file.rom
16
17 test: bin/uxncli-debug bin/uxn11-debug tests
18 bin/uxncli-debug bin/test_opcodes.rom