Jump to content
IGNORED

Supernotes


GDMike

Recommended Posts

1 hour ago, BeeryMiller said:

I think I went back and edited my post, so please go back and check it again as I added some significant details for you to consider.

Ahh. Yes. OK, well that would help for those situations. Good to know.

Thx for that great documentation and research. I'll place it in my "planning" book. 

If i encounter something, I'll post it.

BTW, would there ever be a situation for a file to look like:

"DSKA.FILE" or "DSK.FILE"

Or anything other than "DSK", besides, "CS1" or 2.

Thx Mr. Beery

Edited by GDMike
Link to comment
Share on other sites

7 hours ago, GDMike said:

BTW, would there ever be a situation for a file to look like:

"DSKA.FILE" or "DSK.FILE"

Or anything other than "DSK", besides, "CS1" or 2.

 

Yes. The device name (everything before the first dot) is how DSRLNK finds the correct DSR. The TI controller only answers to DSK1, DSK2, DSK3 and DSK. If you use DSK, you must include the disk name or the device will not be found (DSK.DISKNAME.FILENAME). Other disk controllers allow/require additional device names such as SCS1, IDE1, etc. Any DSR can include whatever name it likes in its linked list for device names. Some DSRs allow subdirectories (TIPI, SCSI, HFDC, etc.). Others will jump in with better information, I have no doubt. :)

 

...lee

  • Thanks 1
Link to comment
Share on other sites

If you want/desire to implement CPU to DISK instead of CPU to VDP to DISK transfer for those devices that will support it, then you will likely need to add some detect code right before you go into a DSRLNK call testing for compatible devices.  As users are likely to save to one device initially, and then potentially save to another device later, you will probably need the detect code for device.  This may involve scanning the desired DSR table for the device looking for WDSx or SCSx.  Others will have to speak up if there are other devices that support the capability for CPU to DISK transfers (and vice versa).  SCSx and WDS should be east to test by just the PAB name.  If they save to DSKx devices of those controllers, then you will need to identify supported devices.  Somewhere, someone has some device detect code they would be willing to share.

 

If need be, I suppose there is some code in MDOS for the Geneve to distinguish devices, but I am sure there are some better sources  elsewhere.

 

Beery

  • Thanks 1
Link to comment
Share on other sites

I've completed the search for "DSK" on my command line, I'll need, and hope to find, all aspects of that, to complete my command line search. The command line does the configuration of the device after it's found in order to prepare it for DSR.

The way I've set up my command line, requires a library element to be created, as it's libr1 is set as"DSK" and so on, in this case, and that word is placed in ram and my search routine searches memory location based on the library address. I have a few library elements created. It makes future library elements easy to add and search for, as my search sets up the first library and continues search all libraries in order until found or not. 

Thank you. Mr beery

Edited by GDMike
Link to comment
Share on other sites

On 6/9/2020 at 3:25 AM, HOME AUTOMATION said:

SNPHuh.thumb.jpg.b347ed4bbd62deebaae9d240b1f56874.jpgSNP, Huh!

I've tried to do a simple divide instruction to see how it's done, as I'm trying to get the bigger picture of converting a 1 to 3 digit ASCII number to hex. 

It's a simple thing, but I can't get it.

LI R3, >0042

LI R4, >10

DIV R3,R4

I'm supposed to get a

2 and remainder of 1.

For some reason I have no attachment option. I was going to show my registers in explorer and what my results were.

No where near what I thought I'd get.

Help. I'm starting to grasp these conversions, but I can't even get started with the correct layout. 

 

 

Link to comment
Share on other sites

7 minutes ago, GDMike said:

I've tried to do a simple divide instruction to see how it's done, as I'm trying to get the bigger picture of converting a 1 to 3 digit ASCII number to hex. 

It's a simple thing, but I can't get it.

LI R3, >0042

LI R4, >10

DIV R3,R4

I'm supposed to get a

2 and remainder of 1.

For some reason I have no attachment option. I was going to show my registers in explorer and what my results were.

No where near what I thought I'd get.

Help. I'm starting to grasp these conversions, but I can't even get started with the correct layout. 

 

 

Is this hex value for display purposes, or for a variable to be used in your assembly code for other purposes?

 

The Blue TI Assembly Language book should have the routine(s) in there.


Beery

  • Like 1
Link to comment
Share on other sites

1 hour ago, GDMike said:

I've tried to do a simple divide instruction to see how it's done, as I'm trying to get the bigger picture of converting a 1 to 3 digit ASCII number to hex. 

It's a simple thing, but I can't get it.

LI R3, >0042

LI R4, >10

DIV R3,R4

I'm supposed to get a

2 and remainder of 1.

For some reason I have no attachment option. I was going to show my registers in explorer and what my results were.

No where near what I thought I'd get.

Help. I'm starting to grasp these conversions, but I can't even get started with the correct layout.

The TI Editor/Assembler manual explains the instruction, as Beery commented above.

Basically, the value you're dividing is a 32-bit word that occupies two registers (or 16-bit words in memory). The value you're dividing by is a 16-bit value in a single register (or 16-bit word in memory). With the DIV instruction, the first value is the value you're dividing by, and the second value is the value you're dividing. So for your example you want something like:

CLR R3   'Put the value you're dividing in R3 and R4. You're only dividing a small number so R3 is clear.

LI R4,>0042

LI R5,>10 'Value you're dividing by.

DIV R5,R3

After the operation, R3 contains the quotient, and R4 the remainder.

Link to comment
Share on other sites

1 hour ago, BeeryMiller said:

Is this hex value for display purposes, or for a variable to be used in your assembly code for other purposes?

 

The Blue TI Assembly Language book should have the routine(s) in there.


Beery

Ahh. I thought my numbers, both registers, could be in LSB only.

Not true I see. This is why I'm asking..

Beery, it's input from the user and can be a number from 0-254.

I got the zero weeded out in code, I've also weeded out a real 1 digit opposed to 007 for example, and 070 would be taken as ASCII 70.

 

 

Link to comment
Share on other sites

The description is correct. As second operand, you specify the first register of the 32bit number, here, R3. The dividend is (R3,R4) = (R3<<16)+R4.

 

The divisor is the word at (ADR + contents of R2). The result is in R3 (quotient) and R4 (remainder).

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

For what it's worth...

 

This is the kind of thing where a Forth style assembler and Classic99 can be really handy to explore how instructions work without compiling the entire program and writing special test code to display results or memory locations.  Then you can take what you've learned and confidently code it into your application.

 

With the MARKER directive you can purge your little routine from the system without removing all the tools (Assembler etc..) and just re-assemble the little routine over and over until it works!

 

I am using my Forth here but all the others can do the same thing.  Not bad for 1970's technology. :) 

Spoiler

\ You can play with Assembler in tiny pieces in Forth to learn
\ then convert back to TI assembler for the actual program
\ Paste this into Classic99 with Camel Forth running

\ Mitzaph's example
\ LI   R3,0
\ LI   R4,101
\ LI   R2,4
\ DIV  R2,R3


\ conditionally pull in the Assembler and some tools
NEEDS MOV,   FROM DSK1.ASM9900    \ load the assembler
NEEDS MARKER FROM DSK1.MARKER
NEEDS .S     FROM DSK1.TOOLS


\ translate to Camel Forth for interactive testing
MARKER  REMOVE \ REMOVE forgets our code but keeps the assembler & tools

DECIMAL
CODE DIVTEST ( -- n tos )  \ tos is R4 in Camel99 Forth
              TOS PUSH,    \ SAVE R4 (called TOS). gives us free use of R4
\ Mitzaph's example in Forth Assembler
              R3 0   LI,
              R4 101 LI,
              R2 4   LI,
              R2 R3 DIV,   \ R4, the TOS register should be 1
              R3   PUSH,   \ Push R3 onto Forth stack so we can see it easily
              NEXT,        \ return to Forth
              ENDCODE

 

 

 

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

3 hours ago, mizapf said:

Example:

 


LI   R3,0
LI   R4,101
LI   R2,4
DIV  R2,R3

 

Result should be R3 = 25, R4 = 1.

 

Yes it works in explorer the way you show. But I tried with >42 which is ASCII for asterisk>2A. And got a 4.

I'm trying to pull a >2A out of my R4,>42.

My formula places a result of hex 42 into my R4. Even though it isn't >2A it represents what I'm trying to convert into a Asterisk.

I looked online and I found that if I divide the hex 42 until 0 and count the remainder and convert the remainder into a character 1 for A 2 for B that's how it would work. And it worked fine on my calculator but I can't get it to work in explorer.

Thx

 

 

IMG_20200610_205923159_HDR.jpg

Edited by GDMike
Link to comment
Share on other sites

your example is dividing HEX 42 ( DECIMAL 66) by HEX 0A ( DECIMAL 10)

So that gives the result 6 with 6 as the remainder.

I am not sure what you want to do exactly. Convert a binary number into ascii digits?

 

Classic99 QI399.025 2020-06-10 10_19_57 PM.png

  • Thanks 1
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...