Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Rewrite assembler #5

Open
wants to merge 84 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
84 commits
Select commit Hold shift + click to select a range
ce1b521
assembler: start reorganizing
gipsond Apr 24, 2020
d6a5fc3
assembler: add LC-3 artifacts to gitignore
gipsond Apr 24, 2020
378ca71
assembler: make types in each IR have same name for similar concepts,…
gipsond Apr 24, 2020
5ecf289
assembler: split expanded.rs into appropriate modules
gipsond Apr 24, 2020
075f0e1
assembler: rename IR modules and their respective parse functions
gipsond Apr 24, 2020
ccc36d2
!BROKEN! assembler: rewrite memory placement, symbol table to work on…
gipsond Apr 27, 2020
5b22b25
trash
gipsond Apr 27, 2020
4b62c36
assembler: finish first pass at more complete CST
gipsond Apr 28, 2020
6c6436d
assembler: update error extraction
gipsond May 1, 2020
a8cbfc7
assembler: add validate analysis function
gipsond May 1, 2020
a3df64f
assembler: add assemble method to complete::Program
gipsond May 1, 2020
3d056a5
assembler: add messages, annotations for new errors (BUILD FIXED)
gipsond May 1, 2020
c175162
assembler: add some query methods to complete::Program CST
gipsond May 1, 2020
5509870
assembler: add single instruction integ tests for ADD, AND
gipsond Jun 29, 2020
8347a2d
assembler: add single-instruction tests for JMP, JSRR, RTI, RET, LDR,…
gipsond Jun 30, 2020
5bae064
assembler: add named trap tests, add macro to run single-instruction …
gipsond Jul 1, 2020
1a19e30
assembler: add BR, LD, LDI, ST, STI single-instruction tests (just br…
gipsond Jul 3, 2020
a3e4bc8
assembler: add LEA, JSR tests; adjust reg/pcoffset9 macro
gipsond Jul 3, 2020
928bd71
assembler: tweak reg/pcoffset9 macro to remove boilerplate from uses
gipsond Jul 3, 2020
6c18893
assembler: finish remaining single instruction tests (.FILL, .BLKW,
gipsond Jul 6, 2020
ff3833d
assembler: remove stale integ tests, add alternative style tests
gipsond Jul 8, 2020
c9d2925
misc: update UTP dependencies
gipsond May 4, 2022
02d283c
assembler: try chumsky lexer (untested)
gipsond May 5, 2022
84fd53e
assembler: add chumsky instruction parser (untested)
gipsond May 6, 2022
0ffcb8f
assembler: add full file chumsky parser (untested)
gipsond May 8, 2022
35e9273
assembler: move new lexer, parser into separate files
gipsond May 8, 2022
9b389a9
assembler: switch integration tests to new parser
gipsond May 10, 2022
b21f196
assembler: remove original assembler
gipsond May 18, 2022
aab715a
assembler: allow assembling onto OS image again
gipsond May 18, 2022
418c328
assembler: assemble all objects in given file (no overlap check)
gipsond May 18, 2022
31478b3
assembler: require terminators for opcodes et al to emulate max munch
gipsond May 18, 2022
2d2785a
assembler: add label lexing tests
gipsond May 18, 2022
a5ce20c
assembler: make lexer error-tolerant
gipsond May 18, 2022
e84d908
assembler: make parser aware of lex errors
gipsond May 19, 2022
f53d1de
assembler: add basic operand type analysis
gipsond May 21, 2022
b014e17
assembler: add error reporting with ariadne
gipsond May 21, 2022
e065028
assembler: update to clap v3, improve CLI help info
gipsond May 22, 2022
74ab585
assembler: validate bounds of numbers
gipsond May 22, 2022
5c29c45
assembler: separate analysis checks for extension
gipsond May 23, 2022
00947f4
assembler: check for duplicate labels
gipsond May 23, 2022
bce1ff3
assembler: ignore tokens outside programs as specified
gipsond May 24, 2022
2e38af5
assembler: recover if text before .ORIG invalid
gipsond May 24, 2022
b5da038
assembler: refactor analysis visitor pattern
gipsond Jun 1, 2022
18eee9c
assembler: remove mid-level unwraps, add symbol table analysis
gipsond Jun 3, 2022
6d0629f
assembler: check label offset bounds
gipsond Jun 3, 2022
6767d96
assembler: add call to exit_instruction in visit algo
gipsond Jun 4, 2022
850c4ed
assembler: add offset to distant label error message, correct math
gipsond Jun 4, 2022
1c3375b
assembler: lift location counting from analysis passes to visit algo
gipsond Jun 6, 2022
daf1ab3
assembler: insert pointer to ORIG when linking OS
gipsond Jun 6, 2022
443f3bf
assembler: re-enable bugged hex imm tests
gipsond Jun 6, 2022
0a478f7
assembler: account for null-terminator in addresses occupied by string
gipsond Jun 6, 2022
c3e9e5d
assembler: add check for object overlap
gipsond Jun 7, 2022
9670d1f
assembler: improve object overlap error label presentation
gipsond Jun 7, 2022
74d8e67
assembler: correct address used to set OS user program pointer
gipsond Jun 7, 2022
8d8f7b7
assembler: cover lex/parse errors more gracefully, esp. missing .ORIG…
gipsond Jun 9, 2022
49ff7b2
assembler: unify errors, provide API for main workflow
gipsond Jun 14, 2022
452e38e
assembler: add minimal tests for single errors
gipsond Jun 15, 2022
58c579f
assembler: rename test macros, add basic label reference tests
gipsond Jun 16, 2022
ee7d7f0
assembler: add multiple error tests, improve instruction parsing reco…
gipsond Jun 18, 2022
9350087
assembler: replace 'program' with 'region' in abstract syntax
gipsond Jun 18, 2022
3779e57
assembler: move error data and functions to new modules
gipsond Jun 18, 2022
9c8396f
assembler: rename modules after core functions
gipsond Jun 18, 2022
86153ad
assembler: split link and layer steps
gipsond Jun 19, 2022
8c8895c
assembler: remove unwrap calls from binary, unreachable calls from lib
gipsond Jun 19, 2022
a2eff30
assembler: remove unused code, move WithErrData to top level
gipsond Jun 19, 2022
48a59ad
assembler: present source path in error messages
gipsond Jun 21, 2022
dc99108
assembler: remove unused dependencies
gipsond Jun 21, 2022
e590dd7
assembler: add method to return String error report
gipsond Jun 21, 2022
7064a4a
Merge branch 'master' into chumsky
gipsond Jun 21, 2022
524c854
Merge branch 'master' into chumsky
rrbutani Jun 21, 2022
50c342f
misc: bump the MSRV to 1.56, use edition 2021
rrbutani Jun 21, 2022
0b9b55c
assembler: deduplicate some assembly code
gipsond Jun 22, 2022
262d192
assembler: document top level of library
gipsond Jun 28, 2022
89b5bac
assembler: rename link::LinkedRegion to link::Block
gipsond Jun 28, 2022
786c569
assembler: rename 'region' to 'block' or 'program block'
gipsond Jun 28, 2022
0479288
assembler: document the lex module
gipsond Jun 29, 2022
12cc003
assembler: document the parse module
gipsond Jun 30, 2022
05adfd4
assembler: allow multiple semantic analysis visitors in one pass
gipsond Jul 1, 2022
f25a50d
assembler: document the analyze module
gipsond Jul 1, 2022
b77ca8a
assembler: complete docs for all public API
gipsond Jul 5, 2022
a897466
assembler: document how to use analyze::Visit
gipsond Jul 5, 2022
ef1fee1
assembler: if strict, require BR cond codes in nzp order
gipsond Jul 6, 2022
b3dd742
assembler: disallow hanging labels in strict mode
gipsond Jul 6, 2022
29749ec
assembler: add strict label restrictions, document all restrictions
gipsond Jul 6, 2022
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions .cargo/config.toml
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
[build]
rustdocflags = "-C link-args=/STACK:8194304" # Increase stack size 8MB when running doctests
5 changes: 2 additions & 3 deletions .github/workflows/assembler.yml
Original file line number Diff line number Diff line change
Expand Up @@ -13,12 +13,11 @@ jobs:
fail-fast: false
matrix:
crate: [ lc3-assembler ]
os: [ windows-latest, ubuntu-latest, macOS-latest ]
os: [ windows-latest, ubuntu-latest, macos-latest ]
rust:
- stable
- beta
- nightly
- 1.42.0
- 1.56.1

runs-on: ${{ matrix.os }}
steps:
Expand Down
5 changes: 5 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -88,3 +88,8 @@ $RECYCLE.BIN/

# Windows shortcuts
*.lnk

# LC-3 Assembly
*.asm
*.mem
*.obj
Loading