prog8/docs/source/todo.rst

155 lines
4.2 KiB
ReStructuredText
Raw Normal View History

2018-08-06 01:35:43 +00:00
====
TODO
====
IF_XX::
if[_XX] [<expression>] {
...
}
[ else {
... ; evaluated when the condition is not met
} ]
==> DESUGARING ==>
(no else:)::
2018-09-15 14:21:05 +00:00
if[_!XX] [<expression>] goto prog8_if_999_end ; !XX being the conditional inverse of XX
2018-08-06 01:35:43 +00:00
.... (true part)
2018-09-15 14:21:05 +00:00
prog8_if_999_end ; code continues after this
2018-08-06 01:35:43 +00:00
(with else)::
2018-09-15 14:21:05 +00:00
if[_XX] [<expression>] goto prog8_if_999
2018-08-06 01:35:43 +00:00
... (else part)
2018-09-15 14:21:05 +00:00
goto prog8_if_999_end
prog8_if_999 ... (true part)
prog8_if_999_end ; code continues after this
2018-08-06 01:35:43 +00:00
IF X <COMPARISON> Y
==> DESUGARING ==>::
compare X, Y
if_XX goto ....
XX based on <COMPARISON>.
While::
while[_XX] <expression> {
...
continue
break
}
==> DESUGARING ==>::
2018-09-15 14:21:05 +00:00
goto prog8_while_999_check ; jump to the check
prog8_while_999
2018-08-06 01:35:43 +00:00
... (code)
2018-09-15 14:21:05 +00:00
goto prog8_while_999 ;continue
goto prog8_while_999_end ;break
prog8_while_999_check
if[_XX] <expression> goto prog8_while_999 ; loop condition
prog8_while_999_end ; code continues after this
2018-08-06 01:35:43 +00:00
Repeat::
repeat {
...
continue
break
} until[_XX] <expressoin>
==> DESUGARING ==>::
2018-09-15 14:21:05 +00:00
prog8_repeat_999
2018-08-06 01:35:43 +00:00
... (code)
2018-09-15 14:21:05 +00:00
goto prog8_repeat_999 ;continue
goto prog8_repeat_999_end ;break
if[_!XX] <expression> goto prog8_repeat_999 ; loop condition via conditional inverse of XX
prog8_repeat_999_end ; code continues after this
2018-08-06 01:35:43 +00:00
For::
for <loopvar> = <from_expression> to <to_expression> [step <step_expression>] {
...
break
continue
}
@todo how to do signed integer loopvars?
==> DESUGARING ==>::
loopvar = <from_expression>
compare loopvar, <to_expression>
2018-09-15 14:21:05 +00:00
if_ge goto prog8_for_999_end ; loop condition
2018-08-06 01:35:43 +00:00
step = <step_expression> ; (store only if step < -1 or step > 1)
2018-09-15 14:21:05 +00:00
prog8_for_999
goto prog8_for_999_end ;break
goto prog8_for_999_loop ;continue
2018-08-06 01:35:43 +00:00
.... (code)
2018-09-15 14:21:05 +00:00
prog8_for_999_loop
2018-08-06 01:35:43 +00:00
loopvar += step ; (if step > 1 or step < -1)
loopvar++ ; (if step == 1)
loopvar-- ; (if step == -1)
2018-09-15 14:21:05 +00:00
goto prog8_for_999 ; continue the loop
prog8_for_999_end ; code continues after this
2018-08-06 01:35:43 +00:00
### Macros
@todo macros are meta-code that is executed by the compiler, in a preprecessing step
during the compilation, and can produce output that is then replaced on that point in the input source.
Allows us to create pre calculated sine tables and such.
2018-08-06 01:35:43 +00:00
Memory Block Operations
^^^^^^^^^^^^^^^^^^^^^^^
@todo matrix,list,string memory block operations:
- matrix type operations (whole matrix, per row, per column, individual row/column)
operations: set, get, copy (from another matrix with the same dimensions, or list with same length),
shift-N (up, down, left, right, and diagonals, meant for scrolling)
rotate-N (up, down, left, right, and diagonals, meant for scrolling)
clear (set whole matrix to the given value, default 0)
- list operations (whole list, individual element)
operations: set, get, copy (from another list with the same length), shift-N(left,right), rotate-N(left,right)
clear (set whole list to the given value, default 0)
- list and matrix operations ofcourse work identical on vars and on memory mapped vars of these types.
- strings: identical operations as on lists.
- matrix with row-interleave can only be a memory mapped variable and can be used to directly
access a rectangular area within another piece of memory - such as a rectangle on the (character) screen
these should call (or emit inline) optimized pieces of assembly code, so they run as fast as possible
Bitmap Definition (for Sprites and Characters)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
to define CHARACTERS (8x8 monochrome or 4x8 multicolor = 8 bytes)
--> PLACE in memory on correct address (???k aligned)
and SPRITES (24x21 monochrome or 12x21 multicolor = 63 bytes)
--> PLACE in memory on correct address (base+sprite pointer, 64-byte aligned)