Jump to content
gregallenwarner

SAMS usage in Assembly

Recommended Posts

18 hours ago, apersson850 said:

Ehhm, you can't use the same register as a pointer and counter (R2). MOV also moves two bytes at a a time, so it takes four MOV to move eight bytes.

 

But I understand what you intended to illustrate.

Yeah, yeah, yeah. I don't think I'll debug my code anymore, I'll just post it to the internet. ;)

Share this post


Link to post
Share on other sites

Attached is an attempt to explain why an application should modify a SAMS register by writing a WORD and not a BYTE.  It looks like most software is doing that but there still seems to be some questions about it.  My thanks to apersson850 and Stuart for their inputs and edits.  Would also like to thank TheBF and mizapf for good discussion on the subject.

 

 

SAMS registers explained_Srt_AP edits.rtf

  • Like 3
  • Thanks 2

Share this post


Link to post
Share on other sites

Good. Glad to read this. TurboForth always writes a word when using >MAP - but not because of any great insight from me - I just cribbed it all from the original SAMS docs/driver disks 🤓.

 

  • Like 2

Share this post


Link to post
Share on other sites
16 minutes ago, Willsy said:

I just cribbed it all from the original SAMS docs/driver disks 🤓.

 

...which (the duplication of bytes) only works for SAMS RAM ≤ 1 MiB. For SAMS RAM > 1 MiB, the actual SAMS bank goes into the word (>0345, say) and the bytes are swapped (>4503) before writing the word to a SAMS register.

 

...lee

  • Like 1

Share this post


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

 

...which (the duplication of bytes) only works for SAMS RAM ≤ 1 MiB. For SAMS RAM > 1 MiB, the actual SAMS bank goes into the word (>0345, say) and the bytes are swapped (>4503) before writing the word to a SAMS register.

 

...lee

Good point. I'm very rusty. So the best I can say is TF will work for up to 1MB on a 4MB card. I think. It's an easy fix to make it work with 4MB cards. Assuming I have enough bytes free 🤯

  • Thanks 1

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