8086 simulator in ruby

V

Vasil Vangelovski

How about this?

class CPU
def mov(dest,src)
dest = src
end
end

#asm interpreter
def interpret(line)
puts line.downcase.scan(/\w+/)
instuct = line.downcase.scan(/\w+/)[0]
op1 = line.downcase.scan(/\w+/)[1]
op2 = line.downcase.scan(/\w+/)[2]
Processor.new.method(instruct).call(op1,op2)
end

I have no idea tho as to how to implement the registers and memmory.
Simon gave some ideas.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
473,795
Messages
2,569,644
Members
45,359
Latest member
1854578

Latest Threads

Top