Jump to content
IGNORED

Supernotes


GDMike

Recommended Posts

5 minutes ago, GDMike said:

I tried using DBF0(R5) and changing the value of R5 as a pointer during an incrementing of R5 for 4 increments pushing a different value into DBF0, which is a memory EQU label.

But when I tested to view the memory addresses manually, they did not show the values that I stored at DBF0 + the value of R5, or the next address of DBF0 which is pointing to>79D6,  I dunno why.

But I have an idea to just move the 4 bytes that happen Prior to my larger loop that isn't mentioned here, straight to high ram.

The only difference here is that I was gonna do the move after gathering the complete loop iterations, but I can handle it this way.

 

From your writeup it sounds like you are trying to change an EQU.

 

You need to be sure there is "DATA" at that specific address  named with an equate.

It might be better to use a label at the DATA or BSS statements?

 

So the code needs to be something like:  (not tested)

DBF0     DATA  0000,0000,0000,0000

INITS    LI  R1, >994A
             CLR R5

 LOOP1  MOV R1,DBF0(R5)
             INCT R5
             CI R5, 6
             JNE LOOP1

 

Link to comment
Share on other sites

16 minutes ago, GDMike said:

I tried using DBF0(R5) and changing the value of R5 as a pointer during an incrementing of R5 for 4 increments pushing a different value into DBF0, which is a memory EQU label.

But when I tested to view the memory addresses manually, they did not show the values that I stored at DBF0 + the value of R5, or the next address of DBF0 which is pointing to>79D6,  I dunno why.

But I have an idea to just move the 4 bytes that happen Prior to my larger loop that isn't mentioned here, straight to high ram.

The only difference here is that I was gonna do the move after gathering the complete loop iterations, but I can handle it this way.

 

You need to insure that DBF0 is not being changed by something else. It might be better to make DBF0 the label for the block of data you are writing:

DBF0   BSS 1024      reserve 1 KiB block for data 

[I see @TheBF beat me to my recommendation so it must be good advice!]

 

...lee

  • Like 1
  • Haha 2
Link to comment
Share on other sites

Just now, Lee Stewart said:

 

You need to insure that DBF0 is not being changed by something else. It might be better to make DBF0 the label for the block of data you are writing:


DBF0   BSS 1024      reserve 1 KiB block for data 

[I see @TheBF beat me to my recommendation so it must be good advice!]

 

...lee

 

Some code would help!!

 

...lee

  • Like 2
Link to comment
Share on other sites

1 minute ago, Lee Stewart said:

 

You need to insure that DBF0 is not being changed by something else. It might be better to make DBF0 the label for the block of data you are writing:


DBF0   BSS 1024      reserve 1 KiB block for data 

[I see @TheBF beat me to my recommendation so it must be good advice!]

 

...lee

I've been hanging around you long enough now that I'm starting to catch on.

  • Haha 3
Link to comment
Share on other sites

35 minutes ago, GDMike said:

I tried using DBF0(R5) and changing the value of R5 as a pointer during an incrementing of R5 for 4 increments pushing a different value into DBF0, which is a memory EQU label.

But when I tested to view the memory addresses manually, they did not show the values that I stored at DBF0 + the value of R5, or the next address of DBF0 which is pointing to>79D6,  I dunno why.

But I have an idea to just move the 4 bytes that happen Prior to my larger loop that isn't mentioned here, straight to high ram.

The only difference here is that I was gonna do the move after gathering the complete loop iterations, but I can handle it this way.

 

19 minutes ago, TheBF said:

From your writeup it sounds like you are trying to change an EQU.

 

I agree with @TheBF. You cannot change what DBF0 points to. If it points to >79D6 at assembly time, it will always point to >79D6. We need code to assess what it is you are attempting!

 

...lee

  • Like 2
Link to comment
Share on other sites

46 minutes ago, GDMike said:

...  I dunno why.

But I have an idea to just move the 4 bytes that happen Prior to my larger loop that isn't mentioned here, straight to high ram.

The only difference here is that I was gonna do the move after gathering the complete loop iterations, but I can handle it this way.

 

It is certainly fine to try a different tack, but you really do need to track down your errors and misconceptions. That is what makes you a better programmer. So, once again, we need the code.

 

...lee

  • Like 2
Link to comment
Share on other sites

DBF0 EQU >79D6

...

...

  

           BLWP @VSBR

           CLR R5

           Movb  R1,@DBF0(R5)

* 1st byte into address >79D6

           INC  R5

           SWPB R0         * move to MSB

           MOV R0,@DBF0(R5)

* 2nd byte, cursor location into address >79D7

 

           INC R5

           SWPB R2         * move to MSB

 

           MOVB R2,@DBF0(R5)

* R2 value of field length into address >79D8

 

And that's the gist of it.

 

 

 

 

 

 

 

 

 

 

Edited by GDMike
Link to comment
Share on other sites

This, I can attempt to understand at a glance...

DFBO   EQU  >79D6
  
       BLWP @VSBR
       CLR  R5
       MOVB R1,@DBF0(R5)

* 1st byte into address >79D6

       INC  R5
       SWPB R0            * move to MSB
       MOV  R0,@DBF0(R5)

* 2nd byte, cursor location into address >79D7

       INC  R5
       SWPB R2            * move to MSB
       MOVB R2,@DBF0(R5)

* R2 value of field length into address >79D8

image.gif.0f1433d717dfce75cdceb80b9ee7b27b.gif

And that's the gist of it.

 

----------------------------------------------------------------------------------------------

 

What you posted above, I must attempt to recognize ...leaving far less of the expanse of my mind available for comprehension.

Thus, arriving at a level, beneath that which I can determine is reasonably befitting of my serious consideration.:(

 

Many lines of spacing between code, disorderly alignment, and NeeDleSs case variations, can itself, seem diffusing to the point of abandon.

 

...Just me...:ponder:

  • Haha 1
Link to comment
Share on other sites

It's not a snipet. It's just typed in on my phone. Just remember, li is the same as LI or load immediate and mov in this scenario is really the same as MOV, and etc. I might not have capitalized each instruction, and I might not have exactly the recommended spacing between operands.

 I'm not needing a part of code rebuilt, just trying to understand the incrementing of the address for my next move instruction.

Yes. Just you..I guess  because I think I said I was just going to type in what I was essentially trying to accomplish without getting and making it too complicated, guess I made it complicated.

 

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

First let me say, it's really hard to explain by typing... but with that said, I do have a work around by just creating 4 equate statements instead of trying to move 4 individual bytes this way. And of course that puts my data directly into the addresses I need. But like willsy said, it be nice to know why something doesn't work.

Link to comment
Share on other sites

7 minutes ago, Asmusr said:

MOV  R0,@DBF0(R5) won't work because it will write MSB to >79d6 (overwriting the first byte you wrote) and LSB to >79d7. What do you have in R0 anyway, the address you just used for BLWP @VSBR?

That's probably the issue, because I was hoping (R5) was pointing to address>79D7 and I didn't care about the LSB because the next Instruction would take care of that by pushing into>79D8.

 

Edit: I mean (R5) would allow for pointing to the next address.

 

Edited by GDMike
Edit for clarity
Link to comment
Share on other sites

9 minutes ago, GDMike said:

That's probably the issue, because I was hoping (R5) was pointing to address>79D7 and I didn't care about the LSB because the next Instruction would take care of that by pushing into>79D8.

If you try to write to an odd address using MOV you will write to the (one lower) even address instead.

 

If you want to write the MSBs of R0, R1 and R2 to >79D6, >79D7, and >79D6 you can also do it like this:

LI R5,DFB0

MOVB R0,*R5+ 

MOVB R1,*R5+ 

MOVB R2,*R5 

Edited by Asmusr
Link to comment
Share on other sites

2 minutes ago, Asmusr said:

If you try to write to an odd address using MOV you will write to the (one lower) even address instead.

 

If you want to write the MSBs of R0, R1 and R2 to >79D6, >79D7, and >79D6 you can also do it like this:

LI R5,DFB0

MOVB R0,*R5+ 

MOVB R1,*R5+ 

MOVB R2,*R5 

didnt think about it that way.  Ill have to study it. that is prob what I want! ty

Link to comment
Share on other sites

1 minute ago, GDMike said:

didnt think about it that way.  Ill have to study it. that is prob what I want! ty

i was just going to intentionally write to MSB and not care about the odd byte because I was hoping to write to the MSB of the even byte in each case, so I knew that part, BUT when I read the locations manually I didnt get the MSB of what i wrote. possibly I wasnt reading the address correctly as well. But i see what your saying here

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