Skip to content

Commit baa56cf

Browse files
committed
Added pASM.c as a target and a few bug fixes
- Added better handling for file extensions - Made some if elif conditions if if - Fixed max_memory_sizes by initiating the instruction list lazily - Made all known error exits using logging.error followed by sys.exit(1) - Added more INFO logging for important information - Disabled many steps if they aren't needed
1 parent 3dacf1b commit baa56cf

9 files changed

+460
-112
lines changed

caesar_compile.bat

+5-2
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,5 @@
1-
py regcomp2.py ./caesar.rasm ocasar.asm --target=pASM --logging-mode=DEBUG
2-
pause
1+
@echo off
2+
py regcomp2.py ./caesar.rasm ocaesar.pasm --target=pASM
3+
py regcomp2.py ./caesar.rasm ocaesar.p --target=pASM.c
4+
py regcomp2.py ./ocaesar.p ocaesar.pasm --target=pASM
5+
pause

example_compile.bat

+3-3
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
@echo off
2-
py regcomp2.py --target=pASM ./example.rasm -o=out_example.asm --logging-mode=INFO
3-
py regcomp2.py --target=pASM ./example_big.rasm -o=out_example_big.asm --logging-mode=INFO
4-
py regcomp2.py --target=pASM ./best_example.rasm -o=out_best_example.asm --logging-mode=INFO
2+
py regcomp2.py --target=pASM ./example.rasm -o=out_example.pasm --logging-mode=INFO
3+
py regcomp2.py --target=pASM ./example_big.rasm -o=out_example_big.pasm --logging-mode=INFO
4+
py regcomp2.py --target=pASM ./best_example.rasm -o=out_best_example.pasm --logging-mode=INFO
55
pause
File renamed without changes.

ocaesar.p

201 Bytes
Binary file not shown.

ocasar.asm renamed to ocaesar.pasm

+12-12
Original file line numberDiff line numberDiff line change
@@ -23,32 +23,32 @@
2323
22 lda #0
2424
23 sta 62
2525
24 lda #3
26-
25 sta 64
26+
25 sta 67
2727
26 lda #51
28-
27 sta 65
28+
27 sta 63
2929
28 lda #57
3030
29 sta 66
31-
30 lda 64
32-
31 sta 67
31+
30 lda 67
32+
31 sta 65
3333
32 lda #32
34-
33 sta 63
34+
33 sta 68
3535
34 lda #6
36-
35 add 63
37-
36 sta 63
36+
35 add 68
37+
36 sta 68
3838
37 jmp 39
3939
38 stp
40-
39 lda (65)
40+
39 lda (63)
4141
40 jze 50
42-
41 add 67
42+
41 add 65
4343
42 sta (66)
4444
43 lda #1
45-
44 add 65
46-
45 sta 65
45+
44 add 63
46+
45 sta 63
4747
46 lda #1
4848
47 add 66
4949
48 sta 66
5050
49 jmp 39
51-
50 jmp (63)
51+
50 jmp (68)
5252
51 0
5353
52 0
5454
53 0
File renamed without changes.
File renamed without changes.

out_example_big.asm renamed to out_example_big.pasm

+1-1
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@
2020
19 sta 2
2121
20 lda 5
2222
21 lda 20
23-
22 sta 30
23+
22 sta 28
2424
23 jmp 21
2525
24 lda #1
2626
25 div 20

regcomp2.py

+439-94
Large diffs are not rendered by default.

0 commit comments

Comments
 (0)