Execute Computer/Zero: Difference between revisions

Content added Content deleted
m (syntax highlighting fixup automation)
Line 993: Line 993:


=={{header|Julia}}==
=={{header|Julia}}==
<syntaxhighlight lang="ruby">mutable struct ComputerZero
<syntaxhighlight lang="julia">mutable struct ComputerZero
ip::Int
ip::Int
ram::Vector{UInt8}
ram::Vector{UInt8}
Line 1,187: Line 1,187:
=== Interpreter version with labels ===
=== Interpreter version with labels ===
Uses the Python examples.
Uses the Python examples.
<syntaxhighlight lang="ruby">function interpret(text::String)
<syntaxhighlight lang="julia">function interpret(text::String)
ip, accum, isready, ram = 0x1, 0x0, true, zeros(UInt8, 32)
ip, accum, isready, ram = 0x1, 0x0, true, zeros(UInt8, 32)
NOP() = (ip = mod1(ip + 1, 32))
NOP() = (ip = mod1(ip + 1, 32))