Author Topic: ANSFUNC - an assembly program to give extra functions to your calculator  (Read 4424 times)

0 Members and 1 Guest are viewing this topic.

Offline joshuarpl

  • LV2 Member (Next: 40)
  • **
  • Posts: 23
  • Rating: +0/-0
    • View Profile
ANSFUNC
A program to add extra functions to your TI-BASIC programs.
Hello, ANSFUNC is an assembly program that adds extra functions,
you can do some impressive things like outputting a byte to a port, displaying a character that normally wouldn't be accessible by normal means, moving the cursor and more!
So, what are you waiting for, Download it today (Well, if you wanna have extra functions, that is)
Version 1.0.1 released, it's a minor update, only 2 functions added.

Download link
https://drive.google.com/open?id=1qgTcJD9Y3rVYUdnDLbg09a46YLk1UG7K

Why do I hear boss music?
« Last Edit: May 13, 2019, 11:23:30 am by joshuarpl »

Offline E37

  • LV6 Super Member (Next: 500)
  • ******
  • Posts: 358
  • Rating: +23/-0
  • Trial and error is the best teacher
    • View Profile
Here is my thoughts on it just by reading the documentation. I haven't tried it out since I don't have a link cable on hand.

The documentation itself:
In some commands for the documentation, you give examples of their use and on others you don't. That is fine mostly since you give examples of the ones that need to be explained and not for the simple ones but why does 10 have an example?
For the display character command, what happens if I put in value that isn't in 0-255? You give the user the ability to display any character they want but you never give them a chart to tell them what character goes with what number.
On commands 1 and 9, I'm not exactly sure what you mean by screen and I consider myself pretty experienced in calc-programming. By screen do you mean just the home screen and the graph screen? If so just say homescreen in 9 and not 'currently-displayed screen'. If there is more, list them. I'd detail how that works in a little more thoroughly as well.

The program:
How do you sanitize your input? What does it do if a number that doesn't correspond to a command is entered like 11? How does it deal with decimals? Negative numbers? How about 65537? (2^16 + 1 as it could wrap around and appear to be 1 to your program) How about having a matrix or a list or a string in Ans? An imaginary number? You need to be sure those don't crash or do weird things. Also make sure you sanitize your input variables like x and y. Those can contain imaginary numbers.
I don't get the point of the link port command. Can you name a case where it would be useful to someone programming in basic? I wouldn't give access to the link port to a basic program since the whole point of it (besides doing math) is that you can't screw up your calculator no matter what you do. Ive sent garbage to some of the ports before and you can get nasty stuff like the blue lines of death which can damage the screen or flip the screen upsides down (and that isn't fixed by a ram clear) or swap out the ram page the program is currently running on which will probably crash the calc.
For the move cursor command, you say that the user shouldn't let the cursor go off the edge of the screen. You shouldn't make that the user's task. Remember that your users have no clue how your code works and they can and will feed all kinds of garbage data into your program. I would also offset the cursor's position for the user so it is the same as the basic one. It is so easy to add a 'dec hl' or whatever register you are using and it saves confusion.
Why are some commands toggle and some have a separate on and off? 3 and 4 are an on-off pair but 6 and 9 are just toggle.
Sleep mode seems a little odd. How exactly do you turn the calc off? I know the basic programs can auto-power-off when waiting for input and they don't throw an error when turning on. I imagine that you are handling the sleep inside your program and then when the on button is pressed then it turns back on, returns to the basic program which then errors. If so, there is a way around it. IIRC there is a flag that is set whenever the on button is pressed. Even if you read the keypad to clear the most recently pressed key, that won't clear the flag. If you clear it, then the basic program shouldn't error. Or it could be a port and not a flag. I'm pretty sure it is a flag though.


These are just some thoughts. Seems like a nice program though. You probably learned a lot from making it  :thumbsup:
I'm still around... kind of.

Offline joshuarpl

  • LV2 Member (Next: 40)
  • **
  • Posts: 23
  • Rating: +0/-0
    • View Profile
Here is my thoughts on it just by reading the documentation. I haven't tried it out since I don't have a link cable on hand.

The documentation itself:
In some commands for the documentation, you give examples of their use and on others you don't. That is fine mostly since you give examples of the ones that need to be explained and not for the simple ones but why does 10 have an example?
For the display character command, what happens if I put in value that isn't in 0-255? You give the user the ability to display any character they want but you never give them a chart to tell them what character goes with what number.
On commands 1 and 9, I'm not exactly sure what you mean by screen and I consider myself pretty experienced in calc-programming. By screen do you mean just the home screen and the graph screen? If so just say homescreen in 9 and not 'currently-displayed screen'. If there is more, list them. I'd detail how that works in a little more thoroughly as well.

The program:
How do you sanitize your input? What does it do if a number that doesn't correspond to a command is entered like 11? How does it deal with decimals? Negative numbers? How about 65537? (2^16 + 1 as it could wrap around and appear to be 1 to your program) How about having a matrix or a list or a string in Ans? An imaginary number? You need to be sure those don't crash or do weird things. Also make sure you sanitize your input variables like x and y. Those can contain imaginary numbers.
I don't get the point of the link port command. Can you name a case where it would be useful to someone programming in basic? I wouldn't give access to the link port to a basic program since the whole point of it (besides doing math) is that you can't screw up your calculator no matter what you do. Ive sent garbage to some of the ports before and you can get nasty stuff like the blue lines of death which can damage the screen or flip the screen upsides down (and that isn't fixed by a ram clear) or swap out the ram page the program is currently running on which will probably crash the calc.
For the move cursor command, you say that the user shouldn't let the cursor go off the edge of the screen. You shouldn't make that the user's task. Remember that your users have no clue how your code works and they can and will feed all kinds of garbage data into your program. I would also offset the cursor's position for the user so it is the same as the basic one. It is so easy to add a 'dec hl' or whatever register you are using and it saves confusion.
Why are some commands toggle and some have a separate on and off? 3 and 4 are an on-off pair but 6 and 9 are just toggle.
Sleep mode seems a little odd. How exactly do you turn the calc off? I know the basic programs can auto-power-off when waiting for input and they don't throw an error when turning on. I imagine that you are handling the sleep inside your program and then when the on button is pressed then it turns back on, returns to the basic program which then errors. If so, there is a way around it. IIRC there is a flag that is set whenever the on button is pressed. Even if you read the keypad to clear the most recently pressed key, that won't clear the flag. If you clear it, then the basic program shouldn't error. Or it could be a port and not a flag. I'm pretty sure it is a flag though.


These are just some thoughts. Seems like a nice program though. You probably learned a lot from making it  :thumbsup:

Oh, I took many functions from Zeda's Opcodes List! By the description of Graph to Screen, i thought no matter what it would display the graph, home screen or graph screen, I'll improve to just "home screen" and I'll probably remove the Sleep Mode function, but add other functions to ANSFUNC, thank you for the reply.  :thumbsup: