Skip to content

Commit

Permalink
fix shift right issue
Browse files Browse the repository at this point in the history
Signed-off-by: yzamir <[email protected]>
  • Loading branch information
yaacov committed Oct 3, 2023
1 parent 4cfb95b commit d79dbe4
Show file tree
Hide file tree
Showing 2 changed files with 38 additions and 1 deletion.
37 changes: 37 additions & 0 deletions examples/lee.asm
Original file line number Diff line number Diff line change
@@ -0,0 +1,37 @@
JUMP START

DAT1: DATA 0x00
DAT2: DATA 0x00
DAT3: DATA 0x00
DAT4: DATA 0x00
DAT5: DATA 0x00
DAT6: DATA 0x00
DAT7: DATA 0x00
DAT8: DATA 0x00
DAT9: DATA 0x00
DATA: DATA 0x00
DATB: DATA 0x00

START:

LOADA NUM2
STOREA DAT5
LOADA NUM1
STOREA DAT3
LOADA NUM1
STOREA DAT4
LOADA NUM3
STOREA DAT6
LOADB NUM4
STOREB DAT9
SHRB 1
STOREB DAT8
SHRB 1
STOREB DAT7

END

NUM1: DATA 0x08
NUM2: DATA 0x6E
NUM3: DATA 0x21
NUM4: DATA 0x04
2 changes: 1 addition & 1 deletion src/opcodes.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,7 @@ export const opcodesParams = {
[opcodes.NOTA]: 0,
[opcodes.NOTB]: 0,
[opcodes.SHLA]: 1,
[opcodes.SHLB]: 2,
[opcodes.SHLB]: 1,
[opcodes.SHRA]: 1,
[opcodes.SHRB]: 1,
[opcodes.JUMP]: 1,
Expand Down

0 comments on commit d79dbe4

Please sign in to comment.