Forum
poke string address,string$ - Printable Version

+- Forum (https://www.boriel.com/forum)
+-- Forum: Compilers and Computer Languages (https://www.boriel.com/forum/forumdisplay.php?fid=12)
+--- Forum: ZX Basic Compiler (https://www.boriel.com/forum/forumdisplay.php?fid=11)
+---- Forum: Wishlist (https://www.boriel.com/forum/forumdisplay.php?fid=14)
+---- Thread: poke string address,string$ (/showthread.php?tid=591)



poke string address,string$ - programandala.net - 05-21-2014

I think POKE STRING would be useful in many situations. It would poke the content of a string (not its lenght). I've written it this way:

Code:
sub fastcall pokeString(address as uinteger,text$ as string)
  asm
  ; HL = first parameter, address
  ex de,hl    ; DE = address
  pop bc      ; return address
  pop hl      ; second parameter, address of the text$ lenght
  push bc     ; restore the return address
  ld c,(hl)
  inc hl
  ld b,(hl)   ; BC = text$ lenght
  inc hl      ; HL = first char of text$
  ldir
  end asm
end sub

The advantage of a native POKE STRING would be POKE would work with all current types.


Re: poke string address,string$ - programandala.net - 05-24-2014

I've just found a thread by LCD on the same subject, POKE STRING and @string$, where Boriel explains the memcopy library can be used instead.