DaveTCode / zmachine-golang

A Z-Machine interpreter written in golang specifically to learn a little about golang and because it's fun
MIT License
0 stars 0 forks source link

Fix object issues highlighted by the czech test suite #15

Closed DaveTCode closed 3 weeks ago

DaveTCode commented 3 weeks ago
PS C:\code\home\emulation\zmachine> go run . --rom .\czech.z5
0.8
Test numbers appear in [brackets].

print works or you wouldn't be seeing this.

                                           Jumps [2]: jump.je..........jg.......jl.......jz...offsets..
Variables [32]: push/pull..store.load.dec.......inc.......
    dec_chk...........inc_chk.........
Arithmetic ops [70]: add.......sub.......
    mul........div...........mod...........
Logical ops [114]: not....and.....or.....art_shift........log_shift........
Memory [144]: loadw.loadb..storeb..storew...
Subroutines [152]: call_1s.call_2s..call_vs2...call_vs.....ret.
    call_1n.call_2n..call_vn..call_vn2..
    rtrue.rfalse.ret_popped.
    Computed call...
    check_arg_count................
Objects [193]: get_parent....get_sibling.......get_child......jin.......
    test_attr......set_attr....clear_attr....set/clear/test_attr..
    get_next_prop......get_prop_len/get_prop_addr....
    get_prop..........put_prop ..........
    remove..insert..

ERROR [266]  Expected 6; got 0

ERROR [267]  Expected 0; got 7

...
    Spec1.0 length-64 props.

[273] (
DaveTCode commented 3 weeks ago

Problem resolved, partially because of a bad implementation of remove_obj and partially due to not handling 0 length properties (which should be treated as length 64)