Skip to content

Commit c57ef77

Browse files
committed
preparing v7.6
1 parent 3ae0750 commit c57ef77

File tree

5 files changed

+44
-20
lines changed

5 files changed

+44
-20
lines changed

compiler/res/version.txt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
7.6-dev
1+
7.6

docs/source/index.rst

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -185,7 +185,7 @@ using the ``-emu`` or ``-emu2`` command line options)
185185
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.
186186
You can also choose to just stick with Prog8 6.4 (which still targets cx16 v38) and wait it out till
187187
the emulator r39 is officially released - but you won't be able to benefit from the compiler improvements
188-
made since the previous release of prog8.
188+
made since that old release of prog8.
189189

190190

191191

docs/source/syntaxreference.rst

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -481,6 +481,12 @@ logical: ``not`` ``and`` ``or`` ``xor``
481481
about truths (boolean values). The result of such an expression is a 'boolean' value 'true' or 'false'
482482
(which in reality is just a byte value of 1 or 0).
483483

484+
.. note::
485+
Unlike most other programming languages, there is no short-cirquit or McCarthy-evaluation
486+
for the ``and`` and ``or`` operators at this time. This means that prog8 currently always evaluates
487+
all operands from these logical expressions, even when one of them already determines the outcome.
488+
This may be changed in a future language version.
489+
484490
range creation: ``to``
485491
Creates a range of values from the LHS value to the RHS value, inclusive.
486492
These are mainly used in for loops to set the loop range. Example::

docs/source/todo.rst

Lines changed: 11 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,9 @@
11
TODO
22
====
33

4-
For next compiler release (7.6)
4+
For next compiler release (7.7)
55
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
6-
...
6+
...tbd
77

88

99
Need help with
@@ -19,17 +19,17 @@ Blocked by an official Commander-x16 r39 release
1919
(I hope this will be included into the r39 roms when they get released)
2020

2121

22-
Future
23-
^^^^^^
24-
- add pipe operator ``|>`` ?
22+
Future Things and Ideas
23+
^^^^^^^^^^^^^^^^^^^^^^^
24+
- pipe operator ``|>``
2525
- make it possible to use cpu opcodes such as 'nop' as variable names by prefixing all asm vars with something such as ``v_``
2626
then we can get rid of the instruction lists in the machinedefinitions as well?
2727
- fix the asm-labels problem (github issue #62)
2828
- make it possible to inline non-asmsub routines that just contain a single statement (return, functioncall, assignment)
2929
but this requires all identifiers in the inlined expression to be changed to fully scoped names
3030
- simplifyConditionalExpression() should not split expression if it still results in stack-based evaluation
3131
- simplifyConditionalExpression() sometimes introduces needless assignment to r9 tempvar
32-
- get rid of all TODO's in the code
32+
- consider adding McCarthy evaluation to shortcircuit and and or expressions. First do ifs by splitting them up? Then do expressions that compute a value?
3333
- improve testability further, add more tests
3434
- use more of Result<> and Either<> to handle errors/ nulls better
3535
- 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
4141
- add a diskio.f_seek() routine for the Cx16 that uses its seek dos api?
4242
- make it possible for diskio to read and write from more than one file at the same time (= use multiple io channels)?
4343
- fix problems in c128 target
44+
- 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
4445
- [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 ...
4546
Perhaps replace all uses of .proc/.pend by .block/.bend will fix that?
4647
(but we lose the optimizing aspect of the assembler where it strips out unused code.
4748
There's not really a dynamic switch possible as all assembly lib code is static and uses one or the other)
49+
- get rid of all TODO's in the code ;)
4850

4951

50-
More code optimization ideas
51-
^^^^^^^^^^^^^^^^^^^^^^^^^^^^
52+
More optimization ideas
53+
^^^^^^^^^^^^^^^^^^^^^^^
5254
- if a for loop's loopvariable isn't referenced in the body, replace by a repeatloop
5355
- 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
5456
- byte typed expressions should be evaluated in the accumulator where possible, without (temp)var
55-
for instance value = otherbyte >> 1 --> lda otherbite ; lsr a; sta value
57+
for instance value = otherbyte >> 1 --> lda otherbite ; lsr a; sta value
5658
- 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'
5759
- this removes the need for the BinExprSplitter? (which is problematic and very limited now)
5860
- introduce byte-index operator to avoid index multiplications in loops over arrays? see github issue #4

examples/test.p8

Lines changed: 25 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1,17 +1,33 @@
11
%import textio
2+
%import floats
23
%zeropage basicsafe
34

45
main {
5-
uword buffer = memory("the quick brown fox jumps over the lazy dog", 2000)
6-
uword buffer2 = memory("the quick brown fox jumps over the lazy dog", 2000)
7-
86
sub start() {
9-
txt.print_uwhex(buffer, true)
10-
txt.print_uwhex(buffer2, true)
11-
txt.print_uwhex("zzzz", true)
12-
str xyz = "irmen"
13-
xyz="2342344234"
14-
txt.print_uwhex(xyz, true)
7+
%asm {{
8+
lda #<float5_111
9+
ldy #>float5_111
10+
jsr floats.MOVFM
11+
lda #<float5_122
12+
ldy #>float5_122
13+
jsr floats.FADD
14+
jsr floats.FOUT
15+
sta $7e
16+
sty $7f
17+
ldy #0
18+
_loop
19+
lda ($7e),y
20+
beq _done
21+
jsr c64.CHROUT
22+
iny
23+
bne _loop
24+
_done
25+
rts
26+
27+
float5_111 .byte $81, $0e, $14, $7a, $e1 ; float 1.11
28+
float5_122 .byte $81, $1c, $28, $f5, $c2 ; float 1.22
29+
30+
}}
1531
}
1632

1733
}

0 commit comments

Comments
 (0)