Jump to content
gregallenwarner

SAMS usage in Assembly

Recommended Posts

 

My 99/5C looks like it will be shipping in the next week or so, and I want to make sure I understand the memory mapping correctly. Since it has 9938 capability, I am going to look at what I can accomplish with the TIPI with the 99/5C to get at least 80 column ANSI capability working with Mass Transfer.

 

 

"99/5C" ? What it means?

Share this post


Link to post
Share on other sites

Eric Firestone has developed a new computer on an approximate 6" by 6" board. It emulates a TI-99/4A with an IDE hard drive, 1 MB AMS memory, VGA, 3 wire RS232, USB keyboard, USB mouse interfaced to the 9938, SID, 4 Myarc floppies, and supports most all of the modules out there. It's a hardware take-off of PC99. It has a cartridge slot, along with PEBox/firehose interface. A few more details are at: http://caddelectronics.com/product/cadd-995c/ . It's got like 4 microprocessors on board to handle everything.

 

It is not cheap at $799 USD, but has quite a bit of potential. I'm getting one of the prototypes to be replaced/traded with the final version when his next run comes in. He is also developing a couple of other boards to attach to opto-isolate the board from the PEBox or cartrdge port.

 

Eric has also hinted it may be able to emulate more than just the TI-99/4A which also stoked some extra interest on my part. Nothing else I am aware for anything other than a TI-99/4A has been done to this point in time. I'm waiting for the next offering of Matt's sidecar TIPI to add that to the setup, then it would be internet ready!

 

Beery

  • Like 1

Share this post


Link to post
Share on other sites

Thank you for these informations. I didn't heard about it before.

It's emulation via modern ARM microprocessors . I Hoped it was a real true TI-99 computer with mythical components

Edited by fabrice montupet

Share this post


Link to post
Share on other sites

I'm using the example in the beginning of this thread, and I'm misunderstanding

Something.

After turning on the card and setting the page #, ( because I'm good up to this),

I wanted to set >2000 for all of my pages.

LI R1,>0100 (to be inc later)

And LI R3,>4002

Mov R1,*R3+

And SBO 0

A couple things..

I tried to use a limi 2 limi 0 

I also tried to do a blwp @vsbw 

And neither would work.

But the previous commands as shown do.

I want to keep this active and do other things but I'm not seeing how to do that.

Also, I have a question. If I place data into my pages do they corrupt when I change pages? And if I place something in >2000 does that>2000 get duplicated when I create a new page as above with my old >2000 data being put into my new >2000 data or is my new defined address page init to zeros or ??

 

 

 

Share this post


Link to post
Share on other sites
20 minutes ago, GDMike said:

I'm using the example in the beginning of this thread, and I'm misunderstanding

Something.

After turning on the card and setting the page #, ( because I'm good up to this),

I wanted to set >2000 for all of my pages.

LI R1,>0100 (to be inc later)

And LI R3,>4002

Mov R1,*R3+

And SBO 0

A couple things..

I tried to use a limi 2 limi 0 

I also tried to do a blwp @vsbw 

And neither would work.

But the previous commands as shown do.

I want to keep this active and do other things but I'm not seeing how to do that.

Also, I have a question. If I place data into my pages do they corrupt when I change pages? And if I place something in >2000 does that>2000 get duplicated when I create a new page as above with my old >2000 data being put into my new >2000 data or is my new defined address page init to zeros or ??

 

 

 

I am certainly no expert, but I got mine to work.  The source code is here in Forth Assembler.

https://github.com/bfox9900/CAMEL99-V2/blob/master/LIB.ITC/SAMS.FTH

 

It is in actually Machine code but the ASM Source is in the comments.

 

What I know regarding your questions:

My experience is that data stays in the card as long as it is powered. So you can put stuff in memory and page it in anytime you need it.

The 32K expansion RAM page is independent of the SAMS card. If you turn off SAMS, you get the expansion RAM memory.

Switch the card on and you get the SAMS page back.

 

My code uses >3000 as the page address so take that under advisement.

I also use a "SEG" variable to select different 64K segments.

And I maintain a BANK# variable so that I don't have to needlessly switch if the BANK# is already selected.

 

It might give you some insights. :?:

 

 

 

 

  • Like 1

Share this post


Link to post
Share on other sites
Posted (edited)

Thanks. Yeah when I was using Turboforth, man.. that was so very simple.

But now in assembly I can't take anything for granted .

I made a Page, this may be wrong, but I don't know what the wording is, clone

I made a clone of >2000

I kept the card on Because my program is always going to use>2000 my page 1 

Until a certain key is pressed and then I will change it to page 2( a clone address)

But I noticed that now when I try to use [email protected] my system hangs.

I doesn't hang though when I turn the card to revert mode...

But I don't want to revert..

Is there a way to leave it activated all the time? Hmm

Also I noticed I can't do a limi 2 limi 0 either.

I use that for my escape route in my program and I move that further and further down until my program works for that area I'm currently working in.

Yes, I have that init code as well.

But here in just going to use >2000 for pages 1-240

It's 4K blocks that use 4 screen pages

My scr pages are 860 bytes

So I basically grab page2 SAMs after I fill 4 scr pages and that goes on and on..

Edited by GDMike

Share this post


Link to post
Share on other sites
7 minutes ago, GDMike said:

Thanks. Yeah when I was using Turboforth, man.. that was so very simple.

But now in assembly I can't take anything for granted .

I made a Page, this may be wrong, but I don't know what the wording is, clone

I made a clone of >2000

I kept the card on Because my program is always going to use>2000 my page 1

Until a certain key is pressed and then I will change it to page 2( a clone address)

But I noticed that now when I try to use [email protected] my system hangs.

I doesn't hang though when I turn the card to revert mode...

But I don't want to revert..

I believe your problem is because all the VDP support routines are loaded in low RAM by the E/A cartridge.

When you page in the SAMS card they disappear. :)

Can you move your page to >3000?

  • Thanks 1

Share this post


Link to post
Share on other sites
Posted (edited)

I forgot one change.

I'm assembling.

Here is some photos

First is the main program calling each routine.

SAMSON routine, turn on card

Ok. Assembling done and it works.

This is some of the routines..

Yes, your right. That was the issue.

Now I did think about this, and so I did this prior, as I moved over to 4000 though instead. 

So I better stick with 3000

I'm safe! I only need to page in/out of 1 block of anything greater than 860...

So, yes I'll have to deal with moving around 4 screen pages into those pages of 4K at >3000.

No biggy.

Should give me about 980 or so screens. I don't have the exact number handy, but something like it.

 

 

IMG_20200303_201205063_HDR.jpg

IMG_20200303_200818024_TOP.jpg

IMG_20200303_200642451_TOP.jpg

Edited by GDMike

Share this post


Link to post
Share on other sites
Posted (edited)

Thank you!! 2 eyes are better.

I didn't change my other procedure to reflect the equ change I made.

Duh...

Thanks sir BF

Note: the point of putting an asterisk was to simulate my next routine as I need to write to the screen, it also provides me an escape out with fct= 

That's why that is temp there.

Edited by GDMike
  • Like 1

Share this post


Link to post
Share on other sites

You can't move to >4000 because that is where the DSR routines are located.

Well... maybe could do it, but you could not use SAMS while you were using disk for example

  • Thanks 1

Share this post


Link to post
Share on other sites
Posted (edited)

Yup..I got it...I was grabbing

So I started low and was moving up..then it lead to other probs of course..

Yup I understand fully since when you said, BLWP us your low address pointer area .then bam! Like a short..

I knew then... it wasn't really free

Hahaha

Yayhoooo...I'm making progress..I quit

Lol

Edited by GDMike

Share this post


Link to post
Share on other sites
48 minutes ago, GDMike said:

IMG_20200303_201205063_HDR.jpg

IMG_20200303_200818024_TOP.jpg

IMG_20200303_200642451_TOP.jpg

Hate to do this now, but... None of the:

 

MOV R11,SAVRTN
MOV SAVRTN,R11

 

serve any real purpose in your examples.
So, you could remove them all.

 

They are really only needed when you're going to BL to a "deeper level", such as:

 

MOV R11,SAVRTN
*
* program lines
*
BL  @DEEPER     * this line would overwrite R11, that's why you'll want to save R11 first.
*
* program lines
*
MOV SAVRTN,R11
:)

Share this post


Link to post
Share on other sites
Posted (edited)

The first photo is my BL to these other photos, the last two pictures are routines that I BL to from the first photo.

It's all working..I just didn't have, #1, the correct empty address set, and#2, I didn't adjust my address change from>2000 to the new >3000

In another form, not shown.

Edited by GDMike

Share this post


Link to post
Share on other sites

This is a good topic, I don't think I've seen it before.

:-o

I got "brain lock" on page 2 or 3 tonight ...but will review more, later...

:ponder:

 

...sorry I didn't help with you're main issue though!

:roll:

 

Oh, about the SAVRTNs... They're only needed if you BL again, whilst you're already within a BL.

:twisted:

  • Like 1

Share this post


Link to post
Share on other sites

 this isn't the complete program. It's just snippets of a couple of routines that I BL to from the main program in the first photo and I return to with a RT.  I know that the asterisk is a remark and doesn't do anything, but it's a note.

 

 

Share this post


Link to post
Share on other sites
Posted (edited)
11 hours ago, HOME AUTOMATION said:

 

Oh, about the SAVRTNs... They're only needed if you BL again, whilst you're already within a BL.

:twisted:

Or to put it another way related to your Forth usage,  R11 is the "return" stack of 9900.  But it is only 1 address deep! :( 

 

So you BL to a sub-routine and R11 remembers how to "return".   IF you try to BL inside of a sub-routine, R11 gets written again to know how to return to the 1st sub-routine but you have now lost your way home to the main program.

 

While inside a sub-routine you must therefore MOV R11,@SAVRTN.  I have seen people create SAVRT1, SAVRT2, SAVRT3 for nesting purposes. 

 

If you want to have sub-routines that call sub-routines to deep levels you could make your own return stack system. :) 

That is distasteful to some 9900 coders because they prefer workspaces.

 

I think a stack implementation could use less memory in a program with deeply nested sub-routines but it would depend on the complexity of the program.

But it means each sub-routine is entered with two instructions and returns with two instructions, but it's cool to have one.

 

 

Edited by TheBF

Share this post


Link to post
Share on other sites
1 hour ago, TheBF said:

While inside a sub-routine you must therefore MOV R11,@SAVRTN.  I have seen people create SAVRT1, SAVRT2, SAVRT3 for nesting purposes. 

 

But—as @HOME AUTOMATION indicated, this is ONLY necessary if you BL within a BLed sub-routine.

 

...lee

Share this post


Link to post
Share on other sites
Posted (edited)

Actually not at the moment. But I have not tested yet at what we did yesterday, was beezy putting out a fire...

But my next test is to place some data into>3002, (just an address to test within scope), and write that out, probably be>2A2A my fav..then see if it's there, then revert that with SBZ 1

And see if it is NOT there, then apply my page again and hopefully I'll see my asterisk...then just for grins, repeat for page 2.  Then I'll be either happy or have questions at that time.

Thank you for asking...

I think from everything I'm seeing, were looking very good.

 

Edited by GDMike

Share this post


Link to post
Share on other sites

Just an FYI, the latest version of Classic99's debugger now has the ability to view the AMS memory even if it's not IN active memory, which is a useful tool.

 

I got Mike to add that feature after I kept having problems with bad data that I couldn't see in memory until after pages had been swapped. :)

  • Like 2

Share this post


Link to post
Share on other sites

So far, I have

TPG1 EQU >3000

I did a

LI R1,>3120

LI R10,TPG1

Then I moved it with

MOV R1,*R10+

I echoed this to my screen as I see "1"

I now Did a BL @SAMON

Which is:

LI R12,>1E00

SBO 0

I then rt back with my R11 that I saved

I pick up the next instruction

BL @SP1

Which is this:

LI R1,>0100

This assigns my page 1

LI R3,>4003

MOV R1,*R3+

SBO 1

And I return accordingly

Then I BL @SM1I it's an upper(i)

Now, this section I have:

SMP1 EQU >3000

And this:

SM1I LI R1,>SMP1

           LI R0,0

           LI R2,>2020

SMII1 MOV R2,*R1+

           INCT R0

           CI R0,860

           JlT SMII1

And return accordingly

This inits my page with spaces

BUT Regardless of that, I go ahead and do the following as my test.

With everything above intact, I added this

LI R10,TPG1

LI R1,>3220

MOV R1,*R10+

LI R0, 40

And I echo my "2" to the screen

Now I did a BL @SAMOFF

LI R12,>1E00

It's a SBZ 0

And return accordingly

And at this point I thought the card would revert

But when I do LI R10,TPG1

MOV *R10+,R1

[email protected]

I still showed "2" 

Where I was supposed to show my original >3000 address data of"1"

 

 

 

 

 

 

 

 

 

Share this post


Link to post
Share on other sites

This is most difficult and frustrating to follow. It is backwards from what you need to show to allow us to help you. You need to show the actual code with the comments to the side or in lines starting with ‘*’. It simply is not worth the time investment to try to decipher your stream-of-consciousness rambling with its scattered snippets of code. Help us help you.

 

...lee

Share this post


Link to post
Share on other sites
8 hours ago, Lee Stewart said:

 

But—as @HOME AUTOMATION indicated, this is ONLY necessary if you BL within a BLed sub-routine.

 

...lee

Yes.  My bad. 

I called BLed routines  "sub-routines"  and BLWPed routines "sub-programs".  To me they are different animals but I did not make the distinction clear.

  • Like 1

Share this post


Link to post
Share on other sites
1 hour ago, Lee Stewart said:

This is most difficult and frustrating to follow. It is backwards from what you need to show to allow us to help you. You need to show the actual code with the comments to the side or in lines starting with ‘*’.

If GDMike has a serial card he can "print" his source code back to terminal on a PC.  That would let us see it in complete context.

 

Is that possible GDMike?

 

 

Share this post


Link to post
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.

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