Today I've been busy with my new program, an *advanced* program viewer for the CE in pure ASM. It takes the program name as a string in Ans, and it displays the whole program, but instead of the usual 9 lines, you can see about 28 lines of code, and I'm going to add indentation as well. This is a hard project, because I'm not really experienced with ASM, but no one cares Razz
I've used Mateo's _PrintString routine for displaying the whole program, which has a nice font, and is pretty small.
How the basic program works:

Code:
Read Ans as a string
Convert it to a program name in OP1
Check if program exists, and if not, return
Setup the graphics
For each token of the data of the program:
  Get the token in ASCII characters with _Get_Tok_Strng
  Display all the characters, if not offscreen
  If (newline) is entered, move the cursor to the newline
  If end of program reached, stop
End
Possibility to move up or down and eventually left or right
Pause
Return

I'm now at the stage for displaying the characters. This is what I got so far:


(That last characters looks awesome but is not intended Razz)

In a later version, I will maybe add editing as well, now I'm okay with this Very Happy

I know, this could be MUCH easier with the C libraries, but with C it is very hard to convert the number to a string, so I made this in pure ASM.

If you have any suggestions or questions, please post Smile

For the curious people: here is my program yet:
http://pastebin.com/HS9S2TWR
This looks pretty cool so far.

Do you plan to add a scroll bar to the side, so one knows approximately how far along the program they are?

Do you plan to have : at the start of each new line for readability's sake?

Keep up the progress!
tifreak8x wrote:
This looks pretty cool so far.

Do you plan to add a scroll bar to the side, so one knows approximately how far along the program they are?

Do you plan to have : at the start of each new line for readability's sake?

Keep up the progress!

Thanks Very Happy
Yea, that would look like awesome, but again, it's hard to implement. I will look into it.
Yes, I will implement that later.
Sure I will do!
I finally got the program length ready, and now it's ready it was so easy Neutral
I just load 0 to bc, and then load the length of the program individually to both b and c, and now it's done Very Happy I'm now going to work on new lines



EDIT: new lines seems to work!!



EDIT2: I've added the : as well at the beginning of each line

I would recommend not having the : at the beginning of the line. It certainly looks more authentic, but it's a waste of screen real-estate. Outside of that, this looks great! It'll be nice to have a bigger view of a program like this.
Quote:
I know, this could be MUCH easier with the C libraries, but with C it is very hard to convert the number to a string, so I made this in pure ASM.

Which number are you having difficulty converting?
elfprince13 wrote:
Quote:
I know, this could be MUCH easier with the C libraries, but with C it is very hard to convert the number to a string, so I made this in pure ASM.

Which number are you having difficulty converting?

The 2-byte tokens. I did have the change to make a bunch of tables for that, but programming in pure ASM is very nice as well Wink
In C all you need to do produce a character for a numeric value is use the escape characters Smile (I've also published a library that among other things, provides a C interface for tokenization).

In any case, I don't mean to discourage you from writing ASM, but thought I might be able to assist if you preferred C.
Indentation almost works, only the Ends are a bit messed up, I will need to take a look at that Smile



UPDATE: I finished it!! Very Happy


Now the Ends are also right intended. Now Else maybe...
merthsoft wrote:
I would recommend not having the : at the beginning of the line. It certainly looks more authentic, but it's a waste of screen real-estate. Outside of that, this looks great! It'll be nice to have a bigger view of a program like this.


The only reason I suggested it to begin with was because it makes the code more easily read if there is more than one line being displayed from 1 line of code, if that makes sense. Helps show the new line.

PT_ What are you doing if the line extends too far to the right of the screen? Do you have word wrapping to drop it to the next line yet, or is that a future feature?
tifreak8x wrote:
PT_ What are you doing if the line extends too far to the right of the screen? Do you have word wrapping to drop it to the next line yet, or is that a future feature?

I'm going to add both horizontal and vertical scrolling, if necessary. I've yet no idea how, but whatever Very Happy

UPDATE: I've spent this evening trying to implement colors, and this is the result:
PT_ wrote:

UPDATE: I've spent this evening trying to implement colors, and this is the result:

Ooh...Fancy Wink .
It makes me sad that all of the cool programs are being make for the CE, not it's sad now-obsolete cousin the CSE. :,(
Pieman7373 wrote:
It makes me sad that all of the cool programs are being make for the CE, not it's sad now-obsolete cousin the CSE. :,(

I can admit. Luckily I bought a CE, and it's much better. My main reason for not programming the CSE (in ASM) is of course the screen, that seems to be hard Neutral. I MAYBE can port this to xLIBC, but that would also be very hard. Until then you have you enjoy my screenshots Sad

Anyway, I'm going to work on boundaries checking Razz
Even with the amusingly corrupted screen, I'm really glad that you're adding syntax highlighting! Keep up the great work on this.
Looks really neat! It seems you're using a variable-width font though... usually constant-width fonts are used for code editors. It's something very minor though. Smile

P.S. Will you support editing/viewing of archived programs? That would be really handy.
P.P.S. I'm glad I'm not the only one working in pure assembly. Wink
Hactar wrote:
Looks really neat! It seems you're using a variable-width font though... usually constant-width fonts are used for code editors. It's something very minor though. Smile

P.S. Will you support editing/viewing of archived programs? That would be really handy.
P.P.S. I'm glad I'm not the only one working in pure assembly. Wink

1) I prefer the variable-width font, because it looks nice
2) Maybe in a later version, though it sounds good. Maybe even add the possibility to see locked ASM programs - you never know Wink
3) Haha, it's very funny and hard Wink

New update:
if the program reaches the end of the screen, it now automatically stops:



That weird stuff on the screen is at the place of |L, because Mateo's libraries were for tokens, and not for special characters, so I need to create them myself.

EDIT: I've added the pink highlighting of the TI-OS colors. I need to figure out myself what the hex codes are of these, but I found it with CEmu:



This will highlight such commands as dayOfWk() as well, but nobody uses that.
Oh! I have another idea!

If you want to really appeal to hybrid BASIC developers you could treat hybrid basic commands (such as det(#) ) as tokens that are actual words! Though that's obviously not an essential feature and would only be added on as something extra.
Hactar wrote:
Oh! I have another idea!

If you want to really appeal to hybrid BASIC developers you could treat hybrid basic commands (such as det(#) ) as tokens that are actual words! Though that's obviously not an essential feature and would only be added on as something extra.

You mean something like TokenIDE, that real(4 becomes DrawSprite(XXX?

Anyway, I found a nice way for vertical scrolling, and now going to implement that.
I've a bit changed my indentation algorithm. It now pre-calculates the indentation per line, instead of during drawing.

I've also tried to make vertical scrolling down possible, and this is the result:


On a real calc, it can scroll about 10-15 lines/second.

I'm now trying to replace/add fonts.
  
Register to Join the Conversation
Have your own thoughts to add to this or any other topic? Want to ask a question, offer a suggestion, share your own programs and projects, upload a file to the file archives, get help with calculator and computer programming, or simply chat with like-minded coders and tech and calculator enthusiasts via the site-wide AJAX SAX widget? Registration for a free Cemetech account only takes a minute.

» Go to Registration page
Page 1 of 2
» All times are UTC - 5 Hours
 
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum

 

Advertisement