mirror of
https://github.com/irmen/prog8.git
synced 2024-11-26 11:49:22 +00:00
vm: prog8lib.wordarray_contains() fixed
This commit is contained in:
parent
fc55b34d84
commit
7303c00296
@ -1,7 +1,5 @@
|
||||
; Internal library routines - always included by the compiler
|
||||
|
||||
%import textio
|
||||
|
||||
prog8_lib {
|
||||
%option force_output
|
||||
|
||||
@ -25,7 +23,7 @@ prog8_lib {
|
||||
return false
|
||||
}
|
||||
|
||||
sub wordarray_contains(ubyte needle, uword haystack_ptr, ubyte num_elements) -> ubyte {
|
||||
sub wordarray_contains(uword needle, uword haystack_ptr, ubyte num_elements) -> ubyte {
|
||||
haystack_ptr += (num_elements-1) * 2
|
||||
while num_elements {
|
||||
if peekw(haystack_ptr)==needle
|
||||
|
@ -3,6 +3,7 @@ TODO
|
||||
|
||||
For next release
|
||||
^^^^^^^^^^^^^^^^
|
||||
- fix error when passing boolean expression as ubyte param to a functioncall
|
||||
- fix expericodegen crashes from missing functions from virtual/prog8_lib.p8
|
||||
|
||||
...
|
||||
|
@ -1,13 +1,21 @@
|
||||
%import floats
|
||||
%import textio
|
||||
%zeropage basicsafe
|
||||
|
||||
main {
|
||||
float[10] flt
|
||||
|
||||
str name1 = "abc"
|
||||
str name2 = "irmen"
|
||||
ubyte v1
|
||||
ubyte v2
|
||||
|
||||
sub func(ubyte value) {
|
||||
value++
|
||||
}
|
||||
|
||||
sub start() {
|
||||
flt[1] = 42.42
|
||||
flt[1] = -flt[1]
|
||||
floats.print_f(flt[1])
|
||||
func(v1==v2)
|
||||
func(v1>v2)
|
||||
func(name1 == name2)
|
||||
func(name1 > name2)
|
||||
}
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user