Login

Subversion Repositories NedoOS

Rev

Rev 539 | Blame | Compare with Previous | Last modification | View Log | Download | RSS feed

# file opened: lua_get_word.asm
 1    0000                  DEVICE ZXSPECTRUM48
 2    0000                  ORG 0x4443
 3    4443 41 42        test:   DEFW 0x4241
 4    4445                  OUTPUT "lua_get_word.bin"
 5    4445                  LUA ALLPASS
 6    4445 ~                    _pc("dw "..sj.get_word(_c("test"))..", ".._c("test"))
 7    4445 ~                    _pc("dw "..sj.get_word(0x4443)..", "..0x4443)
 8    4445 41 42 43 44  dw 16961, 17475
 8    4449 41 42 43 44  dw 16961, 17475
 8    444D                  ENDLUA
 9    444D
10    444D                  LUA ALLPASS
11    444D ~                    x = _c("test + ~ ")    -- invalid syntax for expression evaluation, returns 0
12    444D ~                    _pc("db 'e'+"..x)
13    444D 65           db 'e'+0
13    444E                  ENDLUA
14    444E
15    444E                  LUA pass3 ; wrong arguments
16    444E ~                    sj.get_word(0x1234, 2)  -- not reported since Lua5.4 and LuaBridge 2.6 integration :(
17    444E                  ENDLUA
18    444E
19    444E                  ; some extra error specific to get word and test coverage
20    444E                  LUA PASS3
21    444E ~                    sj.get_word(0xFFFF)     -- invalid address
22    444E ~                    sj.get_word()           -- missing argument
lua_get_word.asm(21): error: [LUA] MemGetByte: Error reading address: 65536
lua_get_word.asm(22): error: [LUA] bad argument #1 to 'get_word' (number expected, got no value)
23    444E                  ENDLUA
24    444E
# file closed: lua_get_word.asm

Value    Label
------ - -----------------------------------------------------------
0x4443   test