Assembly Language Core 1.4 Available

Hi Everyone,

I have just uploaded Version 1.4 which includes many changes and simulates over 100 x86 instructions. The use of overloaded methods with varying parameter types means that many Core instructions are capable of replacing many true x86 instuctions with a single method. The MOV instruction is a prime example, true assembly has dozens of different MOV instructions but in Core you currently only need the one.

Anyway this version includes many changes including the following. It also includes a simple demo project with some example code.

  • Added PUSHS, PUSHSC, POPSC, PUSHA, POPA, RDTSC, HLT, INT, TPAUSE, FCOS, FSIN, FSQRT, LSP, RDRAND and RDSEED instructions. The manual explains their purpose.
  • Updated all conditional checks to support evaluating a different register, sorely needed.
  • Added more floating point support.

You need to be mindful that just like true assembler there is no error trapping when reading and writing to the stack, so be careful that you stay within the bounds. You should only ever modify the size of the stack using PUSH and POP commands as these will auto update register ESP with the current stack size. You can also use LSP (Load Register ESP) with the stack size if you’re unsure of the size. Don’t ever just resize the stack using stack.resizeto(-1) to erase it. Unlike ALE the registers in Core are not held on the stack so you can think of the stack just like a scratch pad where you can place values to modify or pass to and from subroutines. Used together the Registers and Stack can be extremely powerful.

Anyway, as always, have fun, be kind and send me any changes or bugs you find or even any code you’d like me to troubleshoot.

Kind Regards

TC

1 Like

Hi Everyone,

I had a question on how to create a nested loop in ASM when you only have one loop counter. So here is a way to do it using just the stack and no additional maths functions. I’ll upload more example code to the site as I do them

TC

//Use register r0 to increment
mov 0, r0

//Our external loop
mov 10, ecx
While jnz(ecx)
  //push the value of ECX for our External loop
  push ecx
  
  //Our internal loop
  mov 10, ecx
  While jnz(ecx)
    inc r0
    Loop_
  Wend
  
  //Pop the value of ECX back for our External loop
  pop ecx
  loop_
Wend

R0 now equals 100

I am now officially suffering from x86 PTSD. :dizzy_face:

1 Like

Sorry :slight_smile:

Why is it deleted now?

Hi everyone I hope you’re all well,

I have enabled my forum access again for this one post so I can answer this question as to why my assembly projects are no longer available.

After receiving a number of very insulting emails about what I could do with myself, my projects and being pointedly told my contribution to the community was not appreciated, I decided to distance myself from the Xojo forum. I was actually completely devastated at the time and nearly gave up development completely. I felt removing access to all my projects the best option.

I am still working on a native assembly engine for Xojo which now for long running complex operations often outperforms natively compiled Xojo code by a factor of over 2 to 1. I am using this new engine for an educational product for use in schools and universities here in Australia.

I would like to contribute more and I feel I may have something to offer after working for Unisys for almost twenty years as a developer during which time I was almost constantly contracted to Apple.

I will leave that decision up to you, if you wish me to leave I will again disable my access.

Kindly yours

TC

Hi TC

I think any project expanding the use of Xojo is beneficial to everyone. In research, sometimes things that might look not of interest now find their use in the future. Methods, approaches , techniques etc.

Please continue with your contribution and disregard the nasty comments / unwanted noises. I am following your development with interest and see what can be done with it in the future.

The assembly language implementation might even enable Xojo to compile for Arduino or other prototyping boards in the future.

I am also using Xojo to develop teaching tools for my students. They worked great so far despite the hiccups and quirks.

Please continue to share your project and progress. all the best!

1 Like

Please don’t be discouraged. I don’t know if humans have always been this crazy or if they got even crazier in these times. Insults are something that should be taken care of by the Xojo people.

1 Like

Thanks….

TC

Thanks…

TC

Hey Trig - did this occur on this forum or offline?

You should not be discouraged by those people - there is a subset of this community that for whatever reason have a very damaging negative view of Xojo. Most of them are banned from here though so I suspect the messages have originated elsewhere.

You are pushing the boundaries - please don’t give up.

1 Like

Ignore the haters and please continue. Those few do not represent the community at large,

Also, please share those emails with moderators so we can decide what actions might be appropriate.

3 Likes

Hi Everyone,

Thank you for the kind comments, make me feel a lot better.

Here’s something to show how the development on the assembly engine is progressing. Also the engine is now completely updated to 2021r3 API2, with no warnings what so ever.

I generated a 500x500 Mandelbrot fractal with a recursion depth of 512 natively in Xojo and it took 72.75 seconds, then I did the same in Assembly Language Studio and the same MandelBrot generated in 34.667 seconds. This is using the Xojo built assembly language engine as well, not my external hand coded assembly version, which I suspect would be quicker if it didn’t keep crashing, BADLY. I’m now well exceeding native Xojo speed, especially for complex long running calculations. These timings are on a slightly older engine, I’ve now replaced a lot of code wth look up lists and completely changed the console update process which has dropped the generation time to just over 29 seconds.

The first image is natively compiled Xojo code and the second running highly optimised object code in the Assembly language Studio engine. I’m also looking at implementing predictive branching to speed up the execution even further.

TC

3 Likes

+1

That’s apparently the price you have to pay these days as soon as you go public with “anything.” The haters are lurking everywhere.

Keep up the good work!

1 Like

Thanks Kim,

I have had to delete the emails sorry as they’d upset me every time I saw them. I will share anymore I receive.

Kind Regards

TC

Hi Mark,

The emails stopped as soon as I disabled my Xojo forum access which hid my contact details, so I can only guess.

I’ll share any others I get.

Kindly yours

TC

TC, if your ALE can transpile Xojo console app codes into Arduino compliant Assembly Language, like this Arduino Simulator - Arduino in assembly language!! - Arduino Project Hub ; it would make possible to code to Arduino from Xojo.

That would be super awesome!

Trig,

Cowards always cower when faced with something that challenges them (words consciously chosen)

Don’t stop doing what you want to do.

Steve

3 Likes

Hi Hanif,

It is a relative simple process to write wrappers in Xojo to simulate the instructions the Arduino would use, and it wouldn’t be hard to write their definition and parameters to a text file so you could easily import that into the Arduino compiler.

The ALS engine I’m currently working on has a specially selected x86 instruction set for use in education for teaching programming concepts. As the entire instruction set is held in an external library it could easily be modified to use any chip instruction set, x86, ARM, 6802, z80 etc… I’m actually thinking of making it an option to choose which instruction set library you wish to use. I actually have a z80 modular computer sitting on my desk, connected via a USB cable, which I can access via a terminal to code z80 assembly directly on real hardware.

Below is a screen shot of what the editor and debugger look like with the current library, the console and graphics commands are external library calls. The debugger is displaying the compiled object code.

Kind Regards

TC

1 Like

Awesome TC!