-
Notifications
You must be signed in to change notification settings - Fork 77
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Problems with .org and equ #100
Comments
You have to think of equ as being similar to C's #define: it's basically a text (token) replacement, and does not get evaluated where it's defined. Whenever an identifier with the value of the left side of an equ is encountered, it gets replaced by the right side, and then evaluated at that position. This all happens on the token level, before the actual parsing. You should be able to achieve what you want by mostly using labels instead of equ:
Reading all equs before the actual parsing would at the very least require an additional pass over the input data, and will likely lead to additional complications and unintended side effects. For example, equ could probably be used to overwrite a builtin command that is used before the equ definition (again much like #define). |
OK it does make sense, thanks for your answer! Still something about equ though: it's not case sensitive, is that intentional? Also, is there a place more appriopriate to ask questions? Because I have some and they are not issue or something like that. Like : what are all the dll needed to use the assembler? I couldn't find the answer to that question in the source code, and depending the computer I'm using and the version of the OS, I'm not always able to run the built program |
If equ is a There isn't really a better place, unfortunately. The dependencies should be pretty light though, basically only the Visual Studio 2015 C++ redistributable (64 or 32 bit, depending on the version you built) as far as I'm aware. |
Ok, thank you again for your responses! |
Hello,
First of all, thanks for such an amazing work, your assembler makes assembly really easy to insert
Using it, I wanted to create structures or enums like this:
.org Myloc
start_new_battle_struct equ .
DoubleWordMega equ (.-start_new_battle_struct) :: .word 0, 0
YourWordLocation equ (.-start_new_battle_struct) :: .word 0
simulated_hitmarker equ (.-start_new_battle_struct) :: .word 0
SlowStartLocation equ .-start_new_battle_struct :: .word 0
size_new_battle_struct equ .-start_new_battle_struct
but it seems that all the things defined through these equ take the value 0.
Are these results normal?
Also, I have a suggestion about the equ :
Would it be possible to make the assembler read all the equ before assembling? They can't be defined twice anyway, and in some case it'd be a lot more practical.
Thanks for your time!
The text was updated successfully, but these errors were encountered: