Code Monkey home page Code Monkey logo

Comments (9)

ped7g avatar ped7g commented on July 19, 2024

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.

NEO-SPECTRUMAN avatar NEO-SPECTRUMAN commented on July 19, 2024

Ok
i'll try to isolate/localize it for example later..
there is different LUA code for each pass etc...

from sjasmplus.

NEO-SPECTRUMAN avatar NEO-SPECTRUMAN commented on July 19, 2024

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.

ped7g avatar ped7g commented on July 19, 2024

🤷‍♂️ if you see "different value in pass 3" warning, you are doing it 'wrong" (not as it was meant to be used). If it works for you, good for you, but you are really beyond the limit and on your own.

from sjasmplus.

NEO-SPECTRUMAN avatar NEO-SPECTRUMAN commented on July 19, 2024

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.

NEO-SPECTRUMAN avatar NEO-SPECTRUMAN commented on July 19, 2024

moved to "n pass" thread

from sjasmplus.

ped7g avatar ped7g commented on July 19, 2024

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.

ped7g avatar ped7g commented on July 19, 2024

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.

ped7g avatar ped7g commented on July 19, 2024

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)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo 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.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.