summaryrefslogtreecommitdiff
path: root/src/main.scala
diff options
context:
space:
mode:
authoriximeow <me@iximeow.net>2015-03-12 02:16:29 -0700
committeriximeow <me@iximeow.net>2015-03-12 02:16:29 -0700
commitb33bed4dbf709031b273115f6e15631e673658a9 (patch)
tree7a87bbb3a15f3d79a41ee477d3cdbe8e1d6916b1 /src/main.scala
parent16e9a180e357224bbf49f185ddbd8f33bdd69809 (diff)
get better instruction stream parsing workingHEADmaster
Diffstat (limited to 'src/main.scala')
-rw-r--r--src/main.scala6
1 files changed, 2 insertions, 4 deletions
diff --git a/src/main.scala b/src/main.scala
index f186597..4d90601 100644
--- a/src/main.scala
+++ b/src/main.scala
@@ -1,8 +1,6 @@
package ixee.re.disasm
object main extends App {
- def disassemble(bytes: Seq[String]): Seq[Option[Instruction]] = bytes.map(Instruction(_))
-
val bytes = """
3140 0044 1542 5c01
75f3 35d0 085a 3f40
@@ -19,7 +17,7 @@ f000 fd3f 3040 0a46
3e40 fcff 0e54 0e12
0f12 3012 7d00 b012
7a45 5f44 fcff 8f11
-""".replace("\n", " ").split(" ").filter(_ != "")
+""".replace("\n", " ").replace(" ", "").trim.grouped(2).toSeq
- println(disassemble(bytes).flatten.mkString("\n"))
+ println(InstructionParser(bytes).instructions.mkString("\n"))
}