Skip to content

hediturki123/ARMSIM

 
 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

14 Commits
 
 
 
 
 
 
 
 
 
 

Repository files navigation

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.

About

A basic simulator for ARM

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages

  • Python 100.0%