1
0
mirror of https://github.com/catseye/SixtyPical.git synced 2024-06-06 15:29:30 +00:00
SixtyPical/TODO.md

97 lines
3.5 KiB
Markdown
Raw Normal View History

2018-08-26 13:35:28 +00:00
TODO for SixtyPical
===================
### Save values to other-than-the-stack
Allow
save a to temp_a {
...
}
Which uses some other storage location instead of the stack. A local static
would be a good candidate for such.
### Analyze `call` within blocks?
2018-08-26 13:35:28 +00:00
What happens if you call another routine from inside a `with interrupts off` block?
2018-08-26 13:35:28 +00:00
What happens if you call another routine from inside a `save` block?
2018-08-26 13:35:28 +00:00
What happens if you call another routine from inside a `point into` block?
2018-08-26 13:35:28 +00:00
What happens if you call another routine from inside a `for` block?
2018-08-26 13:35:28 +00:00
Remember that any of these may have a `goto` ... and they may have a second
instance of the same block (e.g. `with interrupts off` nested within
`with interrupts off` shouldn't be allowed to turn them back on after the
inner block has finished -- even if there is no `call`.)
2018-08-26 13:35:28 +00:00
These holes need to be plugged.
2018-08-26 13:35:28 +00:00
### Pointers associated globally with a table(?)
2018-08-26 13:35:28 +00:00
We have `point into` blocks, but we would also like to sometimes pass a pointer
around to different routines, and have them all "know" what table it operates on.
2018-08-26 13:35:28 +00:00
We could associate every pointer variable with a specific table variable, in its
declaration. This makes some things simple, and would allow us to know what table a
pointer is supposed to point into, even if that pointer was passed into our routine.
2018-08-26 13:35:28 +00:00
One drawback is that it would limit each pointer to be used only on one table. Since a
pointer basically represents a zero-page location, and since those are a relatively scarce
resource, we would prefer if a single pointer could be used to point into different tables
at different times.
2018-08-26 13:35:28 +00:00
These can co-exist with general, non-specific-table-linked `pointer` variables.
### Space optimization of local non-statics
If there are two routines A and B, and A never calls B (even indirectly), and
B never calls A (even indirectly), then their non-static locals can
be allocated at the same space.
This is more an impressive trick than a really useful feature, but still.
Impressive tricks are impressive.
### Copy byte to/from table
Do we want a `copy bytevar, table + x` instruction? We don't currently have one.
You have to `ld a`, `st a`. I think maybe we should have one.
2018-08-26 13:35:28 +00:00
### Analyze memory usage
If you define two variables that occupy the same address, an analysis error ought
to be raised. (But there should also be a way to annotate this as intentional.
Intentionally making two tables overlap could be valuable. However, the analysis
will probably completely miss this fact.)
### Character literals
For goodness sake, let the programmer say `'A'` instead of `65`.
### Character set mapping
Not all computers think `'A'` should be `65`. Allow the character set to be
mapped. Probably copy what Ophis does.
2018-08-26 13:35:28 +00:00
### Tail-call optimization
2018-09-07 16:47:59 +00:00
If a block ends in a `call` can that be converted to end in a `goto`? Why not? I think it can,
if the block is in tail position. The constraints should iron out the same both ways.
2018-08-26 13:35:28 +00:00
As long as the routine has consistent type context every place it exits, that should be fine.
### "Include" directives
Search a searchlist of include paths. And use them to make libraries of routines.
One such library routine might be an `interrupt routine` type for various architectures.
Since "the supervisor" has stored values on the stack, we should be able to trash them
with impunity, in such a routine.
2018-09-07 16:47:59 +00:00
### Line numbers in analysis error messages
For analysis errors, there is a line number, but it's the line of the routine
after the routine in which the analysis error occurred. Fix this.