Comments (4)
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:
.org Myloc
start_new_battle_struct:
DoubleWordMega: .word 0, 0
YourWordLocation: .word 0
...
.if 1 ; two ways to define the size, pick one
end_new_battle_struct:
size_new_battle_struct equ (end_new_battle_struct-start_new_battle_struct)
.else ; this would add an extra label to the symbol table, may not be desired
.definelabel size_new_battle_struct, .-start_new_battle_struct
.endif
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).
from armips.
OK it does make sense, thanks for your answer!
Turned out I didn't get what was in the readme because .definelabel is the directive I needed. It's similar to as' .equ, right?
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
from armips.
If equ is a #define
, then .definelabel is a const int
. It gets evaluated in place and the actual value is then used wherever it's referenced. All symbols are case insensitive, for better or worse.
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.
from armips.
Ok, thank you again for your responses!
from armips.
Related Issues (20)
- Vector loads/stores element not checked for validity HOT 1
- No data range checks
- Enums
- Non-one-line-expanding macro in a delay slot should cause an error
- Tons of uninitialized memory access bugs HOT 9
- New validation of RSP vector instructions seems to incorrectly mark some cases as invalid HOT 11
- OT question but still related to your works
- Improve RSP immediate value range
- [feature request] get the hash for a binary file and check out the value
- .autoregion broken on latest version of armips. HOT 3
- cmp with negative immediate value off by 1 HOT 1
- missing ARM addressing modes for LDRH
- [feature request] Either inputname() or some way to .org to end of file HOT 3
- Automated builds return 404 error HOT 2
- Missing option to export symbols from armips HOT 1
- Build failure on Linux Xubuntu 22.04 LTS HOT 1
- Automated Armips Build links return 404 HOT 7
- ARM ldrsh parameter failure
- Prevent armips from relocating sections HOT 2
- Visual C++ Redistributable Dependency Not Indicated for Automated Windows Builds HOT 1
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 armips.