petertillema / ice Goto Github PK
View Code? Open in Web Editor NEWICE Compiler for the TI-84 Plus CE
ICE Compiler for the TI-84 Plus CE
Idea: output in register A instead of HL. Not sure how much of an improvement that is.
Currently, only 10 or so basic graphics routines are displayed, despite there being stored names for way more (for example, it'd recognize "det(76", but it's not in the menu).
Also, I'd like to suggest adding a keycode utility that would show the scancode of the currently pressed keyboard key - this would be a great aid, since one wouldn't have to look at the table every time.
ICE ignores the "not(1)" part, and only sees "If ", which will very likely result in a "True".
Interestingly enough, although both codes should work (I think), the second set of code does not work:
sum(0
sum(2,'Str1',"w+",4->A
sum(4,"TICE",4,A
"TICE"->Str1
sum(0
sum(2,'Str1',"w+",4->A
sum(4,Str1,4,A
I had an older version of ICE (i'm not sure how old) and it didn't yet have the basic-subprogram feature implemented. So i just got the most recent version from Cemetech, and my program compiles fine, but it no longer runs correctly at all (even though i have not changed the source since i had the older version of ICE)
Which ones?
Test
I want to port a TI BASIC program that implements these commands but there is not good way to do it in ICE. Especially with floats coming to ICE, It would be great to have these decimal nullifying functions.
This is caused by the fact that While use a global variable, which means an inner While loop overwrites the outer While loop variable.
I want better and more code to auto-optimize the output, which is certainly possible but hard.
The size of a program can change if an other program has been compiled before.
After deleting the first compiled program, and recompiling the second one, the size change too
That's so weird ^^
Test
ICE doesn't support numbers in the output program name, only letters. Also doesn't work with CompilePrgm()
For reference, it is nearly impossible to read this code easily because of the formating. Most, if not all, asm programmers format as:
<tab>opcode<tab>operand,<space>operand
Where <tab>
is the same width, either a single space or an actual tab, otherwise everything looks like a giant wall of text. Also note the comments should be created with spaces, not with tabs; otherwise alignment becomes off when viewed in any IDE. Feel free to reject this though, these are just some pointers that will hopefully make your programming life easier. I know now it seems easy to read for you, but for everyone else it is like what. :P Also note that in Notepad++ or whatever you use, tab spacing should be set to 8
not 4
, otherwise alignment again gets thrown off.
Feel free to compare:
ld (backupSP), sp
ld hl, (begPC)
ld (backupBegPC), hl
ld hl, (curPC)
ld (backupCurPC), hl
ld hl, (endPC)
ld (backupEndPC), hl
call _RunIndicOff
call InstallHooks
ld (backupSP), sp
ld hl, (begPC)
ld (backupBegPC), hl
ld hl, (curPC)
ld (backupCurPC), hl
ld hl, (endPC)
ld (backupEndPC), hl
call _RunIndicOff
call InstallHooks
It resets them, while that is not necessary (I hope), which means that if you pop anything from the FP stack (which does happen afterwards), FPS is less than FPSBase, which causes problems when creating a variable or anything.
Requires a lot of prescanning though, but combined with other issues, that won't be a problem.
Occasionaly, ICE fails to find any source programs. A simple restart of ICE solves this problem.
Many more things could and should be optimized, like A*0. However, it's too much work writing conditions and code for it, a general framework might fit better. Then one can easily add new node optimizations as well.
When a program with an icon is compiled and run, it spits out random characters and quits. Tested with v2.2 from Cemetech archives
Given this source program:
[i]TEST
rand->A
When compiling using ICE v2.1, running prgmTEST will crash and reset the calculator.
I want a better prescanning routine to allocate space for variables. For example: 2->A:Disp A:3->B:Disp B
here A and B can use the same memory location, because B is used after A and they don't interfere. This leads to allow more variables.
When there are C functions in a subprogram which are NOT in the main program, ICE won't recognize them which will very likely result in a crash.
The DetectAny command works on the first run just fine, however, when I run it a second time, the type must be set to 0 for it to not RAM reset.
If you have an icon (and description) in your program, it will most likely reset the calc. No C function will work too.
How to do? Like 1->->X
?
This is definitely a thing I want to implement, but I'm not sure how. Would all numbers/variables be treated as float numbers? That would be much slower than just 3-byte integers. On the other side, I can't detect if a variable is a float or an integer, for example this: 2->A:If B:2.5->A
.
Whenever you have functions like rand, getKey in a C function, the output program calls the wrong address, which results in a crash.
When I add labels to my ICE programs now, they fail to be detected by the compiler and the program is not compiled.
If I do this code:
[i]RAND
Disp randInt(1,20
Pause
It (for me) always returns 17
I figured out that each time the compiled prgm is run, the rand seed is automatically reset, so it's like adding a 0->rand at the beginning of the SRC. Can the randInt thing be made like TI-OS, where the rand seed isn't automatically reset? To expand on this, can the #->rand function be added?
The FILEIOC lib has a bunch of functions to mess around with OS vars, and it would be nice if ICE can have that too.
This would, according to Mateo, solve some other issues and would be easier to work with.
Easier to pick colors.
I can't compile this code :(
There are my errors :
MAIN_CALC.C (90,38) : WARNING (197) No function prototype "ti_DetectAn
y" in scope
MAIN_CALC.C (90,69) : ERROR (152) Operands are not assignment compatib
le
make: *** [obj/main_calc.src] Error -1
The program
iTEST
Repeat K=15
getKey->K
Disp K
End
compiles and runs fine (albeit a bit wonky as Disp seems to only print in the first result section on the far right and doesn't display anything when using a string), but this program:
iTEST
Repeat K=15
getKey->K
Output(1,1,K
End
compiles but when run it never outputs anything and just ends immediately. Even removing the Repeat loop does nothing to help.
Trying to use det(17,K
in the same situation (replacing line 4) clears RAM, so some error handling needs to be put in place there. Attempting to put anything inside of toString(value[, format]
will throw a Invalid arguments!
error also. det(15,K,2
(not in given commands.html but in [TRACE] menu) and det(16,K,2
writes presumably to the screen buffer as the screen fills up with the pixel pattern black-black-green
.
These issues make it difficult to output anything to the Home screen in my experience.
Disp
does not move cursor when displaying numbers and displays nothing except 2 blank lines with stringsOutput
seems to end program early when reacheddet(17 (PrintString)
crashes calculatortoString(
throws compilation errorsdet(15 (PrintInt)
is not listed in given commands.html and writes to screen bufferdet(16 (PrintUInt)
writes to screen bufferExample:
Goto ABC
code
Lbl ABC
code
Lbl ABCD
In this case, Goto ABC actually goes to ABCD.
I found a bug. If I do For(VAR,BEG,END,-1 such as For(VAR,10,0,-1, then I compile it, with this code for example:
For(VAR,10,0,-1
Disp VAR,i
Pause
End
It displays 10 to 0, then -1, -2 etc
It seems it can't stop at 0 :(
Would you fix that?
Thank you in advance
Ti64CLi++
The C program is quite large, like 46kB excluding the C libs, and I'm sure that can be decreased by restructuring or rewriting the code.
Please add proper list support soon!
I created lists in a TI-BASIC program, but using L6 froze up my TI-84-CE. Ram got cleared, sadly.
Simple request to show the name of the output (compiled) program on the "Succesfully compiled." screen.
Also, maybe an option to run the program directly from the "Succesfully compiled." screen.
PS: It's "Successfully compiled." and not "Succesfully compiled." (missed an 's').
=3
:/
A>3=
current: ld hl, (ix+A) \ ld de, 3 \ scf \ sbc hl, de \ sbc hl, hl \ inc hl
improved: ld hl, (ix+A) \ ld de, -4 \ add hl, de \ ccf \ sbc hl, hl \ inc hl
A<3=
current: ld hl, 3 \ ld de, (ix+A) \ scf \ sbc hl, de \ sbc hl, hl \ inc hl
improved: ld hl, (ix+A) \ ld de, -3 \ add hl, de \ sbc hl, hl \ inc hl
Same with >=
and <=
, but then the number in DE would be different
LEFT( for bitshift left
RIGHT( for rightshift
ElseIf (instead of Else:If)
Stop
For people who are too lazy to use remainder(rand,...)
.
can you make it so that 1:prgmARG
does one thing and 2:prgmARG
does something else?
PROGRAM:ARGSRC
:If Ans=1
:Asm(FDCB24DE
:End
:If Ans=2
:Asm(FDCB0CE6
:End
:If Ans!=1 or Ans!=2
:Return
:End
Test for Github bot.. :)
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.