Shop Learn P1 Docs P2 Docs
POKE, PEEK — Parallax Forums

POKE, PEEK

pik33pik33 Posts: 1,733
edited 2021-12-29 11:26 in BASIC (for Propeller)

A Basic without these is not complete. :)

FlexBasic is flexible, so I wrote a fast workaround for this problem: :)

function peek(addr) as ubyte
dim r as ubyte
asm
rdbyte r,addr
end asm
return r
end function

function dpeek(addr) as ushort
dim r as ushort
asm
rdword r,addr
end asm
return r
end function

function lpeek(addr) as ulong
dim r as ulong
asm
rdlong r,addr
end asm
return r
end function

sub poke(addr as ulong,value as ubyte)
asm
wrbyte value, addr
end asm
end sub

sub dpoke(addr as ulong,value as ushort)
asm
wrword value, addr
end asm
end sub

sub lpoke(addr as ulong,value as ulong)
asm
wrlong value, addr
end asm
end sub

Comments

Sign In or Register to comment.