Author Topic: T4x asm documentation  (Read 27429 times)

0 Members and 1 Guest are viewing this topic.

Offline critor

  • Editor
  • LV11 Super Veteran (Next: 3000)
  • ***********
  • Posts: 2079
  • Rating: +439/-13
    • View Profile
    • TI-Planet
T4x asm documentation
« on: July 21, 2011, 01:13:35 pm »
Finally, I managed to get my hands on a consequent T4x asm documentation.

The 4-bit T4x CPU from Toshiba is used in all recent TI scientific calculators:
- TI-30XB/XS MultiView
- TI-30X Pro MultiView
- TI-34 MultiView
- TI-36X Pro


Check on TI-Bank:
http://ti.bank.free.fr/index.php?mod=news&ac=commentaires&id=1254



Why don't you switch your TI-Nspire 3.0/CX calculator with one of those? Their hardware is much more open, and I'm sure there is nor RSA key securing it! :P
« Last Edit: July 21, 2011, 01:14:07 pm by critor »
TI-Planet co-admin.

Offline Juju

  • Incredibly sexy mare
  • Coder Of Tomorrow
  • LV13 Extreme Addict (Next: 9001)
  • *************
  • Posts: 5730
  • Rating: +500/-19
  • Weird programmer
    • View Profile
    • juju2143's shed
Re: T4x asm documentation
« Reply #1 on: July 21, 2011, 03:10:37 pm »
Well, that's awesome :) So we can program on the TI-30 now?

Remember the day the walrus started to fly...

I finally cleared my sig after 4 years you're happy now?
THEGAME
This signature is ridiculously large you've been warned.

The cute mare that used to be in my avatar is Yuki Kagayaki, you can follow her on Facebook and Tumblr.

Offline critor

  • Editor
  • LV11 Super Veteran (Next: 3000)
  • ***********
  • Posts: 2079
  • Rating: +439/-13
    • View Profile
    • TI-Planet
Re: T4x asm documentation
« Reply #2 on: July 21, 2011, 03:34:00 pm »
Not yet, but if someone takes the time to work on that document and on the calculator ROM dumps (which can be extracted from the official emulators with my tool linked in the TI-Bank news), it might be the case soon.
TI-Planet co-admin.

Offline Lionel Debroux

  • LV11 Super Veteran (Next: 3000)
  • ***********
  • Posts: 2135
  • Rating: +290/-45
    • View Profile
    • TI-Chess Team
Re: T4x asm documentation
« Reply #3 on: July 21, 2011, 03:36:33 pm »
Congratulations for finding this documentation :)
Member of the TI-Chess Team.
Co-maintainer of GCC4TI (GCC4TI online documentation), TILP and TIEmu.
Co-admin of TI-Planet.

Offline critor

  • Editor
  • LV11 Super Veteran (Next: 3000)
  • ***********
  • Posts: 2079
  • Rating: +439/-13
    • View Profile
    • TI-Planet
Re: T4x asm documentation
« Reply #4 on: July 21, 2011, 03:46:38 pm »
Thanks :)
I've been looking for it for months...


It might be usefull to get the T4x asm tools mentionned in the documentation.
But Google doesn't seem to know these files...


- smac4x

- mac4x

- tumpl.exe

- tuapp

- sapp4x.exe

- fal4x.exe

- conv4x.exe

- asm4x.exe
ASM4X Relocatable Assembler V0.1o (UDE)
ASM4X Relocatable Assembler V0.1r (UDE)
Copyright(C) 1992 TOSHIBA CORPORATION All rights reserved

- link4x.exe
T4X Linkage Editor V0.1k(UDE)
T4X Linkage Editor V0.1l(UDE)
Copyright(C) 1992 TOSHIBA CORPORATION All rights reserved.

- ISTPBJ.EXE

- BUILDER.EXE
T8X/T4X Program Builder


If anybody finds something, please post here.
TI-Planet co-admin.

Offline Jim Bauwens

  • Lua! Nspire! Linux!
  • Editor
  • LV10 31337 u53r (Next: 2000)
  • **********
  • Posts: 1881
  • Rating: +206/-7
  • Linux!
    • View Profile
    • nothing...
Re: T4x asm documentation
« Reply #5 on: July 21, 2011, 04:21:56 pm »
I found this page: http://www.cfpt.com.tw/eng_p2.htm , which contains "asm4x.exe".
Don't know if its the right file though...

Offline Lionel Debroux

  • LV11 Super Veteran (Next: 3000)
  • ***********
  • Posts: 2135
  • Rating: +290/-45
    • View Profile
    • TI-Chess Team
Re: T4x asm documentation
« Reply #6 on: July 22, 2011, 02:38:07 am »
Nope, it seems to be different.
Member of the TI-Chess Team.
Co-maintainer of GCC4TI (GCC4TI online documentation), TILP and TIEmu.
Co-admin of TI-Planet.

Offline thepenguin77

  • z80 Assembly Master
  • LV10 31337 u53r (Next: 2000)
  • **********
  • Posts: 1594
  • Rating: +823/-5
  • The game in my avatar is bit.ly/p0zPWu
    • View Profile
Re: T4x asm documentation
« Reply #7 on: July 22, 2011, 06:52:14 pm »
I've got a Ti-34 multiview and I've always wanted to hack it, or find a hidden menu or something. So I just downloaded all the files.

This will be around my 6th programming language if I do it :D
zStart v1.3.013 9-20-2013 
All of my utilities
TI-Connect Help
You can build a statue out of either 1'x1' blocks or 12'x12' blocks. The 1'x1' blocks will take a lot longer, but the final product is worth it.
       -Runer112

Offline ztrumpet

  • The Rarely Active One
  • CoT Emeritus
  • LV13 Extreme Addict (Next: 9001)
  • *
  • Posts: 5712
  • Rating: +364/-4
  • If you see this, send me a PM. Just for fun.
    • View Profile
Re: T4x asm documentation
« Reply #8 on: July 22, 2011, 09:50:12 pm »
This is really cool.  Good luck to all involved. ^-^

Offline critor

  • Editor
  • LV11 Super Veteran (Next: 3000)
  • ***********
  • Posts: 2079
  • Rating: +439/-13
    • View Profile
    • TI-Planet
Re: T4x asm documentation
« Reply #9 on: July 23, 2011, 11:11:45 am »
I've got a Ti-34 multiview and I've always wanted to hack it, or find a hidden menu or something.

I've allready digged into those ROMs, but I couldn't find any string related to a hidden self test menu or something like that.
TI-Planet co-admin.

Offline apcalc

  • The Game
  • CoT Emeritus
  • LV10 31337 u53r (Next: 2000)
  • *
  • Posts: 1393
  • Rating: +120/-2
  • VGhlIEdhbWUh (Base 64 :))
    • View Profile
Re: T4x asm documentation
« Reply #10 on: July 23, 2011, 12:57:13 pm »
This appears to be quite interesting, excellent work critor! ;)


Offline critor

  • Editor
  • LV11 Super Veteran (Next: 3000)
  • ***********
  • Posts: 2079
  • Rating: +439/-13
    • View Profile
    • TI-Planet
Re: T4x asm documentation
« Reply #11 on: July 23, 2011, 06:33:00 pm »
By the way, if you want to modify the dumped T4x ROMs and make some basic tests, my online emulator might be of some use to you.

http://xandrean.free.fr/T4X/TIScientific.html
« Last Edit: July 23, 2011, 06:34:03 pm by critor »
TI-Planet co-admin.

Offline Goplat

  • LV5 Advanced (Next: 300)
  • *****
  • Posts: 289
  • Rating: +82/-0
    • View Profile
Re: T4x asm documentation
« Reply #12 on: July 24, 2011, 03:42:50 am »
I went through the emulator's ProcessorCoreT4xFunctions class to make a quick list of what each instruction does; hopefully this will help in understanding the instructions that weren't mentioned in the document.

Code: [Select]
opcode  fields           cycles flags description
 0 0000 1111114433---222 1 -- nop (f3=0), halt (f3=2)
   0100                 invalid
   0200                 2 -- PC = PC + 1 + reg[f2]
   0300                 3 -- pop PC
 1 0400 1111114433332222 2 -- M = low byte of ROM[reg7:reg6:reg5:reg4]
   0500                 2 -- M = high byte of ROM[reg7:reg6:reg5:reg4]
   0600                 1 -- M = f2, L = L + f3
   0700                 1 -- M = f3:f2
 2 0800 11111144----2222 2 ZC add M, f2
   0900                 invalid
   0A00                 2 ZC sub M, f2
   0B00                 invalid
 3 0C00 11111144----2222 2 Z- and M, f2
   0D00                 2 Z- or  M, f2
   0E00                 2 Z- xor M, f2
   0F00                 1 ZC cmp M, f2
 4 1000 111111---------- invalid
 5 1400 1111114433332222 2 -- M = WRam[f3:f2]
   1500                 invalid
   1600                 4 -- swap M and WRam[f3:f2]
   1700                 invalid
 6 1800 111111443333---- 3 ZC block add WRam[f3:L] into WRam[H:L]: loops for A nybbles (0 = 16), L auto-increments
   1900                 3 ZC block BCD add
   1A00                 3 ZC block subtract
   1B00                 3 ZC block BCD subtract
 7 1C00 1111114433332222 2 -- block copy to WRam[H:(L+f2)] from WRam[f3:L]
   1D00                 2 -- block copy to WRam[H:(L+f2)] from WRam[f3:L] with decrementing L
   1E00                 4 -- block swap WRam[H:L] and WRam[f3:L]
   1F00                 2 ZC block compare WRam[H:L] to WRam[f3:L]
 8 2000 111111444-----22 1 -C load M and shift right (count is offset by 1)
 9 2400 111111444-----22 1 -C load M and shift left (count is offset by 1)
10 2800 111111333333---- 1 -- push regpair[f3]
11 2C00 111111333333---- 1 -- pop regpair[f3]
12 3000 111111444333--22 1 -C shift right (count is offset by 1)
13 3400 111111444333--22 1 -C shift left (count is offset by 1)
14 3800 111111333333---- 1 -- reg[f3] = M
15 3C00 111111333333---- 1 -- M = reg[f3]
16 4000 1111114443332222 1 ZC add reg[f4], reg[f3], f2
17 4400 111111444333-222 1 ZC add reg[f4], reg[f3], reg[f2]
18 4800 1111114443332222 1 ZC sub reg[f4], reg[f3], f2
19 4C00 111111444333-222 1 ZC sub reg[f4], reg[f3], reg[f2]
20 5000 1111113333332222 1 -- reg[f3] = f2
21 5400 111111444333-222 1 ZC adc reg[f4], reg[f3], reg[f2]
22 5800 1111114433332222 1 -- regpair[f4*2] = f3:f2
23 5C00 111111444333-222 1 ZC sbc reg[f4], reg[f3], reg[f2]
24 6000 1111114443332222 1 Z- and reg[f4], reg[f3], f2
25 6400 111111444333-222 1 Z- and reg[f4], reg[f3], reg[f2]
26 6800 1111114443332222 1 Z- or  reg[f4], reg[f3], f2
27 6C00 111111444333-222 1 Z- or  reg[f4], reg[f3], reg[f2]
28 7000 1111114443332222 1 Z- xor reg[f4], reg[f3], f2
29 7400 111111444333-222 1 Z- xor reg[f4], reg[f3], reg[f2]
30 7800 111111333333---- 1 -- regpair[f3] = M
31 7C00 111111333333---- 1 -- M = regpair[f3]
32 8000 1111444433332222 1 -- WRam[f4:f3] = f2
36 9000 1111222222222222 0 -- call
40 A000 1111222222222222 2 -- call, setting high nybble of PC to zero
44 B000 1111222222222222 1 -- jump if Z=1
48 C000 1111222222222222 1 -- jump if Z=0
52 D000 1111222222222222 1 -- jump if C=1
56 E000 1111222222222222 1 -- jump if C=0
60 F000 1111222222222222 1 -- jump, sets high nybble of PC to reg7 if previous instruction modified reg7

I notice the emulator has ROM and RAM as separate address spaces, so it can't execute code from RAM... let's hope that's not how the actual calculator works.

Edit: things don't look good; section 4.3 of that pdf shows ROM and RAM both starting from address 0.
« Last Edit: July 24, 2011, 04:15:46 am by Goplat »
Numquam te deseram; numquam te deficiam; numquam circa curram et te desolabo
Numquam te plorare faciam; numquam valedicam; numquam mendacium dicam et te vulnerabo

Offline Munchor

  • LV13 Extreme Addict (Next: 9001)
  • *************
  • Posts: 6199
  • Rating: +295/-121
  • Code Recycler
    • View Profile
Re: T4x asm documentation
« Reply #13 on: July 24, 2011, 05:28:25 am »
Not yet, but if someone takes the time to work on that document and on the calculator ROM dumps (which can be extracted from the official emulators with my tool linked in the TI-Bank news), it might be the case soon.

Either way, this seems like some progress, as the TI-30 was always completely unprogrammable :)

Offline critor

  • Editor
  • LV11 Super Veteran (Next: 3000)
  • ***********
  • Posts: 2079
  • Rating: +439/-13
    • View Profile
    • TI-Planet
Re: T4x asm documentation
« Reply #14 on: July 24, 2011, 06:05:39 am »
Thank you Goplat for taking the time to work on that.


I don't know if this has some interest, but on the 1st TI-30X Pro MultiView ROM, it was possible to freeze the calculator by typing some special values in the polynomial solver:




The ROM is included in this old emulator version:
http://ti.bank.free.fr/index.php?mod=archives&ac=voir&id=1960

Could that bug trigger anything interesting?...
TI-Planet co-admin.