ALE Assembly Language Engine 1.1 now available

Hi Everyone,

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.

Regards

Trig

2 Likes

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.

:slight_smile:

This is quite amazing - think Xojo should be employing this guy!

1 Like

What happens if Thread1 starts a long-running ALE process, and Thread2 starts a different one?

Thanks Mark,

I’m extremely flattered that you would suggest that. :slight_smile: 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++.

Thanks again

Trig

Hi Kem,

I’m sorry that wouldn’t work.

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.

Regards

Trig

Is it technically possible to set up multiple engines?

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. :frowning:

Trig

Sorry, I don’t mean with your implementation, I mean is there any technical reason it couldn’t be done?

And you can instantiate instances of classes, not modules.

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

Hi Everyone,

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.

https://sourceforge.net/p/ale-assembly-language-engine/wiki/ALE%20Language%20Reference/

Regards

TC