Skip to content

Latest commit

 

History

History
78 lines (63 loc) · 1.64 KB

README.md

File metadata and controls

78 lines (63 loc) · 1.64 KB

Welcome to ARMSIM!

ARMSIM is a basic ARM Assembly SIMulator written completely in Python.

LOGO

build


Usage

ARM code:

main: cmp r0, #3
 	  beq end
 	  add r0, r0, #1
 	  bal main
end:

Command line:

python arm.py {yourfile}

Output:

Executing :  ['ETIQ', ['MAIN']]
Executing :  ['CMP', ['r0', '#3']]
Executing :  ['BEQ', ['fin']]
Executing :  ['ADD', ['r0', 'r0', '#1']]
Executing :  ['BAL', ['main']]
Executing :  ['ETIQ', ['MAIN']]
Executing :  ['CMP', ['r0', '#3']]
Executing :  ['BEQ', ['fin']]
Executing :  ['ADD', ['r0', 'r0', '#1']]
Executing :  ['BAL', ['main']]
Executing :  ['ETIQ', ['MAIN']]
Executing :  ['CMP', ['r0', '#3']]
Executing :  ['BEQ', ['fin']]
Executing :  ['ADD', ['r0', 'r0', '#1']]
Executing :  ['BAL', ['main']]
Executing :  ['ETIQ', ['MAIN']]
Executing :  ['CMP', ['r0', '#3']]
Executing :  ['BEQ', ['fin']]
Executing :  ['ETIQ', ['FIN']]
Executing :  ['@', ['']]
r0 = 3

Detecting Errors

The Lexer and the parser are both capable of tracing errors precisely.

Example:

mov r0, #1
mov r1, #2
- mov r2, #
mov r3, #4

Command line:

python arm.py {yourfile}

Output:

Could not execute the instruction at line: 3
🛑 WARNING 🛑
Some pieces of this code are written in French and they will be eventually translated. Please feel free if you want to translate them yourself.