Comments (8)
Can you share a snippet of your code? I am not able to reproduce this issue. If I run this
THEBOOL = true
.ifdef THEBOOL
lda #0
.else
lda #56
.endif
I get the expected output (lda #0
)
from 6502.net.
I responded by email, but I'm thinking maybe the proper way is to write an answer here in the thread. So here it is:
I wrote a tiny project to repro it, but could not. It built just fine. I tried to repro as closely to my real project as possible, but no success. So instead I started cutting down my real project, until I got to a mere few files, while still getting the build error. I zipped and attached it to this post.
Just assemble src/main.a and that should do it. If you don’t get the error, then maybe it’s a problem that’s specific to my computer.
from 6502.net.
thanks I'll take a look
from 6502.net.
from 6502.net.
Ok I updated my project with your new code, at the same time removing all my previous custom changes, and added the "--ignore-colons" flag and... it worked! Everything built fine!
... except that when I try to build a second (and more time) I then get these errors:
vblank.a(113,1): error: Symbol "true" is not defined.
vblank.a(133,1): error: Symbol "true" is not defined.
gameloop.a(13,1): error: Symbol "true" is not defined.
gameloop.a(23,1): error: Symbol "true" is not defined.
Now, a little context is needed: I'm not running the 6502.Net code from a command line, in which the entire runtime state would be reset every time it is run. Instead, the code is run inside a persistant iOS app. I make sure to recreate a fresh new state every time I assemble, but I noticed in the code there's quite a few static data. I'm wondering if that data linger around after a first assembly, causing issues on subsequent assembling.
This is how I invoke 6502.Net every time:
// Assemble
var compiler = new C64Hub.Compiler(project);
if (compiler.IsReady)
{
compiler.Assemble();
}
That C64Hub.Compiler class is mostly:
public class Compiler
{
public bool IsReady { get; private set; }
AssemblerBase cpuAssembler = null;
AssemblyController controller = null;
public Compiler(Project project)
{
Assembler.Initialize(GenerateProjectArgs(project));
if (Assembler.Options.CPU.Equals("z80"))
{
Assembler.BinaryFormatProvider = new Z80FormatProvider();
cpuAssembler = new Z80Asm();
}
else
{
if (Assembler.Options.Format.Equals("d64"))
Assembler.BinaryFormatProvider = new D64FormatProvider();
else
Assembler.BinaryFormatProvider = new M6502FormatProvider();
cpuAssembler = new Asm6502();
}
controller = new AssemblyController(cpuAssembler);
IsReady = (cpuAssembler != null && controller != null);
}
public void Assemble()
{
if (!IsReady)
{
throw new Exception("Not ready to assemble.");
}
controller.Assemble();
}
I'm going to investigate if any static data in 6502.Net doesn't get reset properly. But hopefully you already have an idea of what's going on :)
from 6502.net.
Ahh! I see, your use case is slightly different. I honestly never thought of using this app in such a context, only a one-run kind of scenario. My assumption is that the static Assembler initialization is tied to construction of some of the main classes, like the Evaluator, the Options class, and the SymbolManager. You may have to implement some sort of state reset.
from 6502.net.
Oh wow I just realized I posted in the wrong bug thread my previous responses.. sorry about that!
But I think both can be closed now!
from 6502.net.
This was resolved. Thanks!
from 6502.net.
Related Issues (15)
- Cannot use the +/- anonymous labels preceding a macro call HOT 4
- Underscore labels not working in macro arguments HOT 2
- Sixty502DotNetParser symbol not found? HOT 2
- Something I really miss: A simple way to assemble from string to byte[] HOT 3
- Incorrect assembly for the Z80 HOT 2
- Is there any way to relate the program counter to the line in the code? HOT 2
- Assigning a label broke recently HOT 19
- Crash with the functions HOT 4
- Negative numbers not supported HOT 1
- Cannot 'lda' with the 'least significant' operator for certain negative numbers HOT 2
- [Request] Custom Args HOT 2
- Suggestion: user controlled bank size. HOT 5
- Build Errors HOT 2
- Has concatenating macro arguments changed? HOT 2
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 6502.net.