Giter Site home page Giter Site logo

Problems with .org and equ about armips HOT 4 CLOSED

kingcom avatar kingcom commented on August 15, 2024
Problems with .org and equ

from armips.

Comments (4)

Kingcom avatar Kingcom commented on August 15, 2024

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.

kleenexfeu avatar kleenexfeu commented on August 15, 2024

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.

Kingcom avatar Kingcom commented on August 15, 2024

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.

kleenexfeu avatar kleenexfeu commented on August 15, 2024

Ok, thank you again for your responses!

from armips.

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.