on-calc asm compiler

A forum where you can announce your awesome project(s).

Moderator: MaxCoderz Staff

King Harold
Calc King
Posts: 1513
Joined: Sat 05 Aug, 2006 7:22 am

Post by King Harold »

Did you drop it then? It's way cool man! :D
@chickendude: well it ~should~ be a bit like the normal program menu, except that pressing enter would compile the selected program, if it looks like assmebly source that is (so I'll have to put something headerish that makes executing them impossible on the first line..)
But so far I could only come up with a 7 items long menu, when trying to scroll either up or down all programs disapeared from the list (no it didn't just scroll 7 down with only 7 progrs, there were 10 progs and it should scroll only 1) the numbers in front of the programs is no big deal, but somehow looping over FindAlphaUp untill you hit the first line of hte menu didn't work. (I probebly just messed it up, but I can't get it right :( )
chickendude
Extreme Poster
Posts: 340
Joined: Fri 07 Jul, 2006 2:39 pm

Post by chickendude »

Hm, in Monopoly I have a menu to select one of the properties you own (so you can view its stats) and at times you own enough properties that you have to scroll down, so I've already written something similar to what you're looking at (I think). So if you want any help, don't hesitate to ask :)
Mike K
New Member
Posts: 59
Joined: Sun 16 Jan, 2005 3:25 am
Location: St. Louis
Contact:

Post by Mike K »

Is this the same project that was just posted over on RevSoft?

-Mike
King Harold
Calc King
Posts: 1513
Joined: Sat 05 Aug, 2006 7:22 am

Post by King Harold »

@mike: No. I never posted over at RevSoft, and if someone at RevSoft is making a compiler it will doubtlessly be better.
@ chickendude: well, how do you handle scrolling? do you save to whole menu to saferam? (what if someone has 27 * (37^7) programs? the theoretical maximum of programs, although its allready way over the RAM limit with just the VAT)
User avatar
thegamefreak0134
Extreme Poster
Posts: 455
Joined: Mon 23 Jan, 2006 10:09 pm
Location: In front of a Computer, coding
Contact:

Post by thegamefreak0134 »

I do know that after the numbers in the program menu the icons to the left disappear entirely (no letters like in other menus) so you can just worry about the list. Seems to me like you would read out the program names to saferam somewhere and display from there. Of course, I don't know how to handle like if you wanted to sort the programs or anything of that nature.
I'm not mad, just a little crazy.

DarkNova - a little side project I run.
King Harold
Calc King
Posts: 1513
Joined: Sat 05 Aug, 2006 7:22 am

Post by King Harold »

Well there is this problem with displaying the names from saferam, there are 27 * (37^7) possible names, and suppose someone has "only" 1000 programs, it would terribly overflow all saferam area's together..
So I tried making it loop over a FindAlphaUp the number of programs it has to skip, but somehow it didn't really work, and it any case it would be terribly slow.
So I've been thinking about somehow intergrating it into the normal program menu, with a keyhook which also checks the context thingie, but that's gonna be complicated (how would you know what program the user selected?). In the mean time I'll work on the compiler, and I'll worry about the way to set it into action later (or when someone comes up with a brilliant idea, hey chickendude? ;) )
User avatar
thegamefreak0134
Extreme Poster
Posts: 455
Joined: Mon 23 Jan, 2006 10:09 pm
Location: In front of a Computer, coding
Contact:

Post by thegamefreak0134 »

Well, for now you could just have the user type in the name of the program. I mean, someone who's going to have the know-how to code in asm in the first place is going to be able to remember the name of their own program, right?
I'm not mad, just a little crazy.

DarkNova - a little side project I run.
User avatar
Loki
Extreme Poster
Posts: 314
Joined: Thu 18 Aug, 2005 7:01 pm
Location: My world is in grayscale, but if i stand still long enough, i see it in black and white.
Contact:

Post by Loki »

@King Harold: I dont have access to my comp at the time being, therefore learning ASM has escaped the realm of possibility. Unless you release this.
Image
King Harold
Calc King
Posts: 1513
Joined: Sat 05 Aug, 2006 7:22 am

Post by King Harold »

I'd better hurry a bit then :P
@thegamefreak: well.. I could do that.. but it doesnt't look as cool as a nice menu.. I guess it could do for a while.
User avatar
Loki
Extreme Poster
Posts: 314
Joined: Thu 18 Aug, 2005 7:01 pm
Location: My world is in grayscale, but if i stand still long enough, i see it in black and white.
Contact:

Post by Loki »

Any other way to learn asm minus a comp? Hex, maybe?
Image
User avatar
benryves
Maxcoderz Staff
Posts: 3087
Joined: Thu 16 Dec, 2004 10:06 pm
Location: Croydon, England
Contact:

Post by benryves »

Hand-assembling is rather painful. But yes, you can do it if you download an opcode table for the Z80 CPU. I wouldn't recommend it at all for anything non-trivial (ie, anything more than about 10 bytes).
King Harold
Calc King
Posts: 1513
Joined: Sat 05 Aug, 2006 7:22 am

Post by King Harold »

Try the old tasm-on-calc, the main program is basic, the assembly program is unoptimized, and its very very slow and immensely large. But it works. As does my slightly smaller yet even slower version, which I won't recommend. http://www.ticalc.org/archives/files/fi ... 38467.html
It's include file is far from complete, that it doesnt even have nop ldi cpi etc. etc. and .db gives loads of errors. (I put in 2db00 which will put 00 for every db, and I add in the data later, in the HEX string)
chickendude
Extreme Poster
Posts: 340
Joined: Fri 07 Jul, 2006 2:39 pm

Post by chickendude »

Well for the menu all you have to do is store the first (and the one before it) program in the VAT's address. Then when you scroll down you skip the first program and repopulate the list with the new set of programs. When you want to scroll up, you search from the program that came before the first one you displayed.

Here:
1: prgmB
2: prgmC
3: prgmD
4: prgmE
5: prgmF
6: prgmG
7: prgmH

Have one variable hold the pointer to PrgmB and one to PrgmA. When you scroll down, load the pointer to PrgmB and jump over it (I'm not quite sure how the VAT works, but maybe increment a few bytes until you've jumped past prgmB and it starts searching prgmC on) and repopulate the list.

EDIT: Also, if you need to you can store any information about the programs that you may need (the name, the address that data starts at, etc.) into SafeRAM for each item on the list (you should only hold information for 7 programs at once) and make sure they're all equal in size. Then when you select a program, you can count how many rows down on the screen the cursor was, multiply it by the size of the data stored on each program, and then you have the pointer to the data about the program selected and can easily work with it.
King Harold
Calc King
Posts: 1513
Joined: Sat 05 Aug, 2006 7:22 am

Post by King Harold »

Sounds like a great idea, but the VAT usually isn't sorted in any way (unless you used Sean's VAT insertion sort or an alternative method)
So wouldn't the programs appear in a seemingly random order?
Could I fix this by storing the First and Last names and FindAlphaUp with the Last as input when scrolling down and FindAlphaDown with the First when scrolling up? (and then continue with FindAlphaUp 7 times or CA=1)
King Harold
Calc King
Posts: 1513
Joined: Sat 05 Aug, 2006 7:22 am

Post by King Harold »

I have been thinking about some things, MenuCurrent+2 is only 1 bytes, thus suggesting one can only have 256 programs. Is this true?
Also this would be a great way to interface with the TIOS, just with a keyhook and a quick check on MenuCurrent+0, then on MenuCurent+1, and then on MenuCurrent+2.
Working on it.
Post Reply