preparing v7.6

This commit is contained in:
Irmen de Jong 2022-01-03 23:38:41 +01:00
parent 3ae07503f2
commit c57ef7725e
5 changed files with 44 additions and 20 deletions

View File

@ -1 +1 @@
7.6-dev
7.6

View File

@ -185,7 +185,7 @@ using the ``-emu`` or ``-emu2`` command line options)
For this to work you should make sure that the program is not using floating point, nor the ram/rom bank switching logic provided by the libraries.
You can also choose to just stick with Prog8 6.4 (which still targets cx16 v38) and wait it out till
the emulator r39 is officially released - but you won't be able to benefit from the compiler improvements
made since the previous release of prog8.
made since that old release of prog8.

View File

@ -481,6 +481,12 @@ logical: ``not`` ``and`` ``or`` ``xor``
about truths (boolean values). The result of such an expression is a 'boolean' value 'true' or 'false'
(which in reality is just a byte value of 1 or 0).
.. note::
Unlike most other programming languages, there is no short-cirquit or McCarthy-evaluation
for the ``and`` and ``or`` operators at this time. This means that prog8 currently always evaluates
all operands from these logical expressions, even when one of them already determines the outcome.
This may be changed in a future language version.
range creation: ``to``
Creates a range of values from the LHS value to the RHS value, inclusive.
These are mainly used in for loops to set the loop range. Example::

View File

@ -1,9 +1,9 @@
TODO
====
For next compiler release (7.6)
For next compiler release (7.7)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
...
...tbd
Need help with
@ -19,9 +19,9 @@ Blocked by an official Commander-x16 r39 release
(I hope this will be included into the r39 roms when they get released)
Future
^^^^^^
- add pipe operator ``|>`` ?
Future Things and Ideas
^^^^^^^^^^^^^^^^^^^^^^^
- pipe operator ``|>``
- make it possible to use cpu opcodes such as 'nop' as variable names by prefixing all asm vars with something such as ``v_``
then we can get rid of the instruction lists in the machinedefinitions as well?
- fix the asm-labels problem (github issue #62)
@ -29,7 +29,7 @@ Future
but this requires all identifiers in the inlined expression to be changed to fully scoped names
- simplifyConditionalExpression() should not split expression if it still results in stack-based evaluation
- simplifyConditionalExpression() sometimes introduces needless assignment to r9 tempvar
- get rid of all TODO's in the code
- consider adding McCarthy evaluation to shortcircuit and and or expressions. First do ifs by splitting them up? Then do expressions that compute a value?
- improve testability further, add more tests
- use more of Result<> and Either<> to handle errors/ nulls better
- rethink the whole "isAugmentable" business. Because the way this is determined, should always also be exactly mirrorred in the AugmentableAssignmentAsmGen or you'll get a crash at code gen time.
@ -41,18 +41,20 @@ Future
- add a diskio.f_seek() routine for the Cx16 that uses its seek dos api?
- make it possible for diskio to read and write from more than one file at the same time (= use multiple io channels)?
- fix problems in c128 target
- add (u)word array type (or modifier?) that puts the array into memory as 2 separate byte-arrays 1 for LSB 1 for MSB -> allows for word arrays of length 256
- [problematic due to 64tass:] add a compiler option to not remove unused subroutines. this allows for building library programs. But this won't work with 64tass's .proc ...
Perhaps replace all uses of .proc/.pend by .block/.bend will fix that?
(but we lose the optimizing aspect of the assembler where it strips out unused code.
There's not really a dynamic switch possible as all assembly lib code is static and uses one or the other)
- get rid of all TODO's in the code ;)
More code optimization ideas
^^^^^^^^^^^^^^^^^^^^^^^^^^^^
More optimization ideas
^^^^^^^^^^^^^^^^^^^^^^^
- if a for loop's loopvariable isn't referenced in the body, replace by a repeatloop
- automatically convert if statements that test for multiple values (if X==1 or X==2..) to if X in [1,2,..] statements, instead of just a warning
- byte typed expressions should be evaluated in the accumulator where possible, without (temp)var
for instance value = otherbyte >> 1 --> lda otherbite ; lsr a; sta value
for instance value = otherbyte >> 1 --> lda otherbite ; lsr a; sta value
- rewrite expression tree evaluation such that it doesn't use an eval stack but flatten the tree into linear code that uses a fixed number of predetermined value 'variables'
- this removes the need for the BinExprSplitter? (which is problematic and very limited now)
- introduce byte-index operator to avoid index multiplications in loops over arrays? see github issue #4

View File

@ -1,17 +1,33 @@
%import textio
%import floats
%zeropage basicsafe
main {
uword buffer = memory("the quick brown fox jumps over the lazy dog", 2000)
uword buffer2 = memory("the quick brown fox jumps over the lazy dog", 2000)
sub start() {
txt.print_uwhex(buffer, true)
txt.print_uwhex(buffer2, true)
txt.print_uwhex("zzzz", true)
str xyz = "irmen"
xyz="2342344234"
txt.print_uwhex(xyz, true)
%asm {{
lda #<float5_111
ldy #>float5_111
jsr floats.MOVFM
lda #<float5_122
ldy #>float5_122
jsr floats.FADD
jsr floats.FOUT
sta $7e
sty $7f
ldy #0
_loop
lda ($7e),y
beq _done
jsr c64.CHROUT
iny
bne _loop
_done
rts
float5_111 .byte $81, $0e, $14, $7a, $e1 ; float 1.11
float5_122 .byte $81, $1c, $28, $f5, $c2 ; float 1.22
}}
}
}