In Asm, using TIOS asm routines:
Code: include '../fasmg-ez80/ez80.inc'
include '../fasmg-ez80/tiformat.inc'
include '../ti84pceg.inc'
format ti protected executable program 'ANSSTRNG'
call ti.AnsName
call ti.FindSym
call nc, ti.DelVar
ld hl, hardcoded.size
call ti.CreateStrng
inc de
inc de
ld hl, hardcoded
ldir
ret
hardcoded db ti.tP, ti.t2ByteTok, ti.tLi, ti.tSpace, ti.tEQ, ti.tSpace, ti.t3, ti.tDecPt, ti.t1, ti.t4
.size := $ - .
In Asm, using TIOS C routine:Code: include '../fasmg-ez80/ez80.inc'
include '../fasmg-ez80/tiformat.inc'
include '../ti84pceg.inc'
format ti protected executable program 'ANSSTRNG'
ld hl, hardcoded
push hl
ld hl, ans
push hl
call ti.os.CreateString
pop bc
pop bc
ret
ans db ti.tAns, 0
hardcoded dw hardcoded.size
.data db ti.tP, ti.t2ByteTok, ti.tLi, ti.tSpace, ti.tEQ, ti.tSpace, ti.t3, ti.tDecPt, ti.t1, ti.t4
.size := $ - .data
In C, using fileioc:Code: #include <fileioc.h>
#include <stdint.h>
#include <tice.h>
#define tsSpace "\x29"
#define ts1 "1"
#define ts3 "3"
#define ts4 "4"
#define tsDecPt "\x3A"
#define tsP "P"
#define tsEQ "\x6A"
#define tsLi "\xBB\xB8"
#define TI_CONST_STRING(name, value) \
struct { \
uint16_t length; \
char data[sizeof(value) - 1]; \
} name = { \
.length = sizeof(value) - 1, \
.data = value, \
}
int main() {
static const TI_CONST_STRING(hardcoded, tsP tsLi tsSpace tsEQ tsSpace ts3 tsDecPt ts1 ts4);
ti_SetVar(TI_STRING_TYPE, ti_Ans, &hardcoded);
}
In C, using TIOS C routine, when toolchain updates:Code: #include <stdint.h>
#include <tice.h>
#define tsSpace "\x29"
#define ts1 "1"
#define ts3 "3"
#define ts4 "4"
#define tsDecPt "\x3A"
#define tsP "P"
#define tsEQ "\x6A"
#define tsLi "\xBB\xB8"
#define os_Ans "\x72"
#define TI_CONST_STRING(name, value) \
struct { \
uint16_t length; \
char data[sizeof(value) - 1]; \
} name = { \
.length = sizeof(value) - 1, \
.data = value, \
}
int main() {
static const TI_CONST_STRING(hardcoded, tsP tsLi tsSpace tsEQ tsSpace ts3 tsDecPt ts1 ts4);
os_CreateString(os_Ans, (const string_t *)&hardcoded);
}