Jump to content
IGNORED

Supernotes


GDMike

Recommended Posts

What I'm getting here, is that you want to convert DECIMAL 42 to HEX >2A. But all the examples here depend on the assembler resolving this. In order to convert user's DECIMAL input into HEX, during execution, you'll need a program that treats your user's input as though it were decimal.

Edited by HOME AUTOMATION
  • Like 1
Link to comment
Share on other sites

I ended up writing a small routine that, using my example of an asterisk, with two decimal values on the screen,(42).

I read each value one at a time into R1.

subtracted 48 from both values, d52 And d50 That brings it all down to d4 and d2.

Manipulate them until they become h42.

And my next test is to see if they will produce >2A in R1...hmm

This test put a "B" on the screen...

I'll review my code..

Of course this put a B because, again it's a hex 42, not decimal 42

Hmm

IMG_20200611_000320509_HDR.jpg

Edited by GDMike
Link to comment
Share on other sites

I'll try subtracting h18 and see if that helps.

Update. Yes that works, but only if the input value was less than"50".

I haven't tried lower values than "42" yet to see if they are ok. And I've already taken care of values "1-9".

So now I just need to test values "10-42".

I suppose I can just make adjustment code to make up the difference in the numbers higher than 50. ?? TBD

Edited by GDMike
Link to comment
Share on other sites

Am I correct to assume that you read two ASCII characters for decimal digits (ASCII 48..57) and want to get the value in a register? If so, remove the offset 48 from each character, multiply the first by 10, and add the second on it. 

 

When I look at your code, I'd say you mixed up hexadecimal and decimal handling. You have two characters ("4" = 0x34 = 52, "2" = 0x32 = 50), subtract 0x30 from each one, but then you assemble both values to a hexadecimal number. You'll have to decide:

 

* Your input represents a hexadecimal number. In that case your asterisk would be entered as 2A; the first byte is 0x32, the second is 0x41. For A..F you have to subtract 0x37 = 55. That is, you must check cases 0..9 and A..F. Then you can assemble both digits to a single number.

 

* Your input represents a decimal number. Then your asterisk is entered as 42; you get both digits as values 4 and 2, multiply 4 by 10 which yields decimal 40 (=0x28) and add the 2, resulting in 42 (=0x2A).

Edited by mizapf
  • Like 1
  • Thanks 1
Link to comment
Share on other sites

As much as I enjoy seeing your mind grow stronger...

...I couldn't stand to watch you suffer any longer.:D

Besides I'm getting hungry!:grin:

 

o.k. this could perhaps use a little restructuring, but works(tested somewhat).|:)
...too tired to comment.:sleep:

 

Spoiler

       DEF  RUN
       REF  VSBR,VMBW
BUFF   TEXT '042'
RUN    LI   R0,931
       LI   R1,BUFF
       LI   R2,3
       BLWP @VMBW
       CLR  R1
       LI   R3,10
       LI   R4,3
       CLR  R5
       LI   R6,1
       CLR  R7
       LI   R0,933
       JMP  DECODE
OUT    RT
INCMUL DEC  R4
       JEQ  OUT
       DEC  R0
       MOV  R6,R5
       MPY  R3,R5
DECODE BLWP @VSBR
       SWPB R1
       CI   R1,>40
       JLE  NEXT
       AI   R1,->37
       JMP  NEXT2
NEXT   AI   R1,->30
NEXT2  CI   R1,0
       JNE  ADD
       JMP  INCMUL
ADD    A    R6,R7
       DEC  R1
       JNE  ADD
       JMP  INCMUL
       END

R0=SCREEN ADDR.
R1=CURRENT VALUE
R2=RESERVED
R3=MULTIPLIER
R4=DIGIT/LOOP COUNTER
R5=PRODUCT/PLACE VALUE MULTIPLIER(COPIED)
R6=PRODUCT/PLACE VALUE MULTIPLIER
R7=ACCUMULATOR

 

 

   CHARGE: cost.JPG.844bb12641893aa77ea18ba514d6ca58.JPG

 

...that's Scooby Snacks.Mmm.thumb.JPG.cb3aeae39570b518ed1974e54d279b93.JPG

 

...and the number is sexagesimal!

 

 

     P.S. Your running up a tab now!:)

  • Like 1
  • Thanks 1
Link to comment
Share on other sites

Well,

The ASCII numerals needed to be converted to HEXADECIMAL, and they are a subset of HEXADECIMAL. So, I let the previously provided code do that.:thumbsup: The Handling of A-F, is of course, a bonus feature.:grin: That way users get what they pay for when entering mal-data.:evil: Besides, I'm leaving error-handling, to the projects Artist.:P

 

  P.S. 4C, goes well with Scooby Snacks.
         However, the c-key is pretty far from the numerals.:ponder:

 

  P.P.S. I'm only taking credit for the parts that
           work as anticipated.;-)

:)

  • Thanks 1
Link to comment
Share on other sites

Ok, I've got an update. And I didn't spell "special" correct because I was using one hand, but anyway I think you can tell what's going on.

I can now call char(nn) where "nn" is any character from 1-99. Also includes a leading zero for those that want proper numbers. ie, 

"07" instead of "7' but whatever, I had to make it work regardless, but I've been working out the bugs in my two digit char display and I had to get it right.

Next up, I'll be concluding the rest of the set, 100-254.

Edited by GDMike
  • Like 1
Link to comment
Share on other sites

I am happy that the code does what you want but I am not clear on what the feature is for.

On the surface it looks like you are writing an ascii value to the screen which displays the appropriate letter.

How does the Super Notes user use this?

Maybe this is just a test bed for future work. (?)

  • Like 1
Link to comment
Share on other sites

Ahh. Yes, well there are characters NOT on the keyboard that a user might need to place, one such character is, I found, the cent mark opposed to the dollar mark, another would be the celcius and farenheit, IF I defined those, or how about cell characters, left,top,sides etc, to make a cell or divider.

I'm sure there are other characters as I haven't reviewed what should be included. So this allows the user to call up a character, a help key could be presented to show the current ASCII chart of what is defined. 

OR I could just allow the user to create their own char and have it placedvon the screen.

I think this is just fine for now. Plus I've gotta move on to file access... but I needed to get this outta my way.

Edited by GDMike
Link to comment
Share on other sites

26 minutes ago, GDMike said:

Ahh. Yes, well there are characters NOT on the keyboard that a user might need to place, one such character is, I found, the cent mark opposed to the dollar mark, another would be the celcius and farenheit, IF I defined those, or how about cell characters, left,top,sides etc, to make a cell or divider.

I'm sure there are other characters as I haven't reviewed what should be included. So this allows the user to call up a character, a help key could be presented to show the current ASCII chart of what is defined. 

OR I could just allow the user to create their own char and have it placedvon the screen.

I think this is just fine for now. Plus I've gotta move on to file access... but I needed to get this outta my way.

Ahh. That's cool.  It's like the SYMBOL table in Microsoft word but you select with a text command. Nice idea.

  • Like 1
Link to comment
Share on other sites

Yes, well I had to make the command line for my disk access commands like save dsk1.disk or old dsk2.super

So I started thinking while I was making the command line and I said shoot, what if somebody want to make some kind of cell or divider, or place a character that wasn't on the keyboard. ..a ha. This solved it.

I just got to finish it up I think maybe by tomorrow or the next day.

 

  • Like 3
Link to comment
Share on other sites

R0=SCREEN ADDR.
R1=CURRENT VALUE
R2=RESERVED
R3=MULTIPLIER
R4=DIGIT/LOOP COUNTER
R5=PRODUCT/PLACE VALUE MULTIPLIER(COPIED)
R6=PRODUCT/PLACE VALUE MULTIPLIER
R7=ACCUMULATOR

Wow. This was incredible ?

I'm not sure if I was missing anything but for some reason I had to end up adding 7

to R7? But anyway I figured it by watching the registers in action.

Thanks again, Mr automation! It's exactly what I was looking for.

FYI, I came up with a longer routine myself that captured the first 2 characters of the 3 that are present. These are the three that kick off the whole math thing. And my math had to add 6 for every 10 characters in the first 100 acsii codes. Anyway, it did work,  but your routine is so much better.

Thank you again..I'm so excited to be finishing this section.

 

 

 

  • Thanks 1
Link to comment
Share on other sites

3 minutes ago, GDMike said:

Not sure. I'm just trying to get to saving to a file. I'll be so happy just to get there.

 

Fully understand.  I just wanted to point out that issue before you invested some serious time into all kinds of character features to make sure you were going down a path that would have those characters printable.

 

If you are thinking about the path of the dot matrix printer to our standard RS232 port, that would be a separate challenge than printing to a PI.PIO (PDF) route with a TIPI.  The latter could be tricky as well, however, once "defined", you could probably write to a standard format and all things would be good.  That's just a guess though.

 

I have followed some of your progress in this topic.  Is there something about saving a file you are trying resolve, or is it just a matter of writing code to do the file save? 

 

Beery

 

 

 

 

  • Like 1
Link to comment
Share on other sites

5 hours ago, BeeryMiller said:

 

The code for saving and loading files just hasn't been started yet. I'm going to try and attempt doing that as early as this week. I need to finish my call char routine, cleaning up loose ends, then the fun begins. I'll first get a memory map built, as a reference sheet to aid me, of where my pages exist, the length and also where I have free memory and where that is. I expect that will be needed. And then I need to figure out what terminology I'll use for the call, as in save DSK.xxxx and old DSK.zzz, or whatever that would be. But I haven't put much thought into it yet.

Let me know what else to plan for.

Edited by GDMike
Link to comment
Share on other sites

1 hour ago, GDMike said:

The code for saving and loading files just hasn't been started yet. I'm going to try and attempt doing that as early as this week. I need to finish my call char routine, cleaning up loose ends, then the fun begins. I'll first get a memory map built, as a reference sheet to aid me, of where my pages exist, the length and also where I have free memory and where that is. I expect that will be needed. And then I need to figure out what terminology I'll use for the call, as in save DSK.xxxx and old DSK.zzz, or whatever that would be. But I haven't put much thought into it yet.

Let me know what else to plan for.

 As far as terminology, let me throw this out to you.  Consider using LF (Load File) and SF (Save File) which are commands TI-Writer uses.  There is also PF for Print File.

 

Using each of those commands, by themselves, then pulls up the request to give the path to save/load/print.  That would reduce line parsing.


Beery

 

 

  • Like 1
Link to comment
Share on other sites

The latest update of SNP and another program for clearing memory of >6000->7FFF called SC

There's a what's this file for directions 

Oops, I made mention of the"HIST" file and forgot to include it.

Sorry, I'll get it there.

I had a version of SC that allowed silencing the beeping beep. But I lost it, I dunno where it is. I can tell this vers. Was incomplete as I can see option 8 is still there... but opt 5 does the same thing..oh well

Btw, F5 has some commands, Call beep, call honk, call color (FB) and call char(1-254).

DSKA0061.dsk

Edited by GDMike
Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Loading...
  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...