Last active
August 29, 2015 14:17
-
-
Save arunk-s/f799d1d93788d1069b2c to your computer and use it in GitHub Desktop.
Simple tavor format to generate assembly code statement
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
START = line | | |
register_name = "eax" | "ebx" | "ecx" | "edx" | |
label = +([\w]) ":" | |
inst_mov = "mov " register_name "," register_name, | |
| "mov " register_name "," +([\d]) | |
inst_add = "add " register_name "," register_name, | |
| "add " register_name "," +([\d]) | |
inst_jmp = "jmp " +([\w]) | |
inst_inc = "inc " register_name | |
inst = inst_mov | inst_add | inst_inc | inst_jmp | |
line = inst | label |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment