Antidisassemblage Programming Language
Posted by Michael on 29 April 2005, 04:00 GMT
Dan Cook has been developing a new programming language for TI calculators. His result is called Antidisassemblage, a high-level language that is portable across the 82, 83, 83+, 85, and 86. In the words of Dan, it is "similar to C++ and Java" but also resembles TI-BASIC in a few regards. SquirrelBox is the compiler for Antidisassemblage, a Java program that should work on any platform (including Windows and Linux).
The best feature of Antidisassemblage (can you tell I love typing that name?) is that you can simply select which calculators you want to compile for - then it does all the work for you. However, the language has some limitations. There are no multiplication or division operators, no floating-point support, and no native string or character variable types. Previous attempts at a compiled BASIC-like language have not proven popular; it will be interesting to see if Antidisassemblage succeeds.
|
|
Reply to this article
|
The comments below are written by ticalc.org visitors. Their views are not necessarily those of ticalc.org, and ticalc.org takes no responsibility for their content.
|
|
Re: Antidisassemblage Programming Language
|
Chris Oliver
|
I shall be interested in seeing how popular this becomes. I am definitely going to have to test this out...
I love the name! Antidisassemblage and SquirrelBox. Great names!
This shall be interesting, compiling for all the calculators with the click of a button? There has to be some catch...Maybe not. Maybe this is the program we have all been waiting for that does EVERYTHING for you!
|
Reply to this comment
|
29 April 2005, 05:11 GMT
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
Re: Re: Re: Re: Re: Re: Re: Re: Antidisassemblage Programming Language
|
Pooner278
|
I'll try to explain. Its not 100% bitshifting, and I've never actually written a program to use it, but heres the basic idea. The two numbers A and B are being multiplied (A*B). We will save our result in C. The basic idea is that each 1 in B means A times 2 to the power of that bit is added. So start with bit 1 (the 1 value). If it is 1, add A to C. Next, look at bit 2 (the 2 value). Double A so it is *2. If bit 2 of B is 1, add A to C. Next, look at bit 3 (the 4 value). Double A so it is *4. If bit 3 of B is 1, add A to C. Next, look at bit 4 of B (the 8 value). Double A so it is *8. If bit 4 of B is set, add A to C. You get the idea for the last 4 bits. Just be careful of an overflow, maybe use a 16 bit number for C. I believe this is more efficient than simply looping, but definitely less efficient than powers of 2.
|
Reply to this comment
|
5 May 2005, 07:05 GMT
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
Re(7): Antidisassemblage Programming Language
|
Rob van Wijk
|
Here's the code:
{ A >= 0 /\ B > 0 }
|[ var b : int;
____q, r, b := 0, A, B
__; do r >= b -> b := b * 2 od
__; do b <> B
______-> q, b := q * 2, b div 2
_______; if r < b -> skip [] r >= b -> q, r := q + 1, r - b fi
____od
]|
{ q = A div B /\ r = A mod B }
Source: Programming: The Derivation of Algorithms - Anne Kaldewaij (ISBN 0-13-204108-1)
For the people who can't read GCL (Guarded Command Language), here's a Pascal version:
procedure Div ( a, b: Integer; var q, r: integer ): Integer;
// input:
// a >= 0
// b > 0
// q [doesn't matter, only used for output]
// r [doesn't matter, only used for output]
//
// output:
// q = a div b
// r = a mod b
var
__i: Integer;
begin
__q := 0;
__r := a;
__i := b;
__while r >= i do
____i := i * 2;
__while i <> b do
__begin
____q := q * 2;
____i := i div 2;
____if r < i then
______{skip}
____else
____begin
______q := q + 1;
______r := r - i;
____end
__end;
end;
In order to prevent HTML from killing multiple spaces, I used underscores. If you copy-paste this code to an editor which uses a fixed-width font, it should be a lot more readable. If you copy-paste the Pascal code to Delphi (or another Pascal compiler) and replace-all the underscores with spaces, you're ready to go.
|
Reply to this comment
|
2 May 2005, 00:27 GMT
|
|
1 2 3 4 5 6
You can change the number of comments per page in Account Preferences.
|