Skip to content

Commit

Permalink
Allow usage of pseudo instruction ldr with .equ
Browse files Browse the repository at this point in the history
  • Loading branch information
linouxis9 committed Mar 28, 2019
1 parent 5abaf21 commit 36ac597
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 1 deletion.
2 changes: 1 addition & 1 deletion src/projetarm_v2/simulator/Main.java
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ public static void main(String[] args) {
"kek: .asciz \"test\";" +
".align;" +
"start: ldr r0,=kek;" +
"mov r1,#0xFF04;" +
"ldr r1,=0x1F0008;" +
"blx r1");

simulator.run();
Expand Down
1 change: 1 addition & 0 deletions src/projetarm_v2/simulator/core/Preprocessor.java
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,7 @@ public static String pass1(String assembly) {

while (matcher.find()) {
assembly = assembly.replaceAll("#"+ matcher.group(1), "#"+matcher.group(2));
assembly = assembly.replaceAll("="+ matcher.group(1), "="+matcher.group(2));
}

assembly = assembly
Expand Down

0 comments on commit 36ac597

Please sign in to comment.