in reply to Re: Parsing through instructions
in thread Parsing through instructions
And instructions:byte 1 byte 2 (optional) bits [ 7 6 5 4 3 2 1 0 ] [ 7 6 5 4 3 2 1 0 ] opcode - - - mod - operand1 - - - - operand2 - - - - - - - -
I am then given:opcode | instruction | operands (mod 0) | operands (mod 1) -------+-------------+------------------+----------------- 0x00 | jmp | r1 | r2:r1 0x01 | movr | r1, r2 | rx, imm 0x02 | movm | r1, [ds:r2] | [ds:r1], r2 0x03 | add | r1, r2 | r1, imm flags cmp r1, r2 instruction results in: r1 == r2 => fl = 0 r1 < r2 => fl = 0xff r1 > r2 => fl = 1 jmpe r1 => if (fl == 0) jmp r1 else nop
But pretty much like you said, I am in need of simulating a processor with given instructions.0x00 0x00 0x00 0x01 0x03 0x02 0x03 0x02 0x03 0x02
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re^3: Parsing through instructions
by GrandFather (Saint) on Apr 08, 2012 at 22:14 UTC | |
by DaveMonk (Acolyte) on Apr 08, 2012 at 23:57 UTC | |
by GrandFather (Saint) on Apr 09, 2012 at 00:09 UTC | |
by DaveMonk (Acolyte) on Apr 11, 2012 at 23:53 UTC |