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 - lkj

Pages: [1] 2 3 ... 33
1
TI-Nspire / Re: nTxt - Nspire Text Editor
« on: February 26, 2018, 06:06:00 pm »
I have tried this program on OS 4.5, rev. AB and whenever a dialogue comes up the screen shows random pixels and flickers????

It does say activating compatibility mode
If you mean the random pixels and garbage around the dialogue, that's always been the case. Don't worry about it.

You should update your program, because copy/paste and selection don't work on 4.5 :(
I know. But finding the addresses and recompiling every time there is a new OS is annoying. Maybe I'll just revert to an internal clipboard which isn't shared with the OS for unsupported OSes.

2
TI-Nspire / Re: nAssembler - Nspire on-calc assembler
« on: February 26, 2018, 01:17:14 pm »
Sorry, I was too busy with university this year to work on this. I just uploaded an updated version on tiplanet, but it doesn't include these instructions yet. Only the "include" instruction, to include other source files. I'll try to implement these multiplies if I have time.

3
TI-Nspire / Re: nAssembler - Nspire on-calc assembler
« on: September 21, 2017, 05:52:48 am »
You can always write a program in C on the computer, compile it with ndless, and then disassemble it to see how to do things. Compiling and disassembling the nGc sample would probably also be enough.

4
TI-Nspire / Re: nAssembler - Nspire on-calc assembler
« on: September 19, 2017, 09:22:49 am »
You don't construct a new one, you should get a pointer of the one used by the OS. It seems to be syscall 298, but I'm not sure if you can really just call it to get the pointer. It's a bit complicated to use the GC and you should read the documentation on hackspire if you really want to. It seems that its use has been deprecated in Ndless anyway.

Code: [Select]
main
    stmfd sp!, {r0-r12, lr}
    mov r0, #0xC0000010
    ldr r0, [r0]
    bl clrscrCX
    adr r0, text
    swi #46 ;tolower
    swi #341 ;disp_msg
    bl wait
    ldmfd sp!, {r0-r12, pc}

wait
    stmfd sp!, {r0-r12, lr}
    mvn r0, #0
    mov r0, r0, lsr #4
waitloop
    sub r0, r0, #1
    cmp r0, #0
    bgt waitloop
    ldmfd sp!, {r0-r12, pc}

clrscrCX
    stmfd sp!, {r0-r12, lr}
    mov r4, r0
    mov r5, #0
    mov r6, #0
    mov r7, #0
xloop
    mov r0, r4
    mov r1, r5
    mov r2, r6
    mov r11, r7
    bl setPixel
    add r5, r5, #1
    cmp r5, #320
    blt xloop
    add r6, r6, #1
    mov r5, #0
    cmp r6, #240
    blt xloop
    ldmfd sp!, {r0-r12, pc}

setPixel
    stmfd sp!, {r0}
    add r0, r0, r1, lsl #1
    add r0, r0, r2, lsl #9
    add r0, r0, r2, lsl #7
    strh r11, [r0]
    ldmfd sp!, {r0}
    bx lr

text
    dcb "HELLO WORLD!", 0

but he displays HELLO WORLD! :(
Yeah, tolower doesn't take a string argument. It only takes a single character and returns the lowercase version. Apparently it interprets the pointer as a non-uppercase character and returns it unchanged.

To make it work, you have to write  your own routine to change the whole string to lowercase.

5
TI-Nspire / Re: nAssembler - Nspire on-calc assembler
« on: September 19, 2017, 04:14:12 am »
Hackspire says what the arguments do:
Quote
void gui_gc_drawLine(Gc, int x1, int y1, int x2, int y2) - Draws a line from <x1,y1> to <x2,y2>.

So you need to store Gc in r0, r1=x1, r2=y1, r3=x2, and then push y2 onto the stack. I'll write more later.

6
TI-Nspire / Re: nAssembler - Nspire on-calc assembler
« on: September 18, 2017, 05:38:26 pm »
Yes with 341, it works.
But with the syscall void gui_gc_drawLine(Gc p1, int p2, int p3, int p4, int p5), what is Gc p1? A pointer to the screen area?
And p2, p3, p4, p5? The coordinates of the line?

Edit (Eeems): Merged double post
Gc is an OS variable. There is a bit of documentation on https://hackspire.org/index.php/Syscalls#Graphic_Context_API.

And if I want to reuse the return value of the syscall, in which register is the return value?
I'd guess in R0 as usual.

7
TI-Nspire / Re: nAssembler - Nspire on-calc assembler
« on: September 17, 2017, 04:03:14 pm »
Testing it in the emulator, I saw that it only prints the output to the console (i.e. over RS232, not on the screen). So seeing nothing on the screen is expected.

Edit: syscall 341 prints to the screen

8
TI-Nspire / Re: nAssembler - Nspire on-calc assembler
« on: September 17, 2017, 03:45:59 pm »
I think it's correct.

9
TI-Nspire / Re: nAssembler - Nspire on-calc assembler
« on: September 11, 2017, 03:04:37 am »
If I remember correctly you pass arguments as with normal function calls, that is in r0, r1 etc

10
TI-Nspire / Re: nAssembler - Nspire on-calc assembler
« on: April 03, 2017, 02:18:01 pm »
The INCBIN directive is now implemented. The syntax is
INCBIN path
, i.e. no double quotes or anything around the path. It includes the file content at the location of the INCBIN. path can be an absolute path or a relative path (relative to the  directory containing the source file).
Download at https://tiplanet.org/forum/archives_voir.php?id=821835.

So it seems there is no os reassemble listing (with some comments)? Ok, in those days when we got such a book for the speccy it were 16 kb of rom. So making such a thing for the now 13 mb that the os contents would be an endless work. If there comes no infos from TI it may be to timesucking, esp. for a single person.
But when ndless contents some system calls, their programmers must know about them. However, they won't shout around with this knowledge that they got surely not without some trouble.
No, since TI doesn't support native programming on the Nspire. The people working on ndless have found many system calls over the years, though. Since ndless is open source, the addresses can be found there (https://github.com/ndless-nspire/Ndless/tree/master/ndless/src/tools/MakeSyscalls/idc). But copying them from there and hardcoding them in your assembly source is very annoying, because the addresses are different for every OS version and for the different models. So it would be much nicer if nAssembler had some support for syscalls.
Edit: It's actually easier than that. Since ndless executes the assembled program, we can actually use its way to handle syscalls: Ndless installs a SWI handler, so we can just use the SWI (software interrupt) instruction to call syscalls. The syntax is "SWI swinum", where swinum is the number of the syscall you want, from the list at https://github.com/ndless-nspire/Ndless/blob/master/ndless-sdk/include/syscall-list.h. So for example "SWI 0" to call fopen.

11
TI-Nspire / Re: nAssembler - Nspire on-calc assembler
« on: March 13, 2017, 06:24:04 pm »
Sounds useful and simple to implement. I'll add it when I have time.

12
TI-Nspire / Re: nTxt - Nspire Text Editor
« on: March 13, 2017, 06:22:42 pm »
nTxt 26 should work on 4.0.3, but on 4.2 and 4.4 using the clipboard features (i.e. copy/cut/paste) crashes the calc.
Apart from that features, the app works flawlessy?
Do you think will be complicated updating the binary to grant compatibility to the last 2 versions of OS?  ::)
Yes, everything else works.
I already found the new syscall addresses yesterday, but I still need to find out how to add them correctly to build a new release.

Is there still developement?
And, by the way, I am still curious about the booklet & ctrl+c/v/x/a (compatible with the os, would be awesome for JSE exporting).
 :thumbsup: Goopd job!
No, just small fixes and compatibility updates.

Edit: The release is online on github: https://github.com/lkjcalc/nTxt/releases. I couldn't test it yet. Please report any problems.

13
TI-Nspire / Re: nTxt - Nspire Text Editor
« on: March 10, 2017, 12:35:28 pm »
nTxt 26 should work on 4.0.3, but on 4.2 and 4.4 using the clipboard features (i.e. copy/cut/paste) crashes the calc.

14
TI-Nspire / Re: nAssembler - Nspire on-calc assembler
« on: March 10, 2017, 12:30:37 pm »
About the system calls: Yes, I guess it would be useful to have some way to access them with nAssembler. In programs compiled on the pc, ndless provides them.
Since neither reading keypad state nor displaying stuff on the screen uses them, you can actually already do many things without them, but there's obviously no file reading/writing.

.word is just called dcd here.

15
TI-Nspire / Re: nAssembler - Nspire on-calc assembler
« on: March 04, 2017, 05:50:21 am »
There has recently been some activity in the thread on tiplanet, and as a result I also made some updates, adding CLZ, ADR, and fixing a bug. I forgot to update the file in the first post, so now I removed it and added a link to the download on tiplanet, which should always be up to date.


It's working now, was a simple mistake I made: for testing micropython 134 and 146 I did rename the both files (micropython 134 for example). So the .py files couldn't get connected and also nAssembler didn't run. Now everthing works.
I'm glad that it works now. Thanks for your many comments. I'm going to reply to some of their concerns below.

I agree that more documentation, more examples and some explanations of the examples would help. But my main reasons for starting this project were that I was interested in writing an assembler, had a lot of time with nothing to do, and I was always a bit annoyed that it was impossible to write native programs for the Nspire on-calc. Nowadays, I don't have much time, and I've accomplished my main goal of writing an on-calc assembler with most of the useful features.

I may try to write another example or two, but for more, other people will have to do it. So, you're welcome to do it  ;)

There probably already are some ARM assembler tutorials on the internet, for example for the GBA, but they can't explain the things specific to the Nspire, e.g. how to read the keyboard or display stuff (see https://hackspire.org and in particular https://hackspire.org/index.php/Memory-mapped_I/O_ports for that kind of thing), and they probably use some pseudo-instructions I didn't implement or some different syntax, which will require some experimenting and/or googling to adapt to nAssembler.

Also, grosged over on tiplanet wrote a small demo and a short explanation of ARM assembly, but it's in French. (example link: https://tiplanet.org/forum/archives_voir.php?id=839558, the file nsprtest.s is the code compatible with nAssembler)


Pages: [1] 2 3 ... 33