mirror of
https://github.com/irmen/prog8.git
synced 2025-11-01 06:16:15 +00:00
multi value returns with longs
This commit is contained in:
@@ -160,7 +160,7 @@ Regular subroutines
|
||||
|
||||
**Single arguments will often be passed in registers:**
|
||||
|
||||
For *single* byte, word, long, and pointer arguments, the values are simply loaded in cpu registers by the caller before calling the subroutine.
|
||||
For *single* byte, word, and pointer arguments (not long or float), the values are simply loaded in cpu registers by the caller before calling the subroutine.
|
||||
*The subroutine itself will take care of putting the values into the parameter variables.* This saves on code size because
|
||||
otherwise all callers would have to store the values in those variables themselves.
|
||||
Note that his convention is also still used for subroutines that specify parameters to be put into
|
||||
@@ -179,7 +179,7 @@ Single word parameter: ``sub foo(uword bar) { ... }``
|
||||
Single pointer parameter: ``sub foo(^^ubyte bar) { ... }``
|
||||
gets bar in the register pair A + Y (lsb in A, msb in Y), *subroutine* stores it into parameter variable
|
||||
|
||||
Floating point parameter: ``sub foo(float bar) { ... }``
|
||||
Long or Floating point parameter: ``sub foo(long bar) { ... }``, ``sub foo(float bar) { ... }``
|
||||
value for bar gets stored into the parameter variable *by the caller*
|
||||
|
||||
Other: ``sub foo(ubyte bar, ubyte baz, ubyte zoo) { ... }``
|
||||
|
||||
@@ -3,7 +3,6 @@ TODO
|
||||
|
||||
LONG TYPE
|
||||
---------
|
||||
- call convention: NEVER put LONG parameter into R0:R1 just use parameter variable (also fix convention doc)
|
||||
- call convention for asmsubs: asmsubs don't have syntax for passing a long value so use explicit separate msw() and lsw() arguments... Or introduce new syntax for R0+R1 combo's?
|
||||
- make sure == and != work with longs against byte and words as well signed and unsigned
|
||||
- how hard is it to also implement the other comparison operators on longs?
|
||||
@@ -32,6 +31,9 @@ STRUCTS and TYPED POINTERS
|
||||
Future Things and Ideas
|
||||
^^^^^^^^^^^^^^^^^^^^^^^
|
||||
|
||||
- After long variable type is completed: make all constants long by default (remove type name altogether), reduce to target type implictly if the actual value fits.
|
||||
This will break some existing programs that depend on value wrap arounds, but gives more intuitive constant number handling.
|
||||
Can give descriptive error message for old syntax that still includes the type name?
|
||||
- improve ANTLR grammar with better error handling (as suggested by Qwen AI)
|
||||
- allow memory() to occur in array initializer
|
||||
- when a complete block is removed because unused, suppress all info messages about everything in the block being removed
|
||||
|
||||
Reference in New Issue
Block a user