avoid doing useless jsr for reboot/poweroff calls

This commit is contained in:
Irmen de Jong 2025-02-26 20:24:24 +01:00
parent 94653e5c8c
commit 72c16d0d32
5 changed files with 10 additions and 9 deletions

View File

@ -93,8 +93,7 @@ What does Prog8 provide?
- "c64": Commodore-64 (6502 like CPU)
- "c128": Commodore-128 (6502 like CPU - the Z80 cpu mode is not supported)
- "pet32": Commodore PET (limited support)
- "atari": Atari 8 bit such as 800XL (experimental)
- "neo": Neo6502 (experimental)
- via external configurable targets: Atari 800 XL, Neo6502, NES, C64OS, ...
- If you only use standard kernal and prog8 library routines, it is possible to compile the *exact same program* for different machines (just change the compiler target flag)

View File

@ -1358,12 +1358,12 @@ _continue iny
sub reset_system() {
; -- Soft-reset the system back to initial power-on Basic prompt.
sys.reset_system()
goto sys.reset_system
}
sub poweroff_system() {
; -- use the SMC to shutdown the computer
sys.poweroff_system()
goto sys.poweroff_system
}
sub set_led_state(bool on) {

View File

@ -28,6 +28,7 @@ You can compile programs for various machines that are built in into the compile
* Commodore PET (limited support)
* any other 65(C)02 target machine or setup can be configured to a great extent in a user written configuration file.
There are some examples included for the Atari 800 XL, NEO6502 and such.
* some users have been experimenting with a NES and a C64OS target as well.
Some language features are mentioned below, and you can also read :ref:`comparingprog8` if you
want to quickly read about how Prog8 compares to well-known other languages.

View File

@ -1,13 +1,15 @@
TODO
====
- Look at github PR for improved romability (see github issue 149) Also search for "TODO: Romable"
- Sorting module gnomesort_uw could be optimized more by fully rewriting it in asm? Shellshort seems consistently faster even if most of the words are already sorted.
...
Future Things and Ideas
^^^^^^^^^^^^^^^^^^^^^^^
- Look at github PR for improved romability (see github issue 149) Also search for "TODO: Romable"
- const values should always either be of type long or float, this is how they were usually treated in const expression evaluation already anyway
- Kotlin: can we use inline value classes in certain spots?
- add float support to the configurable compiler targets
@ -26,8 +28,6 @@ Future Things and Ideas
Maybe this routine can be made more intelligent. See usesOtherRegistersWhileEvaluating() and argumentsViaRegisters().
- Does it make codegen easier if everything is an expression? Start with the PtProgram ast , get rid of the statements there -> expressions that have Void data type
- Can we support signed % (remainder) somehow?
- instead of copy-pasting inline asmsubs, make them into a 64tass macro and use that instead.
that will allow them to be reused from custom user written assembly code as well.
- Multidimensional arrays and chained indexing, purely as syntactic sugar over regular arrays. Probaby only useful if we have typed pointers.
- make a form of "manual generics" possible like: varsub routine(T arg)->T where T is expanded to a specific type
(this is already done hardcoded for several of the builtin functions)
@ -58,7 +58,6 @@ IR/VM
Libraries
---------
- Sorting module gnomesort_uw could be optimized more by fully rewriting it in asm? Shellshort seems consistently faster even if most of the words are already sorted.
- Add split-word array sorting routines to sorting module?
- See if the raster interrupt handler on the C64 can be tweaked to be a more stable raster irq
- add even more general raster irq routines to build some sort of "copper list" , like Oscar64 has?

View File

@ -6,7 +6,9 @@ main {
sub start() {
repeat {
if cbm.GETIN2()==27
sys.poweroff_system()
cx16.poweroff_system()
if cbm.GETIN2()==27
cx16.reset_system()
}
}
}