The new editor coming with 1.2 has some pretty neat features, it allows you to define variables and labels in a much truer ASM fashion and it also allows the removal of those pesky _ characters on some instructions.
So your original ALE code which would have looked like this:
lbl "_start:"
var_ "loopCount", N, 100
mov "loopCount", ecx
lbl "LoopStart"
loop_ "LoopStart"
mov 1, eax
int
Can now look like this:
_start:
loopCount N, 100
mov "loopCount", ecx
LoopStart:
loop "LoopStart:"
mov 1, eax
int
The XOJO code the editor outputs though is still all as it should be:
//This resets the ALE Engine for a new program
reset_ALE
//This sets the program name identifier in the engine for your code
setCodeName_ALE("SimpleLoopTest")
lbl "_start:"
var_ "loopCount",N,100
mov "loopCount",ecx
lbl "LoopStart:"
loop_ "LoopStart:"
mov 1,eax
int
//This runs the ALE Engine with the compiled program
run_ALE("_start:")
The editor is a huge improvement in the way you can develop and debug your ALE code before copying it into your own program. Itāll probably be a week or so before its ready for release, I still have some extra instructions I wish to add to the engine and I need to do a whole heap of testing.
And now even better and closer to true ASM, you no longer need all those pesky quotes in the editor either.
_start:
loopCount N, 1000000
mov loopCount, ecx
LoopStart:
loop LoopStart:
mov 1, eax
int
The outputted XOJO code is correct though
//This resets the ALE Engine for a new program
reset_ALE
//This sets the program name identifier in the engine for your code
setCodeName_ALE("NoName")
lbl "_start:"
var_ "loopCount",N,1000000
mov "loopCount",ecx
lbl "LoopStart:"
loop_ "LoopStart:"
mov 1,eax
int
But if youāre a purist and only wish to write your code in the XOJO ALE syntax then you can turn off all these helpful options in the editor.
Iām extremely flattered that you would suggest that. If I could work from home here in Australia Iād consider it, I donāt fancy moving overseas.
Though I do think my programming language background might be an issue. I learnt machine code, assembly, Delphi and XOJO in that order. I never learnt C, C++ or Appleās Objective C++ which does my head in, I canāt understand it, which is a shame, I really like Apple and I worked closely with Appleās core developers and support staff for almost 20 years when employed by Unisys to manage the Queensland TAFE environment. I suspect that most of the coding XOJO does would be in a version of C++.
The engine was only ever designed to run one instruction from one program at a time. You also have to remember that ALE is just a simulation of an 8086 CPU, it is not a real CPU and its instructions are sandboxed within the engine itself. It is not calling bare metal assembly instruction externally but instead is emulating them within itself.
Iām no expert but if you could instantiate multiple copies of the module in memory then possibly, but thatās a question for the far more experienced XOJO devs.
To be honest I donāt know, Iām not a thread expert so I can only speculate.
If the compiled code, stacks and execute method were included in a single class object then theoretically you could instantiate as many of these object as you wish. Itās not how ALE is currently designed but that seems possible.
In early assembly language it was pretty much a requirement of creating a label that the label must be at least five characters in length and ending with a colon ( : ). So assuming this, any instruction which jumps to a label doesnāt need to include the trailing colon because we can always assume there should be one. The compiler will just add it back onā¦
So we can clean up our assembly code a little further as in the following. You can see the loop instruction doesnāt have an ending colon on the label name.
_start:
loopCount N, 1000000
mov loopCount, ecx
LoopStart:
loop LoopStart
mov 1, eax
int
Well I think Iāve completed all the work on the new editor/debugger and the changes in the engine for Version 1.2. The editor make it so easy to develop your code now, and when youāve got it all working you can just copy and paste the XOJO code straight into your application. The debugger is so useful and has allowed me to find so many bugs in my code and the engine. Itās been a huge amount of work so now Iām just going to play with it for a bit to see if I can break it. Hopefully, pending no catastrophic failures, Iāll release it next week. There is now also a completely updated language reference on my Sourceforge WIKI.