Skip to content

Commit cb5d6dd

Browse files
committed
readme
1 parent e0794db commit cb5d6dd

File tree

1 file changed

+13
-12
lines changed

1 file changed

+13
-12
lines changed

README.md

Lines changed: 13 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -33,12 +33,13 @@ What does Prog8 provide?
3333
- conditional branches
3434
- floating point operations (requires the C64 Basic ROM routines for this)
3535
- 'when' statement to provide a concise jump table alternative to if/elseif chains
36-
- many built-in functions such as ``sin``, ``cos``, ``rnd``, ``abs``, ``min``, ``max``, ``sqrt``, ``msb``, ``rol``, ``ror``, ``swap``, ``memset``, ``memcopy``, ``sort`` and ``reverse``
3736
- structs to group together sets of variables and manipulate them at once
37+
- many built-in functions such as ``sin``, ``cos``, ``rnd``, ``abs``, ``min``, ``max``, ``sqrt``, ``msb``, ``rol``, ``ror``, ``swap``, ``sort`` and ``reverse``
38+
- various powerful built-in libraries to do I/O, number conversions, graphics and more
3839
- convenience abstractions for low level aspects such as ZeroPage handling, program startup, explicit memory addresses
3940
- fast execution speed due to compilation to native assembly code
4041
- inline assembly allows you to have full control when every cycle or byte matters
41-
- supports the sixteen 'virtual' 16-bit registers R0 .. R15 from the Commander X16, also on the C64.
42+
- supports the sixteen 'virtual' 16-bit registers R0 .. R15 from the Commander X16, and provides them also on the C64.
4243

4344
*Rapid edit-compile-run-debug cycle:*
4445

@@ -49,8 +50,8 @@ What does Prog8 provide?
4950

5051
*Two supported compiler targets* (contributions to improve these or to add support for other machines are welcome!):
5152

52-
- "c64": Commodore-64 (6510 CPU = almost a 6502), the main target.
53-
- "cx16": [CommanderX16](https://www.commanderx16.com) (65c02 CPU) .
53+
- "c64": Commodore-64 (6510 CPU = almost a 6502)
54+
- "cx16": [CommanderX16](https://www.commanderx16.com) (65c02 CPU)
5455
- If you only use standard kernel and prog8 library routines, it is possible to compile the *exact same program* for both machines (just change the compiler target flag)!
5556

5657

@@ -85,9 +86,7 @@ This code calculates prime numbers using the Sieve of Eratosthenes algorithm::
8586
ubyte candidate_prime = 2 ; is increased in the loop
8687

8788
sub start() {
88-
; clear the sieve, to reset starting situation on subsequent runs
89-
memset(sieve, 256, false)
90-
; calculate primes
89+
sys.memset(sieve, 256, false) ; clear the sieve
9190
txt.print("prime numbers up to 255:\n\n")
9291
ubyte amount=0
9392
repeat {
@@ -98,17 +97,17 @@ This code calculates prime numbers using the Sieve of Eratosthenes algorithm::
9897
txt.print(", ")
9998
amount++
10099
}
101-
txt.chrout('\n')
100+
txt.nl()
102101
txt.print("number of primes (expected 54): ")
103102
txt.print_ub(amount)
104-
txt.chrout('\n')
103+
txt.nl()
105104
}
106105

107106
sub find_next_prime() -> ubyte {
108107
while sieve[candidate_prime] {
109108
candidate_prime++
110109
if candidate_prime==0
111-
return 0 ; we wrapped; no more primes available in the sieve
110+
return 0 ; we wrapped; no more primes
112111
}
113112

114113
; found next one, mark the multiples and return it.
@@ -125,6 +124,7 @@ This code calculates prime numbers using the Sieve of Eratosthenes algorithm::
125124

126125

127126

127+
128128
when compiled an ran on a C-64 you'll get:
129129

130130
![c64 screen](docs/source/_static/primes_example.png)
@@ -141,7 +141,8 @@ If you want to play a video game, a fully working Tetris clone is included in th
141141

142142
![tehtriz_screen](docs/source/_static/tehtriz.png)
143143

144-
The CommanderX16 compiler target is quite capable already too, here's a well known space ship
145-
animated in 3D with hidden line removal, in the CommanderX16 emulator:
144+
There are a couple of examples specially made for the CommanderX16 compiler target.
145+
For instance here's a well known space ship animated in 3D with hidden line removal,
146+
in the CommanderX16 emulator:
146147

147148
![cobra3d](docs/source/_static/cobra3d.png)

0 commit comments

Comments
 (0)