Encoder based on 32-bit (5-stage) pipelined MIPS processor
Assembly code <-> Machine code
How to :)
t-t-th-th-that's all folks!
First, must add/edit all operations to encode/decode
Modifying config.py
You can use editors like Atom or Notepad++ to modify this file
This must be a raw text file (.txt, .in, .out, without extension, ...). Please dont use word files(like .doc, .docx, ...)
Yeah, you can modify the number of bits that the instructions must have
For each operation, you must write his encoded form (Binary form) and his decoded form (Assembly form) Example:
#encd['operation'] = 'encode'
encd['add'] = '001xxxaaaaabbbbbtttttxxxxxxxxxxx'
decod['add'] = 'add ra, rb, rt'
encd['mov'] = '010xxxxxxxxbbbbb################'
decod['mov'] = 'mov #x, rb'
There are 2 ways to type the registers. Either ('ra,rb,rt'), either ('rs,rd,rd').
abaab -> aaabb || bbaaa
More info on config.py
- Create your input file and type on it your assembly/machine code: Example:
;Comment!
add r1,r2,r3
beq r1,r1,#3 ;OMG HOW THIS WORKS
00100010001110110010010001111011
01101110101001110100100000001100;M;O;R;E COMMENTS!
6EA7480C;Also works with hexa :)
;1 per line
- Execute the program:
- You can open a terminal on path and type
python inst-translate.py
(You can see err msg) - Or press double-clic on
inst-translate.py
- You can open a terminal on path and type
- DONE!, check output file and enjoy :)
Check it!: LICENSE