mirror of
https://github.com/irmen/prog8.git
synced 2025-11-23 14:17:51 +00:00
changed (and fixed) msb(long) and lsb(long)
This commit is contained in:
@@ -91,16 +91,13 @@ cmp (x,y)
|
||||
Normally you should just use a comparison expression (``x < y``)
|
||||
|
||||
lsb (x)
|
||||
Get the least significant (lower) byte of the value x. Equivalent to ``x & 255``.
|
||||
Get the least significant (lower) byte of the value x. Equivalent to ``x & 255`` or even ``x as ubyte``.
|
||||
|
||||
lsw (x)
|
||||
Get the least significant (lower) word of the value x. Equivalent to ``x & 65535``.
|
||||
Get the least significant (lower) word of the value x. Equivalent to ``x & 65535`` or even ``x as uword``.
|
||||
|
||||
msb (x)
|
||||
Get the most significant (higher) byte of the word value x.
|
||||
If x is a value greater than a word, it will not actually return the *highest* byte of this value,
|
||||
but it will only look a the lower word part of this value and return the higher byte from that.
|
||||
So you're always getting bits 8-16 of the value x: ``msb($1234)`` is $12, whereas ``msb($123456)`` is $34.
|
||||
Get the most significant (highest) byte of the word or long value x.
|
||||
|
||||
msw (x)
|
||||
Get the most significant (higher) word of the value x. For all word and byte numbers this will always result in 0.
|
||||
|
||||
@@ -31,6 +31,7 @@ STRUCTS and TYPED POINTERS
|
||||
Future Things and Ideas
|
||||
^^^^^^^^^^^^^^^^^^^^^^^
|
||||
- make $8000000 a valid long integer (-2147483648) this is more involved than you think. To make this work: long |= $80000000
|
||||
- make memory mapped variables support more constant expressions such as: &uword MyHigh = &mylong1+2
|
||||
- fix the line, cols in Position, sometimes they count from 0 sometimes from 1, should both always be 1-based (is this the reason some source lines end up missing in the IR file?)
|
||||
- handle Alias in a general way in LiteralsToAutoVarsAndRecombineIdentifiers instead of replacing it scattered over multiple functions
|
||||
- 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.
|
||||
|
||||
Reference in New Issue
Block a user