-
Notifications
You must be signed in to change notification settings - Fork 54
/
TODO.txt
228 lines (172 loc) · 11.7 KB
/
TODO.txt
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
scratch area + TODO keeper for sjasmplus developers:
====================================================
====================
Ped:
Cirrus-CI .cirrus.yml:
- name: coveralls.io coverage report (linux gcc6):
GCC14 still doesn't have as perfect coverage report as GCC6 (versions between I tried were also imperfect),
so for the moment I will stick with 14 and see how it will go, but update probably ASAP and keep tracking coverge results.
- name: MacOS default CC build (with unit tests):
I still get warning message "Only ghcr.io/cirruslabs/macos-runner:sonoma is allowed. Automatically upgraded."
even with "macos-sonoma-base" image which seems to exist -> not sure what is happening.
There will be sequoia probably soon, so switch to that later and re-check.
macos: plenty of "deprecated" warnings (`sprintf` for example)
warning: 'sprintf' is deprecated: This function is provided for compatibility reasons only. Due to security concerns inherent in the design of sprintf(3), it is highly recommended that you use snprintf(3) instead
check for Z80 in/out having also [] brackets and syntax brackets-only mode? (currently only `(c)` and `(n)` works)
ARM! https://cirrus-ci.org/guide/linux/
> Cirrus CI supports container and arm_container instances in order to run your CI workloads on amd64 and arm64 platforms respectively.
-------------
can you add a --utc option to sjasmplus so that I don't have to change my hardware time if I want __DATE__ to use UTC.
I want UTC time zone for release dates, not local time zone?
sjasm.cpp:687
auto now = std::chrono::system_clock::now();
std::time_t now_c = std::chrono::system_clock::to_time_t(now);
std::tm now_tm = *std::localtime(&now_c); // ??? this ???
time.h:
/* Return the `struct tm' representation of *TIMER
in Universal Coordinated Time (aka Greenwich Mean Time). */
extern struct tm *gmtime (const time_t *__timer) __THROW;
/* Return the `struct tm' representation
of *TIMER in the local timezone. */
extern struct tm *localtime (const time_t *__timer) __THROW;
-------------
https://www.codefactor.io/repository/github/z00m128/sjasmplus
coverage keeps fluctuating because of io_nex.cpp `SNexFile::~SNexFile()`, probably depends on compiler's exact version and mood???
-> it's global `static SNexFile nex;` -> add maybe unit test instancing it as local variable to enforce exercising destructor?
(not so simple, as unit test doesn't know the struct definition and it's private to io_nex.cpp)
APPENDBIN to append any-size binary to other file, like for producing large dot files with data files appended
(and let's do GiB+ support as well, INCBIN is limited to 2GiB by `int32` for length and does read it all into heap memory)
baze — Today at 22:22
@neon Even if you keep paging outs in machine code, it's a good idea to keep LOAD in BASIC. My suggestion would be to use set 4,(iy + 1) so that +3 BASIC doesn't corrupt page 7 during IM 1. Then, for every out (c),a you also do ld (#5B5C),a to keep 128 BASIC happy. I think that should work with 48K BASIC, 128K BASIC and +3 BASIC.
errors: add new CLI option for the "emitted/included at/from" messages,
keeping the assembler more silent in msg=war|err mode
listing with pre-substituted original source line included
catch list: DUP -> EDUP, `nop:nop:nop`, ...
output: maybe `<` like macros have `>`? and missing address, only line number?
relocation -> extra support for Next driver banks?
(see Robin's https://github.com/Threetwosevensixseven/ZXRelocate to learn what exactly that means)
(also https://github.com/Threetwosevensixseven/JetDPCL5/tree/main/src/asm/drv )
(also https://pastebin.com/4G5nf9qv )
check https://github.com/google/AFL
add block/reserve which does really preserve the device memory content (currently only the
structure block+align does preserve memory, and standalone ALIGN, but not DS/BLOCK)
"emitted from here" error should maybe show original line, as people not using error parsing
claim it's confusing/useless.
-> turned out to be lot more difficult than expected (macros + lua inlining)
parser.cpp ParseExpShift and other "needa" doing transformations (shr => '>' ???)
- write tests trying those "while" loops for groups of operators
- write tests testing operator precedence
CSPECTMAP - needs better support for DISP
- also reported to be not as good as external tool, but seems that is due to not-using DEVICE directive by author
(can't help that)
--syntax: "I" to uppercase all labels + usage (needs labels refactoring)
--syntax: L options implementation
add DOCS example test: "hl: Ld a,(hl),,de,hl" when all is implemented
static analysis: PVS-Studio https://www.viva64.com/en/m/0036/
* https://scan.coverity.com/projects/z00m128-sjasmplus
(needs build according to their tool or Travis CI)
FIXME: get rid of ParseDirective_REPT somehow, its existence can't be right
(breaks ` .34 repeatX` directive probably? .. and END@beginningOfLine? .. actually not?)
I almost certainly broke some STRCPY/STRCAT max-size limits (i.e. malicious source may buffer overflow)...
Macro world issues:
- macros for operators? (in ideal case `zeuskeyaddr` possible to recreate in macro?)
- more operators, capable of some string manipulation and maybe some type/expression checks (islabel)
SAVEHOB/SAVETRD/SAVETAP/... global review of filename handling, adding warnings/errors
where filename modification happens or filename is invalid.
** Macro/define substitution rules and implementation (proposal):
- macro arguments substitute with priority, from the longest ones
- macro arguments substitute even in define related directives
- define arguments substitute next, from the longest ones (inc. defarray)
- name of define/macroarg starting with underscore prohibits substitution into middle
(can substitute only at beginning)
? extend that rule to underscore at end sealing also the tail?
- lock some keywords for define/etc... at least put them under warning
- inhibitor of substitutions happening (like `@djnz` inhibits macro replacement).
** Current refactored implementation:
- doesn't play priorities as proposed above
- needs lot more testing and cleanup
+ should be already a bit more intuitive than 1.08+ (although it may break legacy source)
DISP inside DISP bugs => documented. Correct solution = nesting DISPs?!
$$label operator to get label page. (and fix pages for defl/equ/expression/... labels)
^^ done, also whole label parsing and validation refactored, the syntax "$$label" is winner
^^ TODO: remove this note maybe after some time, when everything will prove to be stable
//// syntax summary:
labels (\.|@|)[A-Za-z_][A-Za-z0-9_.?!#@]*
, argument-separator : instruction-separator ; // comment
# $ hexnums, % binary, "' strings, () parentheses or memcell, [] memcell, {} device mem
operators-unary: ! ~ + - low high not
operators-binary: * / % mod + - << >> >>> shl shr <? >? < > <= >= = == != & and ^ xor | or && ||
us keyboard: ~!@#$%^&*()_+`-=[]{};':"<>?,./\|
$$label - hexa are single $ only, so this looks fine (unary operator)
?label - 5<?label => ambiguous (there is already unary "?" for labels, undocummented, deprecated)
\label - looks weird, no syntax clash
Needs more syntax:
- reformat label into different slot... <slot>$$expression ? (binary operator)
- differentiate 16+b address space from 16b slot-mapped address space.
&label/expression? Similar to C/C++? &0x1231241 ? (5123 + &1234)
MMU:
- custom pages order for wrap-next-mapping option (like "<3, 5, 1, 2>" ?)
- err/warn/warp option for slot range?
* maybe create extra syntax rules for listing files? (especially if it's possible to include asm syntax for half of line)
##### sjasmplus 2.x/fork:
SHELLEXEC change syntax
separate local-labels vs macro-local-labels, like giving the macros new prefix? ">"?
(issue #120)
Operators precedence: (2 == 3&2) = ((2 == 3)&2) = false in current sjasmplus... ????
https://en.cppreference.com/w/cpp/language/operator_precedence
Operator "word" or "w16/i16" to truncate big value (similar to "low")
address space of labels -> 2|3:30|29 bits, the top bits being default slot number,
remaining bits being physical address into global chip address space
-> then producing machine code using the particular label would "format" physical
label value for particular "slot" (view of value).
To stay backward compatible/similar, one would have to support also 0000-FFFF range as if
going through the mapped pages.. but that does collide with early pages 0..n ...
How about abusing "@" or "." or something to distinguish between? (& resembles C/C++!)
Make --syntax=abflL default for v2.x and check other defaults
Maybe add support for escaped '\'' and other combinations back, to be more C++ compatible
(escape sequences in C/C++ are case sensitive => adopt to sjasmplus (insensitive currently))
Check about other syntax ambiguities, what seems too much relaxed and could be stricter for v2.x
N-pass
js support?
====================
Debian packaging:
cmake used to enforce (and test) system libs:
cmake -DCMAKE_BUILD_TYPE=Release -DSYSTEM_LUA=ON -DCMAKE_INSTALL_PREFIX:PATH=~/.local2/ ..
https://www.debian.org/doc/manuals/distribute-deb/distribute-deb.html
https://wiki.debian.org/Packaging/Learn#Level_3:_Packaging_more_complicated_modules
Next step is packaging more complicated modules that will involve things like, modifying some upstream files,
!!!!!!!!!!!! removing some files from source tarball, !!!!!!!!!!!!
generating some files from source, getting the source tarball from a git commit etc.
So maybe there is a way to provide "OSS" sjasmplus src tar for .deb build from full repo (removing some files in tests which don't fit OSS licensing)
====================
Docs:
DEVICE needs better description? Issue #55
... and also SAVENEX and default ZXNEXT device... again...
When printed into PDF from browser on my local system, some of the program listings don't
fit into their box and the end of line is cut out, check how many chars work and review
all code listings in docs to fit into default A4 pdf print.
(already changelog is trimmed ... seems like 88 chars is max, 80 is probably reasonable)
Add chapter about usefult test-examples (library-like functions), like INC_TEXT, etc.
===== github milestone v2.x: => create issues (cleanup this TODO as much as reasonable)
v2.x of sjasmplus, changing some default settings (making it mildly incompatible with old sources, considerably more than v1.07 vs v1.14 incompatibilities), and refactoring some implementation even further, to make it hopefully a bit cleaner C++ source, simpler to maintain and modify.
Major changes on my mind:
* n-pass assembling
* syntax by default similar to `--syntax=abflL`
* GNU/GCC/clang-ification of assembler, mimicking the general tools as much as possible, like formatting of error reports, options with identical syntax where it makes sense, etc.. (should help with other tools unaware of sjasmplus specifically, but capable to process gcc/clang stuff)
* GCC include path rules (anchoring from launch dir or main file dir, not changing anchor with each source file)
* `define` substitution formalized even more (and refactored)
* C++ification of syntax and language, i.e. changing operator precedence, probably apostrophe enclosed string/char literals escaping rules, etc.
* new operators (string and device-memory/labels related, type/checks, maybe var-arg-like stuff)
* macro-defined-operators (not only "instructions")
* nesting DISPs?
* better support for Maziac's tools (label type export, whatever else is needed)
* maybe also JavaScript scripting support
* filepath stuff through POSIX/clib API to make it cross-platform without hacks (normal slashes everywhere)
RELEASE spam:
Next wiki assemblers
Next discord
Twitter
zx-pk.ru forum
Next FB
(maybe once per year or two: next forum, linkedin)
-- also update .exe/docker in tests/misc