how to use fift function in func? is there any useful link please?
Aug 15, 2023, 6:17 PM
for example II have a number generator in generator.fif named :generator which has one number as input and returns a hashed number
how I can call it in the my FunC method
how I can call it in the my FunC method
Aug 15, 2023, 6:25 PM
Fift is executed during compilation, so you can't.
https://docs.ton.org/develop/fift/fift-and-tvm-assembly
If you're asking about private code, you can create some public example.
Aug 15, 2023, 6:37 PM
you right, sorry.
I want to translate it as asm to reduce gas usage of my FunC code
{ 0 1 rot { 2dup + } swap times } : generator
I want to translate it as asm to reduce gas usage of my FunC code
{ 0 1 rot { 2dup + } swap times } : generator
Aug 15, 2023, 6:40 PM
I understand that you're trying to solve task 5 😀
So I will mention only part of asm code: "REPEAT:<{ 2DUP ADD }>".
So I will mention only part of asm code: "REPEAT:<{ 2DUP ADD }>".
Aug 15, 2023, 6:43 PM
https://www.youtube.com/playlist?list=PLtUBO1QNEKwttRsAs9eacL2oCMOhWaOZs
Aug 15, 2023, 6:47 PM
(int, int) get_n(int n) asm "NIL OVER 0 EQINT 0 PUSHINT s0 s4 XCHG REPEAT:<{ s3 PUSH ADD s0 s3 }> NIP";
Error: main.fif:17: }>:not a cell builder
I just start learning asm
help me please to understand what's wrong with this code, Thank you
Error: main.fif:17: }>:not a cell builder
I just start learning asm
help me please to understand what's wrong with this code, Thank you
Aug 18, 2023, 7:01 PM
ADD s0 s3 does not mean anything.
Aug 18, 2023, 7:02 PM
ADD s0 s3 XCHG does?
how to return a stack from asm ?
(int, int) get_n(int n) asm "NIL OVER 0 PUSHINT 1 PUSHINT s0 s4 XCHG REPEAT:<{ s3 PUSH ADD s0 s3 XCHG }> NIP";
s2 is returning which is array. I used document sample codes so I can not fully understand
I'm trying to understand what's going on and why I have a tuple in my s0~s4 args
(int, int) get_n(int n) asm "NIL OVER 0 PUSHINT 1 PUSHINT s0 s4 XCHG REPEAT:<{ s3 PUSH ADD s0 s3 XCHG }> NIP";
s2 is returning which is array. I used document sample codes so I can not fully understand
I'm trying to understand what's going on and why I have a tuple in my s0~s4 args
n:7 it's returns
#DEBUG#: s0 = []
#DEBUG#: s0 = 13
which should be
#DEBUG#: s0 = 21
#DEBUG#: s0 = 13
and the stacks dump is
#DEBUG#: s0 = 13
#DEBUG#: s1 = 7
#DEBUG#: s2 = []
#DEBUG#: s3 = 21
#DEBUG#: s4 = 1
#DEBUG#: s0 = []
#DEBUG#: s0 = 13
which should be
#DEBUG#: s0 = 21
#DEBUG#: s0 = 13
and the stacks dump is
#DEBUG#: s0 = 13
#DEBUG#: s1 = 7
#DEBUG#: s2 = []
#DEBUG#: s3 = 21
#DEBUG#: s4 = 1
Aug 18, 2023, 8:45 PM