Giter Site home page Giter Site logo

New functions about ice HOT 17 OPEN

petertillema avatar petertillema commented on July 16, 2024
New functions

from ice.

Comments (17)

Ti64CLi avatar Ti64CLi commented on July 16, 2024

You didn't add the RIGHT( function?

from ice.

PeterTillema avatar PeterTillema commented on July 16, 2024

ICE/src/functions.c

Lines 660 to 707 in 9a0a180

// RIGHT(
else if (function2 == tRIGHT) {
bool shouldParseArguments = true;
bool shouldCallRoutine = true;
if (outputPrevType == TYPE_NUMBER) {
if (outputPrevPrevType == TYPE_VARIABLE) {
LD_HL_IND_IX_OFF(outputPrevPrevOperand);
shouldParseArguments = false;
if (outputPrevOperand & 0xFF) {
LD_A(outputPrevOperand);
} else {
shouldCallRoutine = false;
}
} else if (outputPrevPrevType == TYPE_CHAIN_ANS) {
if (!outputPrevOperand) {
shouldParseArguments = false;
shouldCallRoutine = false;
expr.outputReturnRegister = expr.outputRegister;
}
} else {
return E_SYNTAX;
}
}
if (shouldParseArguments) {
if ((res = parseFunction2Args(index, REGISTER_A, true)) != VALID) {
return res;
}
}
if (shouldCallRoutine) {
OR_A_A();
ProgramPtrToOffsetStack();
if (!ice.usedAlreadyMean) {
ice.programDataPtr -= SIZEOF_MEAN_DATA;
ice.MeanAddr = (uintptr_t)ice.programDataPtr;
memcpy(ice.programDataPtr, (uint8_t*)MeanData, SIZEOF_MEAN_DATA);
ice.usedAlreadyMean = true;
}
CALL_NZ(ice.MeanAddr + 3);
ResetHL();
ResetBC();
ResetA();
}
}

from ice.

Ti64CLi avatar Ti64CLi commented on July 16, 2024

Then, why did you overlined the RIGHT( for rightshift ?

from ice.

PeterTillema avatar PeterTillema commented on July 16, 2024

Because it's implemented now, don't need to add it anymore :P

from ice.

Ti64CLi avatar Ti64CLi commented on July 16, 2024

Oh, ok, sorry for that. So, I guess LEFT is also implemented?

from ice.

Ti64CLi avatar Ti64CLi commented on July 16, 2024

It's so weird.
I saw that LEFT wasn't implemented yet
// LEFT( if (function2 == tLEFT) { }
But he works on my calc ^^'

from ice.

PeterTillema avatar PeterTillema commented on July 16, 2024

Sure it works, but it doesn't produce any code yet.

from ice.

Ti64CLi avatar Ti64CLi commented on July 16, 2024

Though, when I compile that code :
Disp LEFT(4,1)
It displays 8

from ice.

PeterTillema avatar PeterTillema commented on July 16, 2024

Yes, because both arguments are numbers, and then it gets optimized:

ICE/src/parse.c

Lines 666 to 667 in a547470

} else if (function2 == tLEFT) {
temp = outputPrevPrevOperand << outputPrevOperand;

from ice.

Ti64CLi avatar Ti64CLi commented on July 16, 2024

Ok, thank you

from ice.

Xenoxis avatar Xenoxis commented on July 16, 2024

Wait, Stop, DelVar, Menu( can be implemented ?
And if yes, will they be ?

from ice.

Xenoxis avatar Xenoxis commented on July 16, 2024

Will also be good if you can add switch statement with case

from ice.

PeterTillema avatar PeterTillema commented on July 16, 2024

Wait is essentially the same as Pause, Stop is a good one, DelVar is the same as 0->,Menu( is way too hard to implement, and switch / case looks too much like C.

from ice.

Xenoxis avatar Xenoxis commented on July 16, 2024

Is it bad if it looks like C ? Because switch can be interesting for some variables processing as interger and would be more efficient than lots of if, isen't it ?

from ice.

Ti64CLi avatar Ti64CLi commented on July 16, 2024

I agree with Xenoxis, Menu( could be very useful ;)

from ice.

LAX18 avatar LAX18 commented on July 16, 2024

I would argue against it, as it would be used on the main screen, not in the canvas mode. I, personally, do not see many ICE programs not use the drawing canvas, as ICE's main attraction is the use of the canvas to expand upon BASIC programs.

from ice.

PeterTillema avatar PeterTillema commented on July 16, 2024

Sure, Menu( is very useful, but it would be very large code, and you can 'easily' write it yourself.

from ice.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.