π
<-
Chat plein-écran
[^]

nAssembler

C, C++, ASM...

nAssembler

Unread postby lkj » 11 Mar 2015, 18:30

As the title suggests, this is an on-calc assembler for the Nspire :)
It's written in python, so you need micropython on your calc.
All instructions I'm aware of are supported (except CDP, LDC, STC. They are useless on the Nspire)
What's still missing are some pseudoinstructions which don't add functionality but make your life easier,
like for example automatically creating x when you write LDR R0, =x
There is also no linker or anything which means that programs are just translated to binary in the order
they are written and the first line is also the entry point.
Read the readme in the spoiler below for more details on the assembly language syntax used or look at the example.

Please report bugs, missing instructions and feature suggestions.
The code is available at https://github.com/lkjcalc/nAssembler
Download at http://ti-pla.net/a821835

Readme wrote:Usage
-----
Install micropython on your calc.
Launch the nassembler.py.tns file using micropython.
The program will ask you to specify the input file (containing the assembly source code)
and the output file (where the binary will be stored).
You have to specify the full path (for example /documents/test/clrscr.asm.tns)
If there are no errors, micropython will now tell you "Press any key to exit".
You should now see the output file after refreshing the docbrowser
(just go to the homescreen and back to the docbrowser).

Assembly language
-----------------
(Also look at the examples)
Instruction names must be preceded by whitespace
Labels must not be preceded by any whitespace
The instruction names and syntax are like in standard ARM assembly
(like in the official ARM online documentation)

All usual instructions are supported:
ADC(S), ADD(S), AND(S), B, BIC(S), BL, BX, CMP, CMN,
EOR(S), LDM.., LDR(B/T/BT/H/SH/SB), MCR, MLA(S), MOV(S),
MRC, MRS, MSR, MUL(S), MVN(S), ORR(S),
RSB(S), RSC(S), SBC(S), SMLAL(S), SMULL(S), STM..,
STR(B/T/BT/H), SUB(S), SVC/SWI, SWP(B), TEQ, TST, UMLAL(S), UMULL(S)

The DCD, DCDU, DCB and ALIGN directives are supported

Pseudo instruction (like PUSH, ADR etc) are not implemented at the moment.
Other instructions may be missing (report if you need one).

The first line of the source is also the entry point of the program.

Numeric literals:
Prefix with 0x for hexadecimal numbers, 0 for octal, 0b for binary.
Single characters enclosed in single quotes ' are interpreted as their ascii value
You can use DCB "some string" to create a string.



SCREENSHOTS0012.gif
SCREENSHOTS0012.gif (145.12 KiB) Viewed 4408 times
Last edited by lkj on 26 Jan 2017, 02:10, edited 2 times in total.
User avatar
lkjProgrammeur
Niveau 3: MH (Membre Habitué)
Niveau 3: MH (Membre Habitué)
Level up: 76%
 
Posts: 13
Joined: 30 Oct 2012, 00:25
Gender: Not specified
Calculator(s):

Re: nAssembler

Unread postby Lionel Debroux » 11 Mar 2015, 18:39

Very interesting :)

You had gone quiet for a little while, but you used some of that time to something pretty good ;)
Membre de la TI-Chess Team.
Co-mainteneur de GCC4TI (documentation en ligne de GCC4TI), TIEmu et TILP.
User avatar
Lionel DebrouxSuper Modo
Niveau 14: CI (Calculateur de l'Infini)
Niveau 14: CI (Calculateur de l'Infini)
Level up: 8.7%
 
Posts: 6655
Joined: 23 Dec 2009, 00:00
Location: France
Gender: Male
Calculator(s):
Class: -
GitHub: debrouxl

Re: nAssembler

Unread postby Adriweb » 11 Mar 2015, 19:06

That's indeed definitely interesting, good job :D
User avatar
AdriwebAdmin
Niveau 16: CC2 (Commandeur des Calculatrices)
Niveau 16: CC2 (Commandeur des Calculatrices)
Level up: 57%
 
Posts: 13307
Images: 1093
Joined: 01 Jun 2007, 00:00
Location: France
Gender: Male
Calculator(s):
Class: (ingénieur)
Twitter: adriweb
GitHub: adriweb

Re: nAssembler

Unread postby Lu_Lu54 » 13 Mar 2015, 18:53

What is it supposed to do ? Sorry, I didn't get it.
Image

Tu as une TI-nspire cx cas ?
Mes programmes :

certains utiles : CalcTriangles, HowManyDiv, DivEuclid step by step, factorisation de polynômes par la division euclidienne, Dénombrement, TransDioptres step by step
d'autres plus expérimentaux ;) : sommes2dés, DecPi
et encore plus à venir !
User avatar
Lu_Lu54Premium
Niveau 12: CP (Calculatrice sur Pattes)
Niveau 12: CP (Calculatrice sur Pattes)
Level up: 95.4%
 
Posts: 449
Images: 8
Joined: 06 Sep 2014, 14:30
Location: Près de Nancy
Gender: Male
Calculator(s):
Class: 1ère S

Re: nAssembler

Unread postby Lionel Debroux » 13 Mar 2015, 20:44

nAssembler consumes text data, more precisely source code for some dialect of ARM ASM, parses and validates it, and produces a native code program, which can be launched by Ndless - just like the Nspire ports of Micro Python and Duktape.
Membre de la TI-Chess Team.
Co-mainteneur de GCC4TI (documentation en ligne de GCC4TI), TIEmu et TILP.
User avatar
Lionel DebrouxSuper Modo
Niveau 14: CI (Calculateur de l'Infini)
Niveau 14: CI (Calculateur de l'Infini)
Level up: 8.7%
 
Posts: 6655
Joined: 23 Dec 2009, 00:00
Location: France
Gender: Male
Calculator(s):
Class: -
GitHub: debrouxl

Re: nAssembler

Unread postby Lu_Lu54 » 13 Mar 2015, 20:51

all right. I knew what an assembler was, but I didn't find the dialect concerned... thx!
Image

Tu as une TI-nspire cx cas ?
Mes programmes :

certains utiles : CalcTriangles, HowManyDiv, DivEuclid step by step, factorisation de polynômes par la division euclidienne, Dénombrement, TransDioptres step by step
d'autres plus expérimentaux ;) : sommes2dés, DecPi
et encore plus à venir !
User avatar
Lu_Lu54Premium
Niveau 12: CP (Calculatrice sur Pattes)
Niveau 12: CP (Calculatrice sur Pattes)
Level up: 95.4%
 
Posts: 449
Images: 8
Joined: 06 Sep 2014, 14:30
Location: Près de Nancy
Gender: Male
Calculator(s):
Class: 1ère S

Re: nAssembler

Unread postby Ti64CLi++ » 13 Apr 2015, 20:18

This is a good idea!!!
Very well !
Image
User avatar
Ti64CLi++Modo
Niveau 16: CC2 (Commandeur des Calculatrices)
Niveau 16: CC2 (Commandeur des Calculatrices)
Level up: 10.4%
 
Posts: 3385
Images: 75
Joined: 04 Jul 2014, 14:40
Location: Clermont-Ferrand 63
Gender: Male
Calculator(s):
Class: MP
GitHub: Ti64CLi

Online

Re: nAssembler

Unread postby grosged » 15 Jun 2016, 15:41

Wouah ! J'ai installé micropython , nAssembler, et j'ai assemblé l'example.asm.tns en tst.prg.tns...
! ça marche :P

J'ai trouvé ça...
ARM Instructions Se
t : http://simplemachines.it/doc/arm_inst.pdf

Est-ce que c'est une doc pour l' ARM9 ?...

Je voudrais aussi savoir , lequel de ces ARMs est dans ma CX CAS ? ( https://fr.wikipedia.org/wiki/Architecture_ARM)

EDIT:
Le voilà, le processeur de la CX CAS !

Image
(voir http://www.allaboutcircuits.com/news/te ... alculator/ )

re-EDIT:
Bon, je m'approche du but, il y a 3 sortes d'ARM9 !

Image

voir http://www.arm.com/products/processors/classic/arm9/ ;)


EDIT FINAL :
En fait fallait pas chercher si loin, il suffisait de consulter https://wiki.tiplanet.org/S%C3%A9ries_TI-Nspire_CX !
Où l'on peut lire "Processeur ARM926EJ-S " :)
User avatar
grosgedVIP++
Niveau 14: CI (Calculateur de l'Infini)
Niveau 14: CI (Calculateur de l'Infini)
Level up: 23.7%
 
Posts: 765
Images: 80
Joined: 14 Sep 2011, 12:29
Location: France
Gender: Male
Class: jadis
GitHub: grosged

Re: nAssembler

Unread postby Ti64CLi++ » 08 Jan 2017, 14:47

Je me permet de relancer ce topic, pour signaler que rajouter des instructions comme .WORD, .HWORD et d'autres relatives au stockage de données serait très utiles ^^
Et où puis-je trouver un bon tuto sur l'ASM de l'ARM9 de la TI Nspire CX CAS disponible en pdf si possible?
Image
User avatar
Ti64CLi++Modo
Niveau 16: CC2 (Commandeur des Calculatrices)
Niveau 16: CC2 (Commandeur des Calculatrices)
Level up: 10.4%
 
Posts: 3385
Images: 75
Joined: 04 Jul 2014, 14:40
Location: Clermont-Ferrand 63
Gender: Male
Calculator(s):
Class: MP
GitHub: Ti64CLi

Online

Re: nAssembler

Unread postby grosged » 18 Jan 2017, 16:51

Comme tu le sais déjà, je viens de commencer la rédaction d'un tuto sur l'Assembleur ARM9 ;)

Je me penche de nouveau sur l'excellent nAssembler de lkjI ...
En plus de la TI-nspire (via micro-python), on peut également le lancer depuis un ordinateur sous Linux, Mac, windows... grâce à Python 3 , bien sûr !! :p

Personnellement, je viens de lancer nAssembler depuis Python 3.4.2 (sur mon raspberry) ...ça marche nickel 8-)
User avatar
grosgedVIP++
Niveau 14: CI (Calculateur de l'Infini)
Niveau 14: CI (Calculateur de l'Infini)
Level up: 23.7%
 
Posts: 765
Images: 80
Joined: 14 Sep 2011, 12:29
Location: France
Gender: Male
Class: jadis
GitHub: grosged

Next

Return to Native: Ndless, Linux, ...

Who is online

Users browsing this forum: No registered users and 3 guests

-
Search
-
Social
-
Featured topics
Comparaisons des meilleurs prix pour acheter sa calculatrice !
Découvre les nouvelles fonctionnalités en Python de l'OS 5.2 pour les Nspire CX II
Découvre les nouvelles fonctionnalités en Python de l'OS 5.5 pour la 83PCE/84+C-T Python Edition
Omega, le fork étendant les capacités de ta NumWorks, même en mode examen !
1234
-
Donations / Premium
For more contests, prizes, reviews, helping us pay the server and domains...
Donate
Discover the the advantages of a donor account !
JoinRejoignez the donors and/or premium!les donateurs et/ou premium !


Partner and ad
Notre partenaire Jarrety Calculatrices à acheter chez Calcuso
-
Stats.
506 utilisateurs:
>481 invités
>20 membres
>5 robots
Record simultané (sur 6 mois):
6892 utilisateurs (le 07/06/2017)

-
Other interesting websites
Texas Instruments Education
Global | France
 (English / Français)
Banque de programmes TI
ticalc.org
 (English)
La communauté TI-82
tout82.free.fr
 (Français)