ticalc.org
Basics Archives Community Services Programming
Hardware Help About Search Your Account
   Home :: Archives :: News :: Antidisassemblage Programming Language

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  Account Info

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: Antidisassemblage Programming Language
anykey  Account Info
(Web Page)

There is a catch: no mulitplication or division operators and no strings. That kinda' eliminates the point of using it, if you ask me.

Reply to this comment    29 April 2005, 16:49 GMT


Re: Re: Re: Antidisassemblage Programming Language
Paul Houser Account Info
(Web Page)

Yeah, really. I started reading the article and began to think... "Wow, I might start writing z80 software" Then I saw no mult/div operators... "Oh, crap, nevermind." No strings either? That does kind of eliminate the point. I hope he adds these kind of things, it seems like an awful lot amount of work to put into a project and have it go unused due to a simple problem as this.

Reply to this comment    29 April 2005, 18:26 GMT


Re: Re: Re: Re: Antidisassemblage Programming Language
houou249  Account Info
(Web Page)

Using bitshifting and char array's is just as good as using * or / or string. And bitshifting is 30x faster then * or / because is takes the processor 15 clock cycle's to do * or / while it only takes half a clock cycle to do a bitshift.

Reply to this comment    30 April 2005, 06:58 GMT

Re: Re: Re: Re: Re: Antidisassemblage Programming Language
Gergely Patai  Account Info
(Web Page)

What are you talking about? On the z80 the minimum instruction time is 4 cc. Most shifts take twice as much though. The fastest byte-byte multiplication takes almost 200 cc. Anyway, you can't use shifts effectively in a high level language on arrays, because you cannot make use of the carry flag.

Reply to this comment    30 April 2005, 07:16 GMT


Re: Re: Re: Re: Re: Re: Antidisassemblage Programming Language
Kuashio  Account Info
(Web Page)

Heh... no strings attached!...

shifting is not such a hot idea if you ask me... we might as well be using Brainf__k (don't ban this message, that's the actual name of a Turing-machine-like PL)...

I once proposed a similar idea in a ticalc forum: a PL called "calC++", which would output a program for ANY programmable calculator out there... Casio, HP, Lovely lovely Ti, Sharp, etc... me & my geeks are still working on it... hopefully we'll come up with a beta soon ;)

I dont have any of the ti's supported by Antidissassemblage :(, but i'll check it out anyway...

Reply to this comment    30 April 2005, 22:49 GMT


Re: Re: Re: Re: Re: Re: Re: Antidisassemblage Programming Language
anykey  Account Info
(Web Page)

Turing-based? Those are damn near impossible to program for.
It makes basic look advanced.
If you don't believe me, google "Turing Machine Simulator".

Reply to this comment    1 May 2005, 20:06 GMT


Re: Re: Re: Re: Re: Re: Re: Re: Antidisassemblage Programming Language
Kuashio  Account Info
(Web Page)

i was being sarcastic.
search for that programming language (type the name correctly, use your imagination).

4 example, here's a hellowolrd in BF:

>+++++++++ [<++++++++>-] <.>+++++++[<++++>-] <+.+++++++..+++.[-]
>++++++++ [<++++>-] <.>+++++++++++ [<++++++++>-] <-.--------.+++
.------.--------. [-]>++++++++[<++++>- ] <+.[-]++++++++++.

see what i mean?

Reply to this comment    2 May 2005, 14:09 GMT


Re: Re: Re: Re: Re: Re: Re: Re: Re: Antidisassemblage Programming Language
benryves  Account Info
(Web Page)

If you click the "Web Site" link above, there's a BF interpreter I wrote for thr TI-83 Plus (runs in Ion). You can create BF programs in the on-calc BASIC editor.

Reply to this comment    3 May 2005, 02:17 GMT

Re: Re: Re: Re: Re: Antidisassemblage Programming Language
Rob van Wijk  Account Info

How can something take half a cycle? I thought it was just a figure of speech, until I realized you said half a clock is thirty times faster than fifteen clocks... Is this some weird 68K thing?

But it makes things a whole lot easier if you can just say "FMyVar := FMyVar * 5" (that's Pascal) or "myVar *= 5" (for the C lovers) and have the compiler take care of the shifting.
Multiplying by any integer is possible using only shifts but it's a rather complicated trick (I've seen the code, but can't exactly reproduce it of the top of my head). I'd think this is one of the things the compiler should 'protect' you against / let you abstract from.

Reply to this comment    30 April 2005, 15:44 GMT


Re: Re: Re: Re: Re: Antidisassemblage Programming Language
Ben Phillips  Account Info

bitshifting only works for powers of two

Reply to this comment    30 April 2005, 22:47 GMT


Re: Re: Re: Re: Re: Re: Antidisassemblage Programming Language
Pooner278  Account Info

It can actually be rigged up to work for any number, it just takes some semi-abstract coding. It will work for any number and is much faster than a loop based multiplication. I don't know enough to say the same for division, but I know bitshift multiplication can be done for all numbers.

Reply to this comment    1 May 2005, 16:13 GMT

Re: Re: Re: Re: Re: Re: Re: Antidisassemblage Programming Language
benryves  Account Info
(Web Page)

In the majority of cases an "add a,a" is faster than shifting the byte leftwards.

Reply to this comment    1 May 2005, 17:51 GMT

Re: Re: Re: Re: Re: Re: Re: Antidisassemblage Programming Language
no_one_2000_  Account Info
(Web Page)

This is news to me. I only thought bitshifting worked for powers of two as well. Could somebody explain to me how this would work for other numbers (not 2^k)? I think that's rather interesting. If that could be done, then it could be integrated into the project to at least allow multiplication.

Reply to this comment    1 May 2005, 18:18 GMT

Re: Re: Re: Re: Re: Re: Re: Re: Antidisassemblage Programming Language
benryves  Account Info
(Web Page)

You cannot directly multiply a number by a non-power-of-two just by bitshifting (or at least, I assume not). However, you can do something like:

ld a,5 ; a=5

add a,a ;Shift a left: a=a*2=10
ld b,a ;b=a=10
add a,a ;a=a*2=20
add a,b ;a=a+b=20+10=30

...to provide a multiplication by 6.

Reply to this comment    1 May 2005, 19:13 GMT


Re: Re: Re: Re: Re: Re: Re: Re: Re: Antidisassemblage Programming Language
Shawn Zhang  Account Info

seems inefficient for 256!

Reply to this comment    1 May 2005, 23:32 GMT


Re: Re: Re: Re: Re: Re: Re: Re: Re: Re: Antidisassemblage Programming Language
Chris Williams  Account Info

To multiply by 256, you would do this:

xor a ; a=0, because every bit overflows :)

Actually, you'd use a register pair, like HL, like this:

ld hl,5 ; hl=5 (initial value)
ld h,l
ld l,0 ; now hl=256*5

You shouldn't just shift the bits if you know the multiplier is 256.

Reply to this comment    1 May 2005, 23:49 GMT


Re: Re: Re: Re: Re: Re: Re: Re: Re: Re: Re: Antidisassemblage Programming Language
Shawn Zhang  Account Info

nono, I meant 256 factorial, like 256*255*254... etc.

Reply to this comment    2 May 2005, 18:55 GMT


Re: Re: Re: Re: Re: Re: Re: Re: Re: Re: Re: Re: Antidisassemblage Programming Language
Chris Williams  Account Info

How else do you multiply numbers without using shift and add? That's the best way AFAIK to do it on the Z80 and other MPU's that lack a multiply instruction.

Reply to this comment    4 May 2005, 18:48 GMT


Re: Re: Re: Re: Re: Re: Re: Re: Antidisassemblage Programming Language
Pooner278  Account Info

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  Account Info

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


Re: Re: Antidisassemblage Programming Language
mike frederiksen  Account Info

antidissawhat?!?

Reply to this comment    9 May 2005, 23:45 GMT

1  2  3  4  5  6  

You can change the number of comments per page in Account Preferences.

  Copyright © 1996-2011, the ticalc.org project. All rights reserved. | Contact Us | Disclaimer