Show Posts

This section allows you to view all posts made by this member. Note that you can only see posts made in areas you currently have access to.


Messages - Runer112

Pages: 1 ... 96 97 [98] 99 100 ... 153
1456
Axe / Re: Referencing Text() Coordinates
« on: February 22, 2011, 03:52:13 pm »
From ti83plus.inc:

Code: [Select]
penCol equ 86D7h
penRow equ 86D8h


Also, a little-known fact regarding printing text at constant coordinates:
Code: [Select]
.Coordinate=Y*256+X
Text(30*256+20)
Text "Stuff"
Is 7 bytes smaller than:
Code: [Select]
Text(20,30,"Stuff")

The same applies for text drawn to the home screen:
Code: [Select]
.Coordinate=X*256+Y
Output(20*256+30)
Disp "Stuff"
Is smaller than:
Code: [Select]
Output(20,30,"Stuff")
By even more, 8 bytes.

1457
The Axe Parser Project / Re: Bug Reports
« on: February 22, 2011, 03:48:22 am »
I don't know if this is more of a bug report or a feature request, but none of the GetCalc() routines account for real and complex number variables lacking a 2-byte header. Although a few other data types like lists and matrices don't have a 2-byte size header, they do have a 2-byte dimension header which I think works well with the current method. However, for real and complex number variables, I would suggest the following changes.


p_GetCalc: Also optimized a byte off the page checking.

Code: (Old) [Select]
p_GetCalc:
.db __GetCalcEnd-1-$
MOV9TOOP1()
B_CALL(_ChkFindSym)
ld hl,0
ret c
inc b
dec b
ret nz
inc de
inc de
ex de,hl
ret
__GetCalcEnd:





   
Code: (New) [Select]
p_GetCalc:
.db __GetCalcEnd-1-$
MOV9TOOP1()
B_CALL(_ChkFindSym)
ld hl,0
ret c
dec b
ret p
and %00011111
ret z
cp CplxObj
ret z
inc de
inc de
ex de,hl
ret
__GetCalcEnd:




p_NewVar: No special optimizations here.

Code: (Old) [Select]
p_NewVar:
.db __NewVarEnd-1-$
B_CALL(_EnoughMem)
pop hl
ex (sp),hl
jr c,__NewVarFail
push de
MOV9TOOP1()
B_CALL(_ChkFindSym)
jr c,__NewVarSkip
B_CALL(_DelVarArc)
__NewVarSkip:
pop hl
ld a,(OP1)
B_CALL(_CreateVar)
ex de,hl
inc hl
inc hl
ret
__NewVarFail:
ld hl,0
ret
__NewVarEnd:







   
Code: (New) [Select]
p_NewVar:
.db __NewVarEnd-1-$
B_CALL(_EnoughMem)
pop hl
ex (sp),hl
jr c,__NewVarFail
push de
MOV9TOOP1()
B_CALL(_ChkFindSym)
jr c,__NewVarSkip
B_CALL(_DelVarArc)
__NewVarSkip:
pop hl
ld a,(OP1)
push af
B_CALL(_CreateVar)
pop af
ex de,hl
and %00011111
ret z
cp CplxObj
ret z
inc hl
inc hl
ret
__NewVarFail:
ld hl,0
ret
__NewVarEnd:




p_GetArc: Takes a new approach to determining if the VAT entry is variable length by comparing the VAT pointer to (progPtr) instead of throwing it out and using a list of compares and jumps based on the variable type. This also alleviates 2 other discrepancies with the previous routine, which were that the CListObj and TempProgObj variable types both have variable-length VAT entries but were not accounted for. In the end, even with the added code for checking if the type equals RealObj or CplxObj the whole thing is 3 bytes smaller than the original!

Code: (Old) [Select]
p_GetArc:
.db __GetArcEnd-1-$
push de
MOV9TOOP1()
B_CALL(_ChkFindSym)
ld hl,0
jr c,__GetArcFail
ld a,(OP1)
cp ListObj
jr z,__GetArcName
cp ProgObj
jr z,__GetArcName
cp ProtProgObj
jr z,__GetArcName
cp AppvarObj
jr z,__GetArcName
cp GroupObj
jr z,__GetArcName
__GetArcStatic:
ld hl,14
jr __GetArcDone
__GetArcName:
ld hl,9
add hl,de
B_CALL(_LoadDEIndPaged)
ld d,0
inc hl
inc hl
__GetArcDone:
add hl,de
__GetArcFail:
ex de,hl
pop hl
ld (hl),e
inc hl
ld (hl),d
inc hl
ld (hl),b
ex de,hl
ret
__GetArcEnd:



   
Code: (New) [Select]
p_GetArc:
.db __GetArcEnd-1-$
push de
MOV9TOOP1()
B_CALL(_ChkFindSym)
jr c,__GetArcFail
push de
ex de,hl
ld hl,(progPtr)
sbc hl,de
pop de
ld hl,9
jr c,__GetArcName
__GetArcStatic:
ld l,12
and %00011111
jr z,__GetArcDone
cp l ;cp CplxObj
jr z,__GetArcDone
ld l,14
jr __GetArcDone
__GetArcName:
add hl,de
B_CALL(_LoadDEIndPaged)
ld d,0
inc e
inc e
__GetArcDone:
add hl,de
ex de,hl
pop hl
ld (hl),e
inc hl
ld (hl),d
inc hl
ld (hl),b
ex de,hl
ret
__GetArcFail:
ld hl,0
pop de
ret
__GetArcEnd:






And while we're on the topic of OS variable manipulation, using GetCalc() to create variables can result in an ERR:MEMORY because it doesn't account for the size of the VAT entry or the size bytes when calling B_CALL(_EnoughMem). Here's the easy, although wrong, way to guarantee that you won't get an error. It also includes the changes I made above. The right way would probably end up bloating the routine to a massive size and wouldn't be fun to write.


Code: (Easy way) [Select]
p_NewVar:
.db __NewVarEnd-1-$
push hl
ld de,17
add hl,de
B_CALL(_EnoughMem)
pop de
pop hl
ex (sp),hl
jr c,__NewVarFail
push de
MOV9TOOP1()
B_CALL(_ChkFindSym)
jr c,__NewVarSkip
B_CALL(_DelVarArc)
__NewVarSkip:
pop hl
ld a,(OP1)
push af
B_CALL(_CreateVar)
pop af
ex de,hl
and %00011111
ret z
cp CplxObj
ret z
inc hl
inc hl
ret
__NewVarFail:
ld hl,0
ret
__NewVarEnd:


1458
The Axe Parser Project / Re: Assembly Programmers - Help Axe Optimize!
« on: February 20, 2011, 06:47:27 pm »
I felt bad last time I optimized the constant bit-checking auto optimizations because I left about half of them out, stuck with the 8-byte plain old bit check routine. But thanks to a random revelation I had while lying in bed last night, I have come back for the forgotten ones!


Code: (Original code) [Select]
p_GetBit2:
.db 7 ;7 bytes, 49 cycles
xor a
add hl,hl
add hl,hl
add hl,hl
ld h,a
rla
ld l,a
p_GetBit3:
.db 8 ;8 bytes, 30/29 cycles
bit 4,h
ld hl,0
jr z,$+3
inc l

p_GetBit4:
.db 8 ;8 bytes, 30/29 cycles
bit 3,h
ld hl,0
jr z,$+3
inc l

p_GetBit5:
.db 8 ;8 bytes, 30/29 cycles
bit 2,h
ld hl,0
jr z,$+3
inc l

p_GetBit10:
.db 7 ;7 bytes, 49 cycles
xor a
add hl,hl
add hl,hl
ld h,a
add hl,hl
ld l,h
ld h,a
p_GetBit11:
.db 8 ;8 bytes, 30/29 cycles
bit 4,l
ld hl,0
jr z,$+3
inc l

p_GetBit12:
.db 8 ;8 bytes, 30/29 cycles
bit 3,l
ld hl,0
jr z,$+3
inc l

p_GetBit13:
.db 8 ;8 bytes, 30/29 cycles
bit 2,l
ld hl,0
jr z,$+3
inc l

 
   
Code: (Optimized code) [Select]
p_GetBit2:
.db 7 ;7 bytes, 37 cycles
ld a,h
set 5,h
cp h
sbc hl,hl
inc hl


p_GetBit3:
.db 7 ;7 bytes, 37 cycles
ld a,h
set 4,h
cp h
sbc hl,hl
inc hl
p_GetBit4:
.db 7 ;7 bytes, 37 cycles
ld a,h
set 3,h
cp h
sbc hl,hl
inc hl
p_GetBit5:
.db 7 ;7 bytes, 37 cycles
ld a,h
set 2,h
cp h
sbc hl,hl
inc hl
p_GetBit10:
.db 7 ;7 bytes, 37 cycles
ld a,l
set 5,l
cp l
sbc hl,hl
inc hl


p_GetBit11:
.db 7 ;7 bytes, 37 cycles
ld a,l
set 4,l
cp l
sbc hl,hl
inc hl
p_GetBit12:
.db 7 ;7 bytes, 37 cycles
ld a,l
set 3,l
cp l
sbc hl,hl
inc hl
p_GetBit13:
.db 7 ;7 bytes, 37 cycles
ld a,l
set 2,l
cp l
sbc hl,hl
inc hl
 

1459
The Axe Parser Project / Re: Features Wishlist
« on: February 20, 2011, 06:28:12 pm »
Code: [Select]
179->A
For(B,0,7)
If bit{A*8+B}
.Do Stuff
End
End

It already is possible to extract single bits from a byte or word with the e command (that's Euler's constant, not just a plain lowercase e). For instance, AeB would retrieve the Bth bit of the low byte of A, with B=0 corresponding to the most significant bit and B=7 corresponding to the least significant bit. The code you posted could be emulated with the following:

Code: [Select]
{POINTER}→A
For(B,0,7)
If AeB
.Do Stuff
End
End

1460
TI Z80 / Re: TI Program Editor: hAxe'd
« on: February 20, 2011, 10:29:01 am »
Hmm... The version I have isn't actually part of TI-Connect, so it might be a bit different. But I would suggest looking for a folder (probably where TI-Connect is installed) that contains files like these, most importantly 83PlusDictionary.xml and TI-83 PlusFunctionTree.tree because those are the 2 files that need to be replaced. If you can't find them manually, maybe try searching your computer for 83PlusDictionary.


1461
TI Z80 / Re: TI Program Editor: hAxe'd
« on: February 20, 2011, 10:13:25 am »
I may be wrong, but aren't .xml files platform independent? In that case you could just use these same 2 files with a Mac version and it would work just like with the Windows version.

1462
TI Z80 / Re: TI Program Editor: hAxe'd
« on: February 20, 2011, 10:05:48 am »
I didn't touch the executable code, I have no idea how any of it works. I just spent a while modifying 2 .xml files that govern tokens and the catalog.

1463
TI Z80 / TI Program Editor: hAxe'd
« on: February 20, 2011, 06:44:30 am »

TL;DR: 2 modified .xml files for TI's Program Editor to convert it from a TI-BASIC into an Axe program editor.



I like programming for calculators on the computer for a few reasons. You have a much larger space to work with, things like copy, paste, undo, redo, etc. Also, your programs are always safe on your computer if your calculator crashes.

A lot of my calculator programming is done in Axe. Because the Axe language is based on TI-BASIC tokens and programs, I write and edit my programs with the TI-BASIC program editor called "TI Program Editor" bundled with TI-CONNECT. Unfortunately, TI decided to remove the only useful program to me from the TI-CONNECT suite, so you can't download it from TI anymore. You may or may not be able to find a download link in the description of a video from a YouTube search, though...

Anyway, I write Axe programs with this software that was intended for editing TI-BASIC programs. Because of this, it obviously lacks things like Axe token replacements and such. Even worse, it doesn't properly support some tokens like lowercase letters, making some programs impossible to open and others annoying to edit. And although it has a nice catalog of commands and calculator tokens to select from, it can be tedious to navigate it and find the Axe commands you want. Anyways, it looks like this:




It definitely has some nice features for TI-BASIC program editing:
  • Tabbed file management
  • Easily edit program details like the name it will be on a calculator or lock status
  • The usual text editing features like cut, copy, paste
  • A font specifically designed to mimic the font on the TI calculators and display special characters very nicely
  • A categorized catalog of special symbols and all the functions you would find on your normal calculator, often sorted by an identical menu system
  • Token hotkeys, useful for quickly entering common tokens you can't type on a keyboard

For an Axe programmer, a lot of those features are just as nice as for a TI-BASIC programmer. But the fact that it wasn't designed for Axe programming, chokes on some lowercase letters, and has a few other quirks sometimes made it difficult for me to write Axe programs on it. I could have decided to write my own Axe IDE, but I'm lazy. So I decided to just modify TI's already existing and pretty well-developed program editor. The same program you saw above with two modified source files suddenly becomes so much more Axe friendly:




Every token that displays differently in Axe has been changed to its Axe equivalent, so no more needing to look up which rotate command Shade_t() was! Commands actually make sense! And you can now simply type something like Copy( and not wonder why you get a compile error at the "o". Additionally, although the old catalog of tokens and TI-BASIC commands remains in a section called "Normal" in the command chooser, a whole new section exists just for Axe! In this section are tokens for every symbol, variable, and constant used in Axe, followed by tokens for every Axe command. And if you're familiar with the Commands.htm file included in Axe releases, it should be a piece of cake to navigate the commands because they're sorted in the same exact order. I just finished this myself so haven't been able to fully try programming with it, but I'm sure it will be a lot nicer programming in Axe with it now than without it.



If you have TI's Program Editor and want to test this out, I have attached a zip file containing the two modified xml files that constitute this modification. To hAxe the program, simply find the directory it exists in and replace "83PlusDictionary.xml" and "TI-83 PlusFunctionTree.tree" with the modified versions in the zip file. It may be a good idea to back up the originals first, though.

And once you've tested it out, tell me how it is!

1464
TI Z80 / Re: Pokemon TI
« on: February 19, 2011, 11:28:35 pm »
Your confusion might stem from the fact that Axe enumerates the bits in bytes backwards compared to most other assembly standards. This means that, contrary to Axe's system of bit numbering, in assembly bit 0 is actually the least significant bit and bit 7 is the most significant bit in a byte. So you don't want to look at the data like this:

A4       03       38       C0       03       08       06
10100100 00000011 00111000 11000000 00000011 00001000 00000110

You want to look at it like this:

A4       03       38       C0       03       08       06
00100101 11000000 00011100 00000011 11000000 00010000 01100000

1465
News / Re: TI-Nspire CX - The Next Generation
« on: February 19, 2011, 04:15:23 pm »
Docs on the TI-Nspire CX Wireless Adapter:

https://fjallfoss.fcc.gov/oetcf/eas/reports/ViewExhibitReport.cfm?mode=Exhibits&RequestTimeout=500&calledFromFrame=N&application_id=336646&fcc_id='V7R-TINAVWNA'



Here's a picture from one of the pdf's. Click for a larger size.


1466
The Axe Parser Project / Re: Features Wishlist
« on: February 18, 2011, 11:46:59 pm »
Could you give axioms the ability to define their own Fix statements? As far as I can tell, the parser handles Fix statements as special cases anyways, merging two one-byte tokens into one command. I believe it would be invaluable for Axiom programmers to be able to provide settings for their commands with their own Fix statements, whether they are expanded to allow arguments greater than 2 digits like Fix 10, or at least allow any second token to be appended, like Fix A, or even something like Fix  or .


EDIT: Also, any chance of support for Axioms followed by a store token? Like: Pt-On(X,Y,PIC)→BUFF


EDIT 2: Oh yeah, and is the limit of 32 entries per Axiom listed in the documentation a technical limitation? Because if not, any chances that limit could be lifted? I forsee something I'm working on passing 32 entries. A lot of them are just custom variable defines and slightly varying calls (number of arguments, r modifiers) for a few actual routines, but the total number is bound to surpass 32.

1467
Axe / Re: Axe Q&A
« on: February 18, 2011, 08:21:54 pm »
You definitely won't be dealing with anything over 65535, because the calculator is physically incapable of storing a number larger than that in its 16-bit registers. When it comes down to signs, the only difference between an unsigned and a signed number is just how you interpret the number. ⁻1 and 65535 are stored exactly the same on the calculator. It has no idea if it should be unsigned or signed. The only thing that "makes" a number signed is if you treat it as so.

The sin() function is periodic, meaning that for every 256 input values, it loops back around to where it started. For example, sin(254) would return the same result as sin(510) or sin(⁻2) (which is the same exact thing as sin(65534)), so you don't even have to worry about negative inputs.

Regarding the locations of variables in RAM, you can find the pointer to any variable by prefixing the variable with a degree symbol, such as °A. There are 27 2-byte variables, and they are stored in a contiguous 54-byte section of RAM in the order A,B,C,...,Z,θ. The variables start, by default, at the hexadecimal location $89B6 in RAM, which is equal to L1+714.

1468
Axe / Re: Axe Q&A
« on: February 18, 2011, 07:11:51 pm »
Whoops, not sure how those sub's got in there... I fixed both blocks of code now.

1469
Axe / Re: Axe Q&A
« on: February 18, 2011, 07:05:44 pm »
This is effectively what it does, only this is larger and slower.

Code: [Select]
.Top Left
29-O/2/2/2+J*[map_width]+(45-N/2/2/2+I)+E
.Top Right
29-O/2/2/2+J*[map_width]+(51-N/2/2/2+I)+E
.Bottom Left
35-O/2/2/2+J*[map_width]+(45-N/2/2/2+I)+E
.Bottom Right
35-O/2/2/2+J*[map_width]+(51-N/2/2/2+I)+E

1470
Axe / Re: Axe Q&A
« on: February 18, 2011, 06:40:21 pm »
I use r5 and r6 to avoid having to redo calculations, they're not necessarily the actual results. Each line gives the result for the corner specified in the comment above it, so if you wanted to store the results to a variable for instance, you'd have to add a →VAR to the end of those lines.

Pages: 1 ... 96 97 [98] 99 100 ... 153