?login_element?

Subversion Repositories NedoOS

Rev

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

# file opened: lua_get_byte.asm
 1    0000                  DEVICE ZXSPECTRUM48
 2    0000                  ORG 0x7842
 3    7842 41 78        test:   DEFB 0x41, 0x78
 4    7844                  OUTPUT "lua_get_byte.bin"
 5    7844                  LUA ALLPASS
 6    7844 ~                    _pc("db "..sj.get_byte(sj.calc("test"))..", "..sj.calc("low test"))
 7    7844 ~                    _pc("db "..sj.get_byte(0x7842)..", "..0x42)
 8    7844 41 42        db 65, 66
 8    7846 41 42        db 65, 66
 8    7848                  ENDLUA
 9    7848
10    7848                  LUA ALLPASS
11    7848 ~                    x = sj.calc("test + ~ ")    -- invalid syntax for expression evaluation, returns 0
12    7848 ~                    _pc("db 'e'+"..x)
13    7848 65           db 'e'+0
13    7849                  ENDLUA
14    7849
15    7849                  LUA pass3 ; wrong arguments
16    7849 ~                    sj.get_byte(0x1234, 2)      -- not reported since Lua5.4 and LuaBridge 2.6 integration :(
17    7849                  ENDLUA
18    7849
19    7849                  ; extra test coverage
20    7849                  LUA PASS3
21    7849 ~                    sj.get_byte()               -- missing argument
lua_get_byte.asm(21): error: [LUA] bad argument #1 to 'get_byte' (number expected, got no value)
22    7849                  ENDLUA
23    7849
# file closed: lua_get_byte.asm

Value    Label
------ - -----------------------------------------------------------
0x7842   test