Open hightowera opened 7 years ago
Try to look on support for handling local labels @F
(forward) and @B
(backward) in bld/wasm/c/asmlabel.c
May be extended to support "true" local symbols, but it can be dead tree. It is only quick idea.
If I modify the code (with command line switch for compatibility) to rewrite any label that starts with a '.', such as '.loop', to be extended by the current procedure name - eg. '.myfunc_loop', a) would it horribly break anything I'm not aware of, and b) is there a way to retrieve the current open proc/scope name?
You should follow MASM rules for MASM mode and TASM rules for TASM mode. I think "." (dot) on begining of symbol is used for assembler directives that should not be used for symbols. Anyway "." character is not valid symbol character.
Generaly MASM and TASM have configurable two characters for local labels that it is not fixed to @@
.
@@
is default value for both I think.
CurrProc variable should hold pointer to structure for current procedure.
WASM regression tests are available in bld/wasmtest sub-directory. During development you can run regression test quickly by command "builder buildtest" in bld/wasmtest directory. It will check current WASM build. It doesn't require any copying of build WASM to some directory or change OW environment setup.
I've looked through the WASM code and ran several tests and outside of TASM compatibility and TASM ideal mode, there doesn't appear to be local label support in the assembler; unless I'm mistaken and missed the syntax.
This would be a nice feature - ie. limited namespace scope between 'proc' and 'endp ' for labels without having simple loop points conflict with all other labels of similar nature. NASM uses a leading '.' to denote local labels and TASM ideal uses a leading @@. The former is nicer from an aesthetic point of view.
If I were to try and tackle this feature addition, anything I should lookout for?