Jump to content
IGNORED

My assembly questions thread


Recommended Posts

19 minutes ago, Andrew Davie said:

 

I totally don't understand your usage of "align" or what you're trying to do here.

If it's to get bankswitching code in the right place, then I've not seen it done using aligns. It might work.

Generate a listing file, and have a look at the assembly. That will clearly show you what is where.

I have only ever used "align" to get to page boundaries.  The "align 133" would, I assume, align to the 133rd byte in the current page, except where you're already past that, in which case it will be the 133rd byte in the NEXT page. It's still bizarre usage to me, tough.

You code, as shown, does not seem to have much of any idea where it is related to page boundaries.

Not saying it's wrong - it's just very foreign to me, this usage.

Yes it's to get the bankswitching code in the right place, I was using nop's but since I have a compile time condition and probably will add more I thought I'd try it instead of adding compile time conditions with different amount of nop's, align seemed like the obvious choice, but maybe there's better ones? I would like to know.

 

 

  6096               4c a4 b0           jmp    .bs6 
  6099
  60a4               00 00 00 00*          align    133
  60a4               .bs6
  60a4               ad f7 1f           lda    $1FF7

 

I wouldn't say clearly, I can't read hex, I thought the low byte of the address was the number of bytes into the current page (high byte),

I was displaying that in my score as decimal to see where I was, but I seem to have been wrong?

How do I use these hex numbers to my advantage not knowing what they mean?

Link to comment
Share on other sites

3 hours ago, Lillapojkenpåön said:

Yes it's to get the bankswitching code in the right place, I was using nop's but since I have a compile time condition and probably will add more I thought I'd try it instead of adding compile time conditions with different amount of nop's, align seemed like the obvious choice, but maybe there's better ones? I would like to know.

 

 

  6096               4c a4 b0           jmp    .bs6 
  6099
  60a4               00 00 00 00*          align    133
  60a4               .bs6
  60a4               ad f7 1f           lda    $1FF7

 

I wouldn't say clearly, I can't read hex, I thought the low byte of the address was the number of bytes into the current page (high byte),

I was displaying that in my score as decimal to see where I was, but I seem to have been wrong?

How do I use these hex numbers to my advantage not knowing what they mean?

 

Well, that number on the left is the address, in hex.

A4 is  164.  That's the low byte of the address of the label .bs6 within a page.

Since the code says "align 133" this is clearly not working as you expect.

I would actually call this a bug in the "align" statement in dasm. I will follow that up with some tests and a bug report if needed.

But basically, it does not look to me like your code is handling things as you expect.

 

You could set a label to do what you want... something like this...

 

HERE SET *
 ; some code for 1st block
	jmp .bs2

; unused filler is here

HERE SET HERE + 133
	ORG HERE
.bs2
 ; some code that lives in the 2nd block

	jmp .bs3
    
 ; unused filler is here
    
HERE SET HERE + 266 ;? is it in 133 groups??
	ORG HERE
.bs3
 ; some code that lives in the 3rd block

	jmp .bs4
 

Hope that makes sense, and that it works :)

 

  • Thanks 1
Link to comment
Share on other sites

Haha, what are the odds of me accidentally checking the wrong previous label, and using that number causes it to align to the right address, 164 is exactly where it should be ?

to many here's, would this work

_bank6data SET *
 ; some code for 1st block
	jmp .bs2

; unused filler is here

bs6 SET _bank6data + 164
	ORG bs6

 

or this

 

; some code for 1st block

 jmp .bs6

 

; unused filler is here

 

ORG $60a4

.bs6

 

Link to comment
Share on other sites

1 hour ago, Lillapojkenpåön said:

or this

 

; some code for 1st block

 jmp .bs6

 

; unused filler is here

 

ORG $60a4

.bs6

 

this looks good in the listing file but only black screen, why? other ORG's interfering?

the other one, that should have been _bank6data + 31, also looks good, but origin reverse-indexed error ?

Edited by Lillapojkenpåön
Link to comment
Share on other sites

7 hours ago, Lillapojkenpåön said:

How do I use breakif { _scan==#263 } in Stella? I thought I remembered being able to paste it in there but I can't

 

"breakif _scan==40" works for me.

The number is hexadecimal, so the above example will break on scanline 64.

 

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