I'm sure that this is possible since the calculator has to store the line of TI-BASIC code it's executing somewhere…being able to change this value to whatever you wanted could prove to be very powerful and useful! Xeda etc., does anyone know where in RAM this value is stored and how to change it?
I answered on Cemetech already, but I will answer here, too, in case others are curious.
The OS keeps track of four things, the name of the program, the start address of it, the end address, and the address of the program counter. The first is stored as 9 bytes at 9652h, then the others are located at 965Bh, 965Fh, and 965Dh, respectively. There isn't actually a line counter, but an assembly program could start at the address found at 965Bh and then look for the byte 3Fh (ignoring the fact that 2-byte tokens could mess this up :P) to find the next line. In assembly, the CPIR command will search bytes until either the given byte is found or the counter runs out. Some untested assembly code looks like this:
bcall(_RclAns) ;OS routine to store Ans to OP1 bcall(_ConvOP1) ;converts OP1 to a 16-bit number, stored in DE. A=E ; ld a,e ;not needed, since A=E already. or d ;Returns Z flag only if A and D are both 0, implying DE is 0. ret z ;Exit if Ans is 0. push de ;Push the value of DE to the stack to later be restored ld hl,(965Fh) ;address of end of program→hl ld de,(965Bh) ;address of start of program→de or a ;precaution for zeroing the 'c' flag sbc hl,de ;subtract HL-DE, subtract aan extra 1 if 'c' flag is set ;HL is now the size of the program ld b,h ld c,l ;BC is now the size of the program. BC is the traditional 16-bit counter since it is used by any instructions requiring a counter. ex de,hl ;swap HL and DE, so HL now points to the start of the program. pop de ;value removed from stack, stored into DE. This will be our line counter. ld a,3Fh ;3Fh corresponds to a newline. ;complicated-ish conversion for DE so that we don't need to use A in the main loop. dec de inc d inc e ;At this point, we need to loop through finding lines. Loop: cpir jr nz,LineDoesNotExist jp pe,SkipSetCount0 ld de,0101h SkipSetCount0: dec e jr nz,Loop dec d jr nz,Loop dec hl ld (965Dh),hl LineDoesNotExist: ret
If it works the way I expect it to, you can throw it into ORG (clrhome.org/asm) and have it compile it into a program for you.
47%? Take a look and try to imagine how cool 100% will be. This has won zContest 2011 and made news on TICalc. This compromise between Assembly and BASIC parses like BASIC and is fast like assembly. Grammer 2