The Lambda Lab
/
projects
/
forth.jl.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
1362925
)
Updated run() to call new INCLUDED word.
author
Tim Vaughan
<tgvaughan@gmail.com>
Sat, 8 Oct 2016 22:04:38 +0000
(11:04 +1300)
committer
Tim Vaughan
<tgvaughan@gmail.com>
Sat, 8 Oct 2016 22:04:38 +0000
(11:04 +1300)
src/forth.jl
patch
|
blob
|
history
diff --git
a/src/forth.jl
b/src/forth.jl
index
9c62fe6
..
37c41ec
100644
(file)
--- a/
src/forth.jl
+++ b/
src/forth.jl
@@
-99,6
+99,10
@@
end
getString(addr::Int64, len::Int64) = AbstractString([Char(c) for c in mem[addr:(addr+len-1)]])
+function putString(str::AbstractString, addr::Int64)
+ mem[addr:(addr+length(str)-1)] = [Int64(c) for c in str]
+end
+
function putString(str::AbstractString, addr::Int64, maxLen::Int64)
len = min(length(str), maxLen)
mem[addr:(addr+len-1)] = [Int64(c) for c in str]