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

Bug report with incorrect implementation of the command #39

Closed
listoCheck opened this issue Mar 4, 2025 · 1 comment
Closed

Bug report with incorrect implementation of the command #39

listoCheck opened this issue Mar 4, 2025 · 1 comment

Comments

@listoCheck
Copy link

MinusIf l -> do

Image

Вот пример, что команда работает неверно: (example.s f32a)
.data
input_addr: .word 0x80
output_addr: .word 0x84

.text

_start:
@p input_addr a! @
dup
inv
-if neg

finish:
@p output_addr a!
!
halt

neg:
inv
@p output_addr a!
!
halt

example.yaml:

name: "example"
limit: 2000
memory_size: 0x1000
input_streams:
0x80: [-1]
0x84: []
reports:

  • name: Check results
    slice: all
    view: |
    T A S {T:hex} {A:hex} {S:hex} R {R}
    {pc}: {instruction} {pc:label}
  • name: Result
    slice: last
    filter:
    • state
      view: |
      numio[0x80]: {io:0x80:dec}
      numio[0x84]: {io:0x84:dec}
      assert: |
      numio[0x80]: [] >>> []
      numio[0x84]: [] >>> [-1]

Результаты работы кода

Check results

T A S 0x00000000 0x00000000 0x00000000 R 0
8: FetchP 0 @_start
T A S 0x00000080 0x00000000 0x00000000 R 0
13: AStore
T A S 0x00000000 0x00000080 0x00000000 R 0
14: Fetch
T A S 0xffffffff 0x00000080 0x00000000 R #0
15: Inv
T A S 0x00000000 0x00000080 0x00000000 R 0
16: MinusIf 29
T A S 0x00000000 0x00000080 0x00000000 R 0
29: Inv @neg
T A S 0xffffffff 0x00000080 0x00000000 R 0
30: FetchP 4
T A S 0x00000084 0x00000080 0xffffffff R 0
35: AStore
T A S 0xffffffff 0x00000084 0x00000000 R 0
36: Store
T A S 0x00000000 0x00000084 0x00000000 R 0
37: Halt

Result

numio[0x80]: [] >>> []
numio[0x84]: [] >>> [-1]

@Mopstream
Copy link

Mopstream commented Mar 5, 2025

Fixed in 238abbd

@ryukzak ryukzak mentioned this issue Mar 5, 2025
@ryukzak ryukzak closed this as completed Mar 5, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants