... | ... |
@@ -31,10 +31,10 @@ Begin by building the assembler and emulator by running the build script. The as |
31 | 31 |
./build.sh |
32 | 32 |
``` |
33 | 33 |
|
34 |
-The following command will create an Uxn-compatible rom from an [uxambly file](https://wiki.xxiivv.com/site/uxambly.html), point to a different usm file in `/projects` to assemble a different rom. |
|
34 |
+The following command will create an Uxn-compatible rom from an [uxntal file](https://wiki.xxiivv.com/site/uxntal.html), point to a different .tal file in `/projects` to assemble a different rom. |
|
35 | 35 |
|
36 | 36 |
``` |
37 |
-bin/uxnasm projects/examples/demos/life.usm bin/life.rom |
|
37 |
+bin/uxnasm projects/examples/demos/life.tal bin/life.rom |
|
38 | 38 |
``` |
39 | 39 |
|
40 | 40 |
To start the rom, point the emulator to the newly created rom: |
... | ... |
@@ -6,22 +6,22 @@ mkdir asma-test |
6 | 6 |
cd asma-test |
7 | 7 |
|
8 | 8 |
build_asma() { |
9 |
- sed -ne '/^( devices )/,/^( vectors )/p' ../projects/software/asma.usm |
|
9 |
+ sed -ne '/^( devices )/,/^( vectors )/p' ../projects/software/asma.tal |
|
10 | 10 |
cat <<EOD |
11 | 11 |
|0100 @reset |
12 | 12 |
;&source-file ;&dest-file ;asma-assemble-file JSR2 |
13 | 13 |
;asma/error LDA2 #0000 NEQ2 JMP BRK |
14 | 14 |
#0000 DIV |
15 | 15 |
|
16 |
- &source-file "in.usm 00 |
|
16 |
+ &source-file "in.tal 00 |
|
17 | 17 |
&dest-file "out.rom 00 |
18 | 18 |
|
19 | 19 |
EOD |
20 |
- sed -ne '/%asma-IF-ERROR/,$p' ../projects/software/asma.usm |
|
20 |
+ sed -ne '/%asma-IF-ERROR/,$p' ../projects/software/asma.tal |
|
21 | 21 |
} |
22 | 22 |
|
23 | 23 |
expect_failure() { |
24 |
- cat > 'in.usm' |
|
24 |
+ cat > 'in.tal' |
|
25 | 25 |
if ../bin/uxncli asma.rom > asma.log 2>/dev/null || ! grep -qF "${1}" asma.log; then |
26 | 26 |
echo "error: asma didn't report error ${1} in faulty code" |
27 | 27 |
tail asma.log |
... | ... |
@@ -30,11 +30,11 @@ expect_failure() { |
30 | 30 |
} |
31 | 31 |
|
32 | 32 |
echo 'Assembling asma with uxnasm' |
33 |
-build_asma > asma.usm |
|
34 |
-../bin/uxnasm asma.usm asma.rom > uxnasm.log |
|
35 |
-find ../projects -type f -name '*.usm' -not -name 'blank.usm' | sort | while read F; do |
|
33 |
+build_asma > asma.tal |
|
34 |
+../bin/uxnasm asma.tal asma.rom > uxnasm.log |
|
35 |
+find ../projects -type f -name '*.tal' -not -name 'blank.tal' | sort | while read F; do |
|
36 | 36 |
echo "Comparing assembly of ${F}" |
37 |
- BN="$(basename "${F%.usm}")" |
|
37 |
+ BN="$(basename "${F%.tal}")" |
|
38 | 38 |
|
39 | 39 |
if ! ../bin/uxnasm "${F}" "uxnasm-${BN}.rom" > uxnasm.log; then |
40 | 40 |
echo "error: uxnasm failed to assemble ${F}" |
... | ... |
@@ -43,7 +43,7 @@ find ../projects -type f -name '*.usm' -not -name 'blank.usm' | sort | while rea |
43 | 43 |
fi |
44 | 44 |
xxd "uxnasm-${BN}.rom" > "uxnasm-${BN}.hex" |
45 | 45 |
|
46 |
- cp "${F}" 'in.usm' |
|
46 |
+ cp "${F}" 'in.tal' |
|
47 | 47 |
if ! ../bin/uxncli asma.rom > asma.log; then |
48 | 48 |
echo "error: asma failed to assemble ${F}, while uxnasm succeeded" |
49 | 49 |
tail asma.log |
... | ... |
@@ -147,8 +147,8 @@ fmt = function(...) |
147 | 147 |
return (('\t%-11s %-10s %-12s %-14s %s '):format(...):gsub(' +$', '\n')) |
148 | 148 |
end |
149 | 149 |
do |
150 |
- local _with_0 = assert(io.open('projects/software/asma.usm.tmp', 'w')) |
|
151 |
- for l in assert(io.lines('projects/software/asma.usm')) do |
|
150 |
+ local _with_0 = assert(io.open('projects/software/asma.tal.tmp', 'w')) |
|
151 |
+ for l in assert(io.lines('projects/software/asma.tal')) do |
|
152 | 152 |
if l:match('--- cut here ---') then |
153 | 153 |
break |
154 | 154 |
end |
... | ... |
@@ -228,4 +228,4 @@ do |
228 | 228 |
]]) |
229 | 229 |
_with_0:close() |
230 | 230 |
end |
231 |
-return os.execute('mv projects/software/asma.usm.tmp projects/software/asma.usm') |
|
231 |
+return os.execute('mv projects/software/asma.tal.tmp projects/software/asma.tal') |
... | ... |
@@ -1,7 +1,7 @@ |
1 | 1 |
-- |
2 | 2 |
-- Asma tree helper script |
3 | 3 |
-- |
4 |
+-- This script updates the trees at the end of projects/software/asma.tal when |
|
4 | 5 |
-- Uxn's opcode set changes or new runes (first character of tokens) are |
5 | 6 |
-- created, so that new changes in the C assembler can be incorporated rapidly |
6 | 7 |
-- into asma. |
... | ... |
@@ -122,8 +122,8 @@ printout = true |
122 | 122 |
fmt = (...) -> |
123 | 123 |
('\t%-11s %-10s %-12s %-14s %s '\format(...)\gsub ' +$', '\n') |
124 | 124 |
|
125 |
-with assert io.open 'projects/software/asma.usm.tmp', 'w' |
|
126 |
- for l in assert io.lines 'projects/software/asma.usm' |
|
125 |
+with assert io.open 'projects/software/asma.tal.tmp', 'w' |
|
126 |
+ for l in assert io.lines 'projects/software/asma.tal' |
|
127 | 127 |
if l\match '--- cut here ---' |
128 | 128 |
break |
129 | 129 |
\write l |
... | ... |
@@ -193,5 +193,5 @@ with assert io.open 'projects/software/asma.usm.tmp', 'w' |
193 | 193 |
|
194 | 194 |
]] |
195 | 195 |
\close! |
196 |
-os.execute 'mv projects/software/asma.usm.tmp projects/software/asma.usm' |
|
196 |
+os.execute 'mv projects/software/asma.tal.tmp projects/software/asma.tal' |
|
197 | 197 |
|
... | ... |
@@ -2,11 +2,11 @@ |
2 | 2 |
--- |
3 | 3 |
# See http://www.sublimetext.com/docs/3/syntax.html |
4 | 4 |
name: Uxn Assembly |
5 |
-scopeName: usm. |
|
6 |
-fileTypes: [usm] |
|
5 |
+scopeName: tal. |
|
6 |
+fileTypes: [tal] |
|
7 | 7 |
file_extensions: |
8 |
- - usm |
|
9 |
-scope: source.usm |
|
8 |
+ - tal |
|
9 |
+scope: source.tal |
|
10 | 10 |
|
11 | 11 |
contexts: |
12 | 12 |
main: |
... | ... |
@@ -1,4 +1,4 @@ |
1 |
+-- Used for porting Uxntal code for use with the old assembler |
|
1 | 2 |
-- in commit 82f7103a55c21b13f898b20e5d1e174e501bc825 with the |
2 | 3 |
-- assembler that replaced it straight afterwards. |
3 | 4 |
|
... | ... |
@@ -93,11 +93,11 @@ translate = (_filename) -> |
93 | 93 |
f\close! |
94 | 94 |
os.exit 0 |
95 | 95 |
|
96 |
-translate 'attic/software/assembler.usm' |
|
96 |
+translate 'attic/software/assembler.tal' |
|
97 | 97 |
os.exit 0 |
98 | 98 |
|
99 |
-translate 'attic/tests/opcodes.usm' |
|
100 |
-translate 'attic/tests/basics.usm' |
|
99 |
+translate 'attic/tests/opcodes.tal' |
|
100 |
+translate 'attic/tests/basics.tal' |
|
101 | 101 |
|
102 | 102 |
-- for k, v in pairs t |
103 | 103 |
-- print k |
... | ... |
@@ -1,8 +1,8 @@ |
1 | 1 |
</$objtype/mkfile |
2 | 2 |
|
3 | 3 |
TARG=bin/uxncli bin/uxnasm bin/uxnemu |
4 |
-USM=`{walk -f projects/ | grep '\.usm$' | grep -v blank.usm} |
|
5 |
-ROM=${USM:%.usm=%.rom} |
|
4 |
+USM=`{walk -f projects/ | grep '\.tal$' | grep -v blank.tal} |
|
5 |
+ROM=${USM:%.tal=%.rom} |
|
6 | 6 |
CFLAGS=$CFLAGS -I/sys/include/npe |
7 | 7 |
HFILES=\ |
8 | 8 |
/sys/include/npe/stdio.h\ |
... | ... |
@@ -26,8 +26,8 @@ bin: |
26 | 26 |
mk install && |
27 | 27 |
rm -r npe-master |
28 | 28 |
|
29 |
-%.rom:Q: %.usm bin/uxnasm |
|
30 |
- bin/uxnasm $stem.usm $target >/dev/null |
|
29 |
+%.rom:Q: %.tal bin/uxnasm |
|
30 |
+ bin/uxnasm $stem.tal $target >/dev/null |
|
31 | 31 |
|
32 | 32 |
bin/uxncli: uxncli.$O uxn.$O |
33 | 33 |
$LD $LDFLAGS -o $target $prereq |
68 | 68 |
deleted file mode 100644 |
... | ... |
@@ -1,141 +0,0 @@ |
1 |
-( GUI Labels ) |
|
2 |
- |
|
3 |
-%RTN { JMP2r } |
|
4 |
-%2// { #01 SFT2 } |
|
5 |
-%8** { #30 SFT2 } |
|
6 |
- |
|
7 |
-( devices ) |
|
8 |
- |
|
9 |
-|00 @System [ &vector $2 &pad $6 &r $2 &g $2 &b $2 ] |
|
10 |
-|20 @Screen [ &vector $2 &width $2 &height $2 &pad $2 &x $2 &y $2 &addr $2 &color $1 ] |
|
11 |
- |
|
12 |
-( variables ) |
|
13 |
- |
|
14 |
-|0000 |
|
15 |
- |
|
16 |
-@label [ &x $2 &y $2 &color $1 &addr $2 ] |
|
17 |
-@center [ &x $2 &y $2 ] |
|
18 |
- |
|
19 |
-( program ) |
|
20 |
- |
|
21 |
-|0100 |
|
22 |
- |
|
23 |
- ( theme ) #0f0f .System/r DEO2 #0fff .System/g DEO2 #0ff0 .System/b DEO2 |
|
24 |
- |
|
25 |
- ;draw JSR2 |
|
26 |
- |
|
27 |
-BRK |
|
28 |
- |
|
29 |
-@draw ( -- ) |
|
30 |
- |
|
31 |
- ( find screen center ) |
|
32 |
- .Screen/width DEI2 2// .center/x STZ2 |
|
33 |
- .Screen/height DEI2 2// .center/y STZ2 |
|
34 |
- |
|
35 |
- ( draw ver line ) |
|
36 |
- .center/x LDZ2 .Screen/x DEO2 #0000 .Screen/y DEO2 |
|
37 |
- &draw-ver |
|
38 |
- ( draw ) #02 .Screen/color DEO |
|
39 |
- ( incr ) .Screen/y DEI2 #0002 ADD2 .Screen/y DEO2 |
|
40 |
- .Screen/y DEI2 .Screen/height DEI2 LTH2 ,&draw-ver JCN |
|
41 |
- |
|
42 |
- .center/x LDZ2 .center/y LDZ2 #0010 SUB2 #2c ;text1 ;draw-label-left JSR2 |
|
43 |
- .center/x LDZ2 .center/y LDZ2 #2c ;text2 ;draw-label-middle JSR2 |
|
44 |
- .center/x LDZ2 .center/y LDZ2 #0010 ADD2 #2c ;text3 ;draw-label-right JSR2 |
|
45 |
- .center/x LDZ2 .center/y LDZ2 #0020 ADD2 #2c ;text4 ;draw-label-middle JSR2 |
|
46 |
- .center/x LDZ2 .center/y LDZ2 #0030 ADD2 #2c ;text5 ;draw-label-middle JSR2 |
|
47 |
- |
|
48 |
-RTN |
|
49 |
- |
|
50 |
-@draw-label-left ( x y color addr -- ) |
|
51 |
- |
|
52 |
- ( load ) .label/addr STZ2 .label/color STZ .Screen/y DEO2 .Screen/x DEO2 |
|
53 |
- .label/addr LDZ2 |
|
54 |
- &loop |
|
55 |
- ( draw ) DUP2 LDA #00 SWP 8** ;font ADD2 .Screen/addr DEO2 .label/color LDZ .Screen/color DEO |
|
56 |
- ( incr ) #0001 ADD2 |
|
57 |
- ( incr ) .Screen/x DEI2 #0008 ADD2 .Screen/x DEO2 |
|
58 |
- DUP2 LDA ,&loop JCN |
|
59 |
- POP2 |
|
60 |
- |
|
61 |
-RTN |
|
62 |
- |
|
63 |
-@draw-label-middle ( x y color addr -- ) |
|
64 |
- |
|
65 |
- ( load ) .label/addr STZ2 .label/color STZ .Screen/y DEO2 |
|
66 |
- ( align ) .label/addr LDZ2 ;get-text-length JSR2 8** 2// SUB2 .Screen/x DEO2 |
|
67 |
- .label/addr LDZ2 |
|
68 |
- &loop |
|
69 |
- ( draw ) DUP2 LDA #00 SWP 8** ;font ADD2 .Screen/addr DEO2 .label/color LDZ .Screen/color DEO |
|
70 |
- ( incr ) #0001 ADD2 |
|
71 |
- ( incr ) .Screen/x DEI2 #0008 ADD2 .Screen/x DEO2 |
|
72 |
- DUP2 LDA ,&loop JCN |
|
73 |
- POP2 |
|
74 |
- |
|
75 |
-RTN |
|
76 |
- |
|
77 |
-@draw-label-right ( x y color addr -- ) |
|
78 |
- |
|
79 |
- ( load ) .label/addr STZ2 .label/color STZ .Screen/y DEO2 |
|
80 |
- ( align ) .label/addr LDZ2 ;get-text-length JSR2 8** SUB2 .Screen/x DEO2 |
|
81 |
- .label/addr LDZ2 |
|
82 |
- &loop |
|
83 |
- ( draw ) DUP2 LDA #00 SWP 8** ;font ADD2 .Screen/addr DEO2 .label/color LDZ .Screen/color DEO |
|
84 |
- ( incr ) #0001 ADD2 |
|
85 |
- ( incr ) .Screen/x DEI2 #0008 ADD2 .Screen/x DEO2 |
|
86 |
- DUP2 LDA ,&loop JCN |
|
87 |
- POP2 |
|
88 |
- |
|
89 |
-RTN |
|
90 |
- |
|
91 |
-@get-text-length ( label* -- length ) |
|
92 |
- |
|
93 |
- #0000 ( counter ) |
|
94 |
- &loop |
|
95 |
- ( incr ) #0001 ADD2 OVR2 OVR2 ADD2 |
|
96 |
- LDA ,&loop JCN |
|
97 |
- SWP2 POP2 |
|
98 |
- |
|
99 |
-RTN |
|
100 |
- |
|
101 |
-@font ( spectrum-zx font ) |
|
102 |
-[ |
|
103 |
- 0000 0000 0000 0000 0000 2400 7e3c 0000 0000 2400 3c42 0000 0000 6c7c 7c38 1000 |
|
104 |
- 0010 387c 7c38 1000 0038 387c 6c10 3800 0010 387c 7c10 3800 0000 0018 1800 0000 |
|
105 |
- 007e 4242 4242 7e00 0000 1824 2418 0000 0018 2442 4224 1800 001e 063a 4a48 3000 |
|
106 |
- 0038 446c 107c 1000 000c 0808 0838 3800 003e 2222 2266 6600 0000 0822 0022 0800 |
|
107 |
- 0000 1018 1c18 1000 0000 0818 3818 0800 0008 1c00 001c 0800 0028 2828 2800 2800 |
|
108 |
- 003e 4a4a 3a0a 0a00 000c 3046 620c 3000 0000 0000 0000 ffff 0010 3800 3810 0038 |
|
109 |
- 0008 1c2a 0808 0800 0008 0808 2a1c 0800 0000 0804 7e04 0800 0000 1020 7e20 1000 |
|
110 |
- 0000 4040 7e00 0000 0000 0024 6624 0000 0000 1038 7c00 0000 0000 007c 3810 0000 |
|
111 |
- 0000 0000 0000 0000 0008 0808 0800 0800 0014 1400 0000 0000 0024 7e24 247e 2400 |
|
112 |
- 0008 1e28 1c0a 3c08 0042 0408 1020 4200 0030 4832 4c44 3a00 0008 1000 0000 0000 |
|
113 |
- 0004 0808 0808 0400 0010 0808 0808 1000 0000 1408 3e08 1400 0000 0808 3e08 0800 |
|
114 |
- 0000 0000 0008 0810 0000 0000 3c00 0000 0000 0000 0000 0800 0000 0204 0810 2000 |
|
115 |
- 003c 464a 5262 3c00 0018 2808 0808 3e00 003c 4202 3c40 7e00 003c 421c 0242 3c00 |
|
116 |
- 0008 1828 487e 0800 007e 407c 0242 3c00 003c 407c 4242 3c00 007e 0204 0810 1000 |
|
117 |
- 003c 423c 4242 3c00 003c 4242 3e02 3c00 0000 0008 0000 0800 0000 0800 0008 0810 |
|
118 |
- 0000 0810 2010 0800 0000 003e 003e 0000 0000 1008 0408 1000 003c 4202 0c00 0800 |
|
119 |
- 003c 425a 5442 3c00 0018 2442 7e42 4200 007c 427c 4242 7c00 003c 4240 4042 3c00 |
|
120 |
- 0078 4442 4244 7800 007e 407c 4040 7e00 003e 4040 7c40 4000 003c 4240 4e42 3c00 |
|
121 |
- 0042 427e 4242 4200 003e 0808 0808 3e00 0002 0202 4242 3c00 0044 4870 4844 4200 |
|
122 |
- 0040 4040 4040 7e00 0042 665a 4242 4200 0042 6252 4a46 4200 003c 4242 4242 3c00 |
|
123 |
- 007c 4242 7c40 4000 003c 4242 524a 3c00 007c 4242 7c44 4200 003c 403c 0242 3c00 |
|
124 |
- 00fe 1010 1010 1000 0042 4242 4242 3c00 0042 4242 4224 1800 0042 4242 5a66 4200 |
|
125 |
- 0042 2418 1824 4200 0082 4428 1010 1000 007e 0408 1020 7e00 000c 0808 0808 0c00 |
|
126 |
- 0040 2010 0804 0200 0018 0808 0808 1800 0008 1422 0000 0000 0000 0000 0000 7e00 |
|
127 |
- 0008 0400 0000 0000 0000 1c02 1e22 1e00 0020 203c 2222 3c00 0000 1e20 2020 1e00 |
|
128 |
- 0002 021e 2222 1e00 0000 1c22 3c20 1e00 000c 101c 1010 1000 0000 1c22 221e 021c |
|
129 |
- 0020 202c 3222 2200 0008 0018 0808 0400 0008 0008 0808 4830 0020 2428 3028 2400 |
|
130 |
- 0010 1010 1010 0c00 0000 6854 5454 5400 0000 5864 4444 4400 0000 3844 4444 3800 |
|
131 |
- 0000 7844 4478 4040 0000 3c44 443c 0406 0000 2c30 2020 2000 0000 3840 3804 7800 |
|
132 |
- 0010 103c 1010 0c00 0000 4444 4444 3800 0000 4444 2828 1000 0000 4454 5454 2800 |
|
133 |
- 0000 4428 1028 4400 0000 4444 443c 0438 0000 7c08 1020 7c00 000c 0810 1008 0c00 |
|
134 |
- 0008 0808 0808 0800 0030 1008 0810 3000 0000 0032 4c00 0000 3c42 99a1 a199 423c |
|
135 |
-] |
|
136 |
- |
|
137 |
-@text1 [ "Left 20 "Aligned 00 ] |
|
138 |
-@text2 [ "Middle 20 "Aligned 00 ] |
|
139 |
-@text3 [ "Right 20 "Aligned 00 ] |
|
140 |
-@text4 [ "even 00 ] |
|
141 |
-@text5 [ "odd 00 ] |
|
142 | 0 |
\ No newline at end of file |
155 | 13 |
similarity index 99% |
156 | 14 |
rename from projects/software/asma.usm |
157 | 15 |
rename to projects/software/asma.tal |
... | ... |
@@ -22,7 +22,7 @@ |
22 | 22 |
( |
23 | 23 |
Assemble the source code into an output ROM file. |
24 | 24 |
|
25 |
- If all you want is to use asma.usm to assemble files, insert a BRK |
|
25 |
+ If all you want is to use asma.tal to assemble files, insert a BRK |
|
26 | 26 |
after this statement. |
27 | 27 |
) |
28 | 28 |
;&source-file ;&dest-file ;asma-assemble-file JSR2 |
... | ... |
@@ -60,7 +60,7 @@ |
60 | 60 |
#00ff JMP2 |
61 | 61 |
|
62 | 62 |
&source-file |
63 |
- "projects/demos/piano.usm 00 |
|
63 |
+ "projects/demos/piano.tal 00 |
|
64 | 64 |
&dest-file |
65 | 65 |
"bin/asma-boot.rom 00 |
66 | 66 |
|