add pokep() and peekp() builtin functions

This commit is contained in:
Irmen de Jong committed 2026-07-12 12:54:29 +02:00
1 parent f10a58ee1b
commit e645b0abe1
21 files changed
+71 -31

No files matched your search

@@ -163,12 +163,14 @@ val BuiltinFunctions: Map<String, FSignature> = mapOf(
"peekw" to FSignature(true, arrayOf(BaseDataType.UWORD), FParam("address", BaseDataType.UWORD, BaseDataType.LONG)),
"peekl" to FSignature(true, arrayOf(BaseDataType.LONG), FParam("address", BaseDataType.UWORD, BaseDataType.LONG)),
"peekf" to FSignature(true, arrayOf(BaseDataType.FLOAT), FParam("address", BaseDataType.UWORD, BaseDataType.LONG)),
"peekp" to FSignature(true, arrayOf(BaseDataType.POINTER), FParam("address", BaseDataType.POINTER, BaseDataType.UWORD, BaseDataType.LONG)),
"poke" to FSignature(false, emptyArray(), FParam("address", BaseDataType.UWORD, BaseDataType.LONG), FParam("value", BaseDataType.UBYTE, BaseDataType.BYTE)),
"pokebool" to FSignature(false, emptyArray(), FParam("address", BaseDataType.UWORD, BaseDataType.LONG), FParam("value", BaseDataType.BOOL)),
"pokebowl" to FSignature(false, emptyArray(), FParam("address", BaseDataType.UWORD, BaseDataType.LONG), FParam("value", BaseDataType.BOOL)),
"pokew" to FSignature(false, emptyArray(), FParam("address", BaseDataType.UWORD, BaseDataType.LONG), FParam("value", BaseDataType.UWORD, BaseDataType.WORD)),
"pokel" to FSignature(false, emptyArray(), FParam("address", BaseDataType.UWORD, BaseDataType.LONG), FParam("value", BaseDataType.LONG)),
"pokef" to FSignature(false, emptyArray(), FParam("address", BaseDataType.UWORD, BaseDataType.LONG), FParam("value", BaseDataType.FLOAT)),
"pokep" to FSignature(false, emptyArray(), FParam("address", BaseDataType.POINTER, BaseDataType.UWORD, BaseDataType.LONG), FParam("value", BaseDataType.POINTER)),
"pokemon" to FSignature(false, arrayOf(BaseDataType.UBYTE), FParam("address", BaseDataType.UWORD), FParam("value", BaseDataType.UBYTE)),
"rsave" to FSignature(false, emptyArray()),
"rrestore" to FSignature(false, emptyArray()),
@@ -271,6 +271,14 @@ _after:
)
return listOf(AstReplaceNode(functionCall as Node, newCall, parent))
}
if(outerFunc==listOf("pokep")) {
val pokeName = if(target.POINTER_MEM_SIZE > 2u) "pokel" else "pokew"
val newCall = FunctionCallStatement(
IdentifierReference(listOf(pokeName), position),
functionCall.args, false, position
)
return listOf(AstReplaceNode(functionCall as Node, newCall, parent))
}
return noModifications
}
@@ -336,6 +344,14 @@ _after:
}
return mods
}
if(functionCallExpr.target.nameInSource==listOf("peekp")) {
val peekName = if(target.POINTER_MEM_SIZE > 2u) "peekl" else "peekw"
val newCall = FunctionCallExpression(
IdentifierReference(listOf(peekName), functionCallExpr.position),
functionCallExpr.args.toMutableList(), functionCallExpr.position
)
return listOf(AstReplaceNode(functionCallExpr, newCall, parent))
}
return noModifications
}
@@ -34,6 +34,7 @@ peekbool (uword|long address) -> bool
peekf (uword|long address) -> float
peekl (uword|long address) -> long
peekw (uword|long address) -> uword
peekp (pointer|uword|long address) -> pointer
poke (uword|long address, ubyte|byte value)
pokebool (uword|long address, bool value)
pokebowl (uword|long address, bool value)
@@ -41,6 +42,7 @@ pokef (uword|long address, float value)
pokel (uword|long address, long value)
pokemon (uword address, ubyte value) -> ubyte
pokew (uword|long address, uword|word value)
pokep (pointer|uword|long address, pointer value)
pop () -> ubyte
popf () -> float
popl () -> long
@@ -34,6 +34,7 @@ peekbool (uword|long address) -> bool
peekf (uword|long address) -> float
peekl (uword|long address) -> long
peekw (uword|long address) -> uword
peekp (pointer|uword|long address) -> pointer
poke (uword|long address, ubyte|byte value)
pokebool (uword|long address, bool value)
pokebowl (uword|long address, bool value)
@@ -41,6 +42,7 @@ pokef (uword|long address, float value)
pokel (uword|long address, long value)
pokemon (uword address, ubyte value) -> ubyte
pokew (uword|long address, uword|word value)
pokep (pointer|uword|long address, pointer value)
pop () -> ubyte
popf () -> float
popl () -> long
@@ -34,6 +34,7 @@ peekbool (uword|long address) -> bool
peekf (uword|long address) -> float
peekl (uword|long address) -> long
peekw (uword|long address) -> uword
peekp (pointer|uword|long address) -> pointer
poke (uword|long address, ubyte|byte value)
pokebool (uword|long address, bool value)
pokebowl (uword|long address, bool value)
@@ -41,6 +42,7 @@ pokef (uword|long address, float value)
pokel (uword|long address, long value)
pokemon (uword address, ubyte value) -> ubyte
pokew (uword|long address, uword|word value)
pokep (pointer|uword|long address, pointer value)
pop () -> ubyte
popf () -> float
popl () -> long
@@ -34,6 +34,7 @@ peekbool (uword|long address) -> bool
peekf (uword|long address) -> float
peekl (uword|long address) -> long
peekw (uword|long address) -> uword
peekp (pointer|uword|long address) -> pointer
poke (uword|long address, ubyte|byte value)
pokebool (uword|long address, bool value)
pokebowl (uword|long address, bool value)
@@ -41,6 +42,7 @@ pokef (uword|long address, float value)
pokel (uword|long address, long value)
pokemon (uword address, ubyte value) -> ubyte
pokew (uword|long address, uword|word value)
pokep (pointer|uword|long address, pointer value)
pop () -> ubyte
popf () -> float
popl () -> long
@@ -32,15 +32,17 @@ offsetof (ubyte field) -> ubyte
peek (uword|long address) -> ubyte
peekbool (uword|long address) -> bool
peekf (uword|long address) -> float
peekl (uword|long address) -> long
peekw (uword|long address) -> uword
poke (uword|long address, ubyte|byte value)
pokebool (uword|long address, bool value)
pokebowl (uword|long address, bool value)
pokef (uword|long address, float value)
pokel (uword|long address, long value)
pokemon (uword address, ubyte value) -> ubyte
pokew (uword|long address, uword|word value)
peekl (uword|long address) -> long
peekw (uword|long address) -> uword
peekp (pointer|uword|long address) -> pointer
poke (uword|long address, ubyte|byte value)
pokebool (uword|long address, bool value)
pokebowl (uword|long address, bool value)
pokef (uword|long address, float value)
pokel (uword|long address, long value)
pokemon (uword address, ubyte value) -> ubyte
pokew (uword|long address, uword|word value)
pokep (pointer|uword|long address, pointer value)
pop () -> ubyte
popf () -> float
popl () -> long
@@ -34,6 +34,7 @@ peekbool (uword|long address) -> bool
peekf (uword|long address) -> float
peekl (uword|long address) -> long
peekw (uword|long address) -> uword
peekp (pointer|uword|long address) -> pointer
poke (uword|long address, ubyte|byte value)
pokebool (uword|long address, bool value)
pokebowl (uword|long address, bool value)
@@ -41,6 +42,7 @@ pokef (uword|long address, float value)
pokel (uword|long address, long value)
pokemon (uword address, ubyte value) -> ubyte
pokew (uword|long address, uword|word value)
pokep (pointer|uword|long address, pointer value)
pop () -> ubyte
popf () -> float
popl () -> long
+1
View File
@@ -126,6 +126,7 @@ exclude_patterns = []
# The name of the Pygments (syntax highlighting) style to use.
pygments_style = "sphinx"
# highlight_language = 'none'
highlight_language = 'prog8'
# -- Options for HTML output -------------------------------------------------
+10 -2
View File
@@ -103,7 +103,7 @@ CPU Stack
Low-level function that is seldomly used in user code.
Don't assume anything about the order in which the bytes are pushed - popw will make sense of them again.
:index:`pushp` (value)
:index:`pushp` (value) **experimental, may change or be removed**
pushes a pointer value on the CPU hardware stack.
On 2-byte pointer targets this is the same as pushw, on 32-bit pointer targets it acts as pushl.
Low-level function that is seldomly used in user code.
@@ -127,7 +127,7 @@ CPU Stack
pops a 16-bit word value off the CPU hardware stack that was pushed before by pushw, and returns it.
Low-level function that is seldomly used in user code.
:index:`popp` ()
:index:`popp` () **experimental, may change or be removed**
pops a pointer value off the CPU hardware stack that was pushed before by pushp, and returns it.
On 2-byte pointer targets this is the same as popw, on 32-bit pointer targets it acts as popl.
Low-level function that is seldomly used in user code.
@@ -226,6 +226,10 @@ Miscellaneous
Caution: when using peekw to get words out of an array pointer, make sure the array is *not* a split word array
(peekw requires the LSB and MSB of the word value to be consecutive in memory).
:index:`peekp` (address) **experimental, may change or be removed**
reads a pointer value at the given address in memory.
On 16-bit targets this reads 2 bytes (like peekw), on 32-bit targets this reads 4 bytes (like peekl).
:index:`peekl` (address)
reads the signed long value at the given address in memory. Long is read as usual little-endian lsb/msb byte order.
@@ -248,6 +252,10 @@ Miscellaneous
:index:`pokef` (address, value)
writes the float value at the given address in memory. On CBM machines, this writes 5 bytes.
:index:`pokep` (address, value) **experimental, may change or be removed**
writes the pointer value at the given address in memory.
On 16-bit targets this writes 2 bytes (like pokew), on 32-bit targets this writes 4 bytes (like pokel).
:index:`pokemon` (address, value)
Like poke(), but also returns the previous value in the given address.
Also doesn't have anything to do with a certain video game.
+5
View File
@@ -16,6 +16,7 @@ class Prog8Lexer(RegexLexer):
(r"\d+\.\d+(?:[eE][+-]?\d+)?", Number.Float),
(r"\d+", Number.Integer),
(r"\$[0-9a-fA-F_]+", Number.Hex),
(r"\$", Operator),
(r"%[01_]+", Number.Bin),
(r"\btrue\b|\bfalse\b", Keyword.Constant),
(r"\b(?:if|else|then|when)\b", Keyword),
@@ -29,11 +30,15 @@ class Prog8Lexer(RegexLexer):
(r"\b(?:and|or|xor|not|as)\b", Operator.Word),
(r"%\w+", Name.Decorator),
(r"@\w+", Name.Decorator),
(r"@", Operator),
(r"#", Operator),
(r"\\", Operator),
(r"\^\^", Keyword.Type),
(r"\+\+|--", Operator),
(r"(?:<<=|>>=)", Operator),
(r"<<|>>", Operator),
(r"&&|\|\|", Operator),
(r"=", Operator),
(r"[-+*/%&|^~<>!]=?", Operator),
(r"[{}()\[\]]", Punctuation),
(r":", Punctuation),
+3 -4
View File
@@ -262,10 +262,9 @@ However, it is possible to write a dynamic memory handling library yourself (it
If you ask such a library to give you a pointer to a piece of memory with size ``sizeof(Enemy)`` you can use that as
a dynamic pointer to an Enemy struct.
An example of how a super simple dynamic allocator could look like::
.. note::
The ``pointer`` type is used instead of ``uword`` so that the code also works correctly on targets where memory addresses are wider than 2 bytes (such as the m68k target with 4-byte pointers).
An example of how a super simple dynamic allocator could look like follows.
Noe that the ``pointer`` type is used instead of ``uword`` so that the code also works correctly on targets
where memory addresses are wider than 2 bytes (such as the m68k target with 4-byte pointers)::
^^Node newnode = allocator.alloc(sizeof(Node))
...
-5
View File
@@ -4,10 +4,6 @@ TODO
- need a bunch of type casting/conversion checks that test the handling of the 4-byte/long pointer datatype on the qemu68k target.
- some generated label names in the m68k codegen can maybe replaced by local/anonymous labels?
What is this, why are pointer arrays being so difficult here?
// handle DONTCARE pointer arrays on non-6502 targets: convert back to regular array with long elements
// but preserve the struct subtype so field access (struct.field) still works
m68k Codegen: FPU register allocation (68881 only has fp0-fp7)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
@@ -19,7 +15,6 @@ Note: this problem does NOT affect regular data/address registers because those
Future Things and Ideas
^^^^^^^^^^^^^^^^^^^^^^^
- use .. code-block:: prog8 in the documentation instead of 'bare' code blocks (there is a prog8 lexer now added for pygments to pick this up)
- make enums strongly typed instead of just syntactic sugar for ints (see ideas/enum-strong-type.md for the plan)
- add %option private_symbols to make access mode private by default; need (new) 'public' keyword to explicitly mark symbols public.
- symboldump: some sort of javadocs generated from the p8 source files (instead of just the function signatures). Use markdown for formatting, not html.
+5 -5
View File
@@ -957,12 +957,12 @@ planet {
sub getword(ubyte listnum, ubyte wordidx) -> pointer {
if sys.SIZEOF_POINTER==4 {
; on 32-bit targets, the array stores flat 4-byte pointers
long wordlist_base = &wordlists
long addr = peekl(wordlist_base + (listnum-$81) * 4)
return peekl(addr + wordidx*4) as pointer
pointer wordlist_base = &wordlists
pointer addr = peekp(wordlist_base + (listnum-$81) * 4)
return peekp(addr + wordidx*4)
} else {
uword list = wordlists[listnum-$81]
return peekw(list + wordidx*2) as pointer ; this depends on the word list itself to be @nosplit !
pointer list = wordlists[listnum-$81]
return peekp(list + wordidx*2) ; this depends on the word list itself to be @nosplit !
}
}
}
+1 -1
View File
@@ -14,7 +14,7 @@
<keywords keywords="&amp;;&amp;&amp;;&amp;&lt;;&amp;&gt;;-&gt;;::;@;^^;alias;and;as;asmsub;break;clobbers;continue;do;downto;else;extsub;false;for;goto;if;if_cc;if_cs;if_eq;if_mi;if_ne;if_neg;if_nz;if_pl;if_pos;if_vc;if_vs;if_z;in;inline;not;on;or;private;repeat;return;step;sub;then;to;true;unroll;until;when;while;xor;~" ignore_case="false" />
<keywords2 keywords="%address;%align;%asm;%asmbinary;%asminclude;%breakpoint;%encoding;%import;%ir;%jmptable;%launcher;%memtop;%option;%output;%zeropage;%zpallowed;%zpreserved;@align64;@alignpage;@alignword;@bank;@dirty;@nosplit;@nozp;@requirezp;@shared;@split;@zp;atascii:;c64os:;cp437:;default:;iso16:;iso5:;iso:;kata:;petscii:;sc:" />
<keywords3 keywords="^^bool;^^byte;^^float;^^long;^^str;^^ubyte;^^uword;^^word;bool;byte;const;enum;float;long;pointer;str;struct;ubyte;uword;void;word" />
<keywords4 keywords="abs;bmx;call;callfar;callfar2;cbm;clamp;cmp;conv;cx16;defer;diskio;divmod;floats;len;lmh;lsb;lsw;math;max;memory;min;mkword;msb;msw;offsetof;peek;peekbool;peekf;peekl;peekw;poke;pokebool;pokef;pokel;pokew;pop;popf;popl;popw;popp;psg;psg2;push;pushf;pushl;pushw;pushp;rol;rol2;ror;ror2;rrestore;rrestorex;rsave;rsavex;setlsb;setmsb;sgn;sizeof;sqrt;strings;swap;sys;txt;verafx" />
<keywords4 keywords="abs;bmx;call;callfar;callfar2;cbm;clamp;cmp;conv;cx16;defer;diskio;divmod;floats;len;lmh;lsb;lsw;math;max;memory;min;mkword;msb;msw;offsetof;peek;peekbool;peekf;peekl;peekw;peekp;poke;pokebool;pokef;pokel;pokew;pokep;pop;popf;popl;popw;popp;psg;psg2;push;pushf;pushl;pushw;pushp;rol;rol2;ror;ror2;rrestore;rrestorex;rsave;rsavex;setlsb;setmsb;sgn;sizeof;sqrt;strings;swap;sys;txt;verafx" />
</highlighting>
<extensionMap>
<mapping ext="p8" />
+2
View File
@@ -127,11 +127,13 @@
<item>peekf</item>
<item>peekl</item>
<item>peekw</item>
<item>peekp</item>
<item>poke</item>
<item>pokebool</item>
<item>pokef</item>
<item>pokel</item>
<item>pokew</item>
<item>pokep</item>
<item>pop</item>
<item>popf</item>
<item>popl</item>
+1 -1
View File
@@ -27,7 +27,7 @@
<Keywords name="Keywords1">void const&#x000D;&#x000A;str&#x000D;&#x000A;byte ubyte bool&#x000D;&#x000A;long word uword&#x000D;&#x000A;float&#x000D;&#x000A;pointer&#x000D;&#x000A;zp shared split nosplit requirezp nozp align64 alignpage alignword dirty struct enum</Keywords>
<Keywords name="Keywords2">%address&#x000D;&#x000A;%asm&#x000D;&#x000A;%ir&#x000D;&#x000A;%asmbinary&#x000D;&#x000A;%asminclude&#x000D;&#x000A;%align&#x000D;&#x000A;%breakpoint&#x000D;&#x000A;%encoding&#x000D;&#x000A;%import&#x000D;&#x000A;%jmptable&#x000D;&#x000A;%memtop&#x000D;&#x000A;%launcher&#x000D;&#x000A;%option&#x000D;&#x000A;%output&#x000D;&#x000A;%zeropage&#x000D;&#x000A;%zpreserved&#x000D;&#x000A;%zpallowed</Keywords>
<Keywords name="Keywords3">inline sub asmsub extsub&#x000D;&#x000A;clobbers&#x000D;&#x000A;asm&#x000D;&#x000A;if&#x000D;&#x000A;when then else&#x000D;&#x000A;if_cc if_cs if_eq if_mi if_neg if_nz if_pl if_pos if_vc if_vs if_z&#x000D;&#x000A;for in step do while repeat unroll&#x000D;&#x000A;break continue return goto&#x000D;&#x000A;private</Keywords>
<Keywords name="Keywords4">alias abs call callfar callfar2 clamp cmp defer divmod len lsb lsw lmh lsl lsr memory mkword min max msb msw offsetof peek peekw peekl peekf peekbool poke pokew pokel pokef pokebool pop popw popl popf popp psg psg2 push pushw pushl pushf pushp rsave rsavex rrestore rrestorex rnd rndw rol rol2 ror ror2 setlsb setmsb sgn sizeof sqrt sqrtw swap</Keywords>
<Keywords name="Keywords4">alias abs call callfar callfar2 clamp cmp defer divmod len lsb lsw lmh lsl lsr memory mkword min max msb msw offsetof peek peekw peekp peekl peekf peekbool poke pokew pokep pokel pokef pokebool pop popw popl popf popp psg psg2 push pushw pushl pushf pushp rsave rsavex rrestore rrestorex rnd rndw rol rol2 ror ror2 setlsb setmsb sgn sizeof sqrt sqrtw swap</Keywords>
<Keywords name="Keywords5">true false&#x000D;&#x000A;not and or xor&#x000D;&#x000A;as to downto |&gt;</Keywords>
<Keywords name="Keywords6">bmx;cbm;conv;cx16;diskio;floats;graphics;math;memory;palette;psg;psg2;strings;sys;textio;txt;verafx</Keywords>
<Keywords name="Keywords7"></Keywords>
+1 -1
View File
@@ -27,7 +27,7 @@
<Keywords name="Keywords1">void const&#x000D;&#x000A;str&#x000D;&#x000A;byte ubyte bool&#x000D;&#x000A;long word uword&#x000D;&#x000A;float&#x000D;&#x000A;pointer&#x000D;&#x000A;zp shared split nosplit requirezp nozp align64 alignpage alignword dirty struct enum</Keywords>
<Keywords name="Keywords2">%address&#x000D;&#x000A;%asm&#x000D;&#x000A;%ir&#x000D;&#x000A;%asmbinary&#x000D;&#x000A;%asminclude&#x000D;&#x000A;%align&#x000D;&#x000A;%breakpoint&#x000D;&#x000A;%encoding&#x000D;&#x000A;%import&#x000D;&#x000A;%jmptable&#x000D;&#x000A;%memtop&#x000D;&#x000A;%launcher&#x000D;&#x000A;%option&#x000D;&#x000A;%output&#x000D;&#x000A;%zeropage&#x000D;&#x000A;%zpreserved&#x000D;&#x000A;%zpallowed</Keywords>
<Keywords name="Keywords3">inline sub asmsub extsub&#x000D;&#x000A;clobbers&#x000D;&#x000A;asm&#x000D;&#x000A;if&#x000D;&#x000A;when else&#x000D;&#x000A;if_cc if_cs if_eq if_mi if_neg if_nz if_pl if_pos if_vc if_vs if_z&#x000D;&#x000A;for in step do while repeat unroll&#x000D;&#x000A;break continue return goto&#x000D;&#x000A;private</Keywords>
<Keywords name="Keywords4">alias abs call callfar callfar2 clamp cmp defer divmod len lsb lsw lmh lsl lsr memory mkword min max msb msw offsetof peek peekw peekl peekf peekbool poke pokew pokel pokef pokebool pop popw popl popf popp psg psg2 push pushw pushl pushf pushp rsave rsavex rrestore rrestorex rnd rndw rol rol2 ror ror2 setlsb setmsb sgn sizeof sqrt sqrtw swap</Keywords>
<Keywords name="Keywords4">alias abs call callfar callfar2 clamp cmp defer divmod len lsb lsw lmh lsl lsr memory mkword min max msb msw offsetof peek peekw peekp peekl peekf peekbool poke pokew pokep pokel pokef pokebool pop popw popl popf popp psg psg2 push pushw pushl pushf pushp rsave rsavex rrestore rrestorex rnd rndw rol rol2 ror ror2 setlsb setmsb sgn sizeof sqrt sqrtw swap</Keywords>
<Keywords name="Keywords5">true false&#x000D;&#x000A;not and or xor&#x000D;&#x000A;as to downto |&gt;</Keywords>
<Keywords name="Keywords6">bmx;cbm;conv;cx16;diskio;floats;graphics;math;memory;palette;psg;psg2;strings;sys;textio;txt;verafx</Keywords>
<Keywords name="Keywords7"></Keywords>
@@ -156,7 +156,7 @@ contexts:
- match: (\b(const)\b)
scope: storage.modifier.prog8
support:
- match: (\b(abs|call|callfar|callfar2|clamp|cmp|defer|divmod|len|lsb|lsw|lmh|lsr|memory|mkword|min|max|msb|msw|offsetof|peek|peekw|peekl|peekf|peekbool|poke|pokew|pokel|pokef|pokebool|pop|popw|popl|popf|popp|psg|psg2|push|pushw|pushl|pushf|pushp|rsave|rsavex|rrestore|rrestorex|rol|rol2|ror|ror2|setlsb|setmsb|sgn|sizeof|sqrt|sqrtw|swap)\b)
- match: (\b(abs|call|callfar|callfar2|clamp|cmp|defer|divmod|len|lsb|lsw|lmh|lsr|memory|mkword|min|max|msb|msw|offsetof|peek|peekw|peekp|peekl|peekf|peekbool|poke|pokew|pokep|pokel|pokef|pokebool|pop|popw|popl|popf|popp|psg|psg2|push|pushw|pushl|pushf|pushp|rsave|rsavex|rrestore|rrestorex|rol|rol2|ror|ror2|setlsb|setmsb|sgn|sizeof|sqrt|sqrtw|swap)\b)
scope: support.function.prog8
variable:
- match: (\b\w+\b)
+1 -1
View File
@@ -11,7 +11,7 @@ syn keyword prog8BuiltInFunc sgn sqrtw
syn keyword prog8BuiltInFunc len
" Miscellaneous functions
syn keyword prog8BuiltInFunc cmp divmod lsb msb lmh lsw msw mkword min max peek peekw peekl peekf peekbool poke pokew pokel pokef pokebool push pushw pushl pushf pushp pop popw popl popf popp rsave rsavex rrestore rrestorex
syn keyword prog8BuiltInFunc cmp divmod lsb msb lmh lsw msw mkword min max peek peekw peekp peekl peekf peekbool poke pokew pokep pokel pokef pokebool push pushw pushl pushf pushp pop popw popl popf popp rsave rsavex rrestore rrestorex
syn keyword prog8BuiltInFunc rol rol2 ror ror2 sizeof offsetof setlsb setmsb swap
syn keyword prog8BuiltInFunc memory call callfar callfar2 clamp defer alias
+1 -1
View File
@@ -61,7 +61,7 @@ color magenta "%[Aa][Sm][Mm]"
color magenta "^[[:space:]]*%[[:alpha:]]+"
# Built-in functions
color white "\<(abs|call|callfar|callfar2|clamp|cmp|defer|divmod|len|lsb|lsw|lmh|lsr|memory|mkword|min|max|msb|msw|offsetof|peek|peekw|peekl|peekf|peekbool|poke|pokew|pokel|pokef|pokebool|pop|popw|popl|popf|popp|psg|psg2|push|pushw|pushl|pushf|pushp|rsave|rsavex|rrestore|rrestorex|rol|rol2|ror|ror2|setlsb|setmsb|sgn|sizeof|sqrt|sqrtw|swap)\>"
color white "\<(abs|call|callfar|callfar2|clamp|cmp|defer|divmod|len|lsb|lsw|lmh|lsr|memory|mkword|min|max|msb|msw|offsetof|peek|peekw|peekp|peekl|peekf|peekbool|poke|pokew|pokep|pokel|pokef|pokebool|pop|popw|popl|popf|popp|psg|psg2|push|pushw|pushl|pushf|pushp|rsave|rsavex|rrestore|rrestorex|rol|rol2|ror|ror2|setlsb|setmsb|sgn|sizeof|sqrt|sqrtw|swap)\>"
# Strings
color brightblue ""([^"]|\\")*""