Comments (9)
that looks like defl
expression with forward reference? That's not a warning, that's error. defl
/=
are variable-like symbols, which can be redefined at any point of source, and their actual value is important, so they can't forward-reference other symbol. Use equ
or reorganise source to avoid forward reference.
Also warnings without ID are like "hard" warnings, almost errors, they should mark source which is actually wrong and needs fixing. Without providing particular example where you have warning on fully valid source the discussion is moot...
from sjasmplus.
Ok
i'll try to isolate/localize it for example later..
there is different LUA code for each pass etc...
from sjasmplus.
warning: Label has different value in pass 3: previous value xxx not equal xxx
there is for execute binary generation
when i know what i do
from sjasmplus.
from sjasmplus.
there is no pass 4 or pass 7
for doung it 'not wrong'
only on pass 3 i got some data which i can use
and there is NO another pass 1 pass 2 pass 3 for new code
from sjasmplus.
moved to "n pass" thread
from sjasmplus.
I'm afraid I don't fully understand. symbols are "global" and lua context is "global", above passes. The source code expansion (substitution done by DEFINE/macro) is reset per pass. So saving lua variables or labels per-pass doesn't make sense to me, as they exist outside of passes (and purpose of passes is to refine the symbol values so in last pass all symbols have correct value).
example:
LUA PASS1
debug_info_cnt = 0
function debug_info()
debug_info_cnt = debug_info_cnt + 1
print("pass "..sj.get_define("__PASS__").." line "..sj.get_define("__LINE__").." xxx="..sj.get_label("xxx")..
" (debug info called "..debug_info_cnt.." times)")
end
ENDLUA
LUA ALLPASS
debug_info()
ENDLUA
IFDEF DO_IT : DISPLAY "never" : ENDIF
DEFINE DO_IT 1
IFDEF DO_IT : DISPLAY "pass ",/A,__PASS__," display, xxx = ",/A,xxx : ENDIF
DB 1
xxx:
LUA ALLPASS
debug_info()
ENDLUA
output:
$ sjasmplus temp2.asm
SjASMPlus Z80 Cross-Assembler v1.19.0 (https://github.com/z00m128/sjasmplus)
pass 1 line 11 xxx=0 (debug info called 1 times)
pass 1 line 19 xxx=1 (debug info called 2 times)
Pass 1 complete (0 errors)
pass 2 line 11 xxx=1 (debug info called 3 times)
pass 2 line 19 xxx=1 (debug info called 4 times)
Pass 2 complete (0 errors)
pass 3 line 11 xxx=1 (debug info called 5 times)
> pass 0x0003, 3 display, xxx = 0x0001, 1
pass 3 line 19 xxx=1 (debug info called 6 times)
Pass 3 complete
Errors: 0, warnings: 0, compiled: 18 lines, work time: 0.002 seconds
so as you can see, the lua variable debug_info_cnt
or label xxx
exists across passes, the DO_IT
define gets reset ahead of every pass (so the "never" IFDEF is never true).
from sjasmplus.
if you would modify the example to do instead of DB 1
-> DS xxx+1
, it will break the "xxx" value in last pass, as it will keep moving it in every pass, so pass2 differs from pass3 and different parts of source assemble with different "xxx" value in last pass.
output:
$ sjasmplus temp2.asm
SjASMPlus Z80 Cross-Assembler v1.19.0 (https://github.com/z00m128/sjasmplus)
pass 1 line 11 xxx=0 (debug info called 1 times)
pass 1 line 19 xxx=1 (debug info called 2 times)
Pass 1 complete (0 errors)
pass 2 line 11 xxx=1 (debug info called 3 times)
pass 2 line 19 xxx=2 (debug info called 4 times)
Pass 2 complete (0 errors)
pass 3 line 11 xxx=2 (debug info called 5 times)
> pass 0x0003, 3 display, xxx = 0x0002, 2
temp2.asm(16): warning: Label has different value in pass 3: previous value 2 not equal 3
pass 3 line 19 xxx=3 (debug info called 6 times)
Pass 3 complete
Errors: 0, warnings: 1, compiled: 18 lines, work time: 0.002 seconds
from sjasmplus.
closing this as two possible actions (changing to N-pass and improving docs about 3-pass architecture) are already open in other issues, and the rest of this seems to be working by design and/or lacking more detailed information.
from sjasmplus.
Related Issues (20)
- use label as arg for macro, and then use sub label HOT 6
- lua integration is broken since at least v1.10.4, the external libs for bitwise/hex conversion don't init (`LUA_ERRSYNTAX`)
- docs: add explanation and example how 3-pass (N-pass) assemblers work and what does it mean in sjasmplus. HOT 1
- relocation -> support for 256B aligned relocation mode (useful for symbOS and NextZXOS drivers)
- Lua: fix file+line numbers in errors in more complex cases
- make "Unrecognized option" message error-like, to be harder to overlook, and affect exit code as well
- allow defining custom Devices
- WTF Dup bug HOT 2
- Building on Alpine Linux fails due to clash with constant in musl limits.h HOT 1
- SAVETAP: codeblock of 166 bytes length starting at 0xFF59 saved to .tap HOT 2
- Typo on warning
- [1.20.1][ubuntu 22.04][mingw-w64] Can't compile windows exe without modifying Makefile // Recommendation in Makefile is also not full
- if __PASS__ without endif wrong errors HOT 3
- optional saving symbol table (--sym=) WITHOUT EQU HOT 4
- full clean ram without any FCKN basic shit request HOT 2
- --exp= without export doesn't produse empty export file
- saving in doesn't existing folder causing unnecesary fatal error instead of creating new folder HOT 1
- Allow multiple labels as arguments of IFUSED HOT 3
- Multiple ORG directives silently ignored? HOT 2
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from sjasmplus.