mirror of
https://github.com/irmen/prog8.git
synced 2024-11-27 03:50:27 +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
|
; Internal library routines - always included by the compiler
|
||||||
|
|
||||||
%import textio
|
|
||||||
|
|
||||||
prog8_lib {
|
prog8_lib {
|
||||||
%option force_output
|
%option force_output
|
||||||
|
|
||||||
@ -25,7 +23,7 @@ prog8_lib {
|
|||||||
return false
|
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
|
haystack_ptr += (num_elements-1) * 2
|
||||||
while num_elements {
|
while num_elements {
|
||||||
if peekw(haystack_ptr)==needle
|
if peekw(haystack_ptr)==needle
|
||||||
|
@ -3,6 +3,7 @@ TODO
|
|||||||
|
|
||||||
For next release
|
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
|
- fix expericodegen crashes from missing functions from virtual/prog8_lib.p8
|
||||||
|
|
||||||
...
|
...
|
||||||
|
@ -1,13 +1,21 @@
|
|||||||
%import floats
|
|
||||||
%import textio
|
%import textio
|
||||||
%zeropage basicsafe
|
%zeropage basicsafe
|
||||||
|
|
||||||
main {
|
main {
|
||||||
float[10] flt
|
|
||||||
|
str name1 = "abc"
|
||||||
|
str name2 = "irmen"
|
||||||
|
ubyte v1
|
||||||
|
ubyte v2
|
||||||
|
|
||||||
|
sub func(ubyte value) {
|
||||||
|
value++
|
||||||
|
}
|
||||||
|
|
||||||
sub start() {
|
sub start() {
|
||||||
flt[1] = 42.42
|
func(v1==v2)
|
||||||
flt[1] = -flt[1]
|
func(v1>v2)
|
||||||
floats.print_f(flt[1])
|
func(name1 == name2)
|
||||||
|
func(name1 > name2)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user