diff options
| author | Uri Shaked | 2020-01-31 13:44:36 +0200 |
|---|---|---|
| committer | Uri Shaked | 2020-01-31 13:44:36 +0200 |
| commit | 2d4cf8e169cfd7acf6dc09cf9bcc981a98db10e7 (patch) | |
| tree | 96649e3e884d00c0ea1c5c25909cff4f344eb319 /src/utils/assembler.spec.ts | |
| parent | chore: github actions CI config (diff) | |
| download | avr8js-2d4cf8e169cfd7acf6dc09cf9bcc981a98db10e7.tar.gz avr8js-2d4cf8e169cfd7acf6dc09cf9bcc981a98db10e7.tar.bz2 avr8js-2d4cf8e169cfd7acf6dc09cf9bcc981a98db10e7.zip | |
fix(assembler): BRBC/BRBS forward labels fail
Diffstat (limited to 'src/utils/assembler.spec.ts')
| -rw-r--r-- | src/utils/assembler.spec.ts | 8 |
1 files changed, 8 insertions, 0 deletions
diff --git a/src/utils/assembler.spec.ts b/src/utils/assembler.spec.ts index 614ff3d..7b1491f 100644 --- a/src/utils/assembler.spec.ts +++ b/src/utils/assembler.spec.ts @@ -71,6 +71,14 @@ describe('AVR assembler', () => { expect(assemble('BRBS 3, -4').bytes).toEqual(bytes('f3f3')); }); + it('should correctly assemble BREQ with forward label target', () => { + expect(assemble('BREQ next \n next:').bytes).toEqual(bytes('01f0')); + }); + + it('should correctly assemble BRNE with forward label target', () => { + expect(assemble('BRNE next \n next:').bytes).toEqual(bytes('01f4')); + }); + it('should correctly assemble `CBI 0xc, 5`', () => { expect(assemble('CBI 0xc, 5').bytes).toEqual(bytes('6598')); }); |
