Commit 5f016ad
authored
Fix assembler.py
Fix: Bug fixes in stack management, division by zero, and string handling
- Fixed stack underflow in `pop` command
- Handled division by zero in `div` instruction
- Validated empty files before processing
- Added exception handling for return stack
- Improved string assignment in `mov` instruction1 parent e5945cb commit 5f016ad
1 file changed
+12
-3
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
996 | 996 | | |
997 | 997 | | |
998 | 998 | | |
999 | | - | |
| 999 | + | |
1000 | 1000 | | |
| 1001 | + | |
1001 | 1002 | | |
1002 | | - | |
| 1003 | + | |
| 1004 | + | |
| 1005 | + | |
1003 | 1006 | | |
1004 | 1007 | | |
1005 | 1008 | | |
| |||
1161 | 1164 | | |
1162 | 1165 | | |
1163 | 1166 | | |
1164 | | - | |
| 1167 | + | |
1165 | 1168 | | |
1166 | 1169 | | |
1167 | 1170 | | |
| |||
1249 | 1252 | | |
1250 | 1253 | | |
1251 | 1254 | | |
| 1255 | + | |
| 1256 | + | |
| 1257 | + | |
1252 | 1258 | | |
1253 | 1259 | | |
1254 | 1260 | | |
| |||
1454 | 1460 | | |
1455 | 1461 | | |
1456 | 1462 | | |
| 1463 | + | |
| 1464 | + | |
| 1465 | + | |
1457 | 1466 | | |
1458 | 1467 | | |
1459 | 1468 | | |
| |||
0 commit comments