Skip to content

Is there a way to access a member of a struct/class with assembly inline? #62

Answered by drmortalwombat
AGPX asked this question in Q&A
Discussion options

You must be logged in to vote
void P::test()
{
	auto pns = &ns;

	__asm {
	    lda #1
	    ldy #0      // <--- how to get the offset of 'ns'?
	    sta (pns),y    // <--- how to get the 'this'?
	}
}

This works. Unfortunately if has an issue with the inliner - I will check the issue right away :)

Replies: 5 comments 29 replies

Comment options

You must be logged in to vote
6 replies
@drmortalwombat
Comment options

@AGPX
Comment options

@drmortalwombat
Comment options

@drmortalwombat
Comment options

@AGPX
Comment options

Answer selected by AGPX
Comment options

You must be logged in to vote
4 replies
@AGPX
Comment options

@AGPX
Comment options

@drmortalwombat
Comment options

@AGPX
Comment options

Comment options

You must be logged in to vote
0 replies
Comment options

You must be logged in to vote
10 replies
@drmortalwombat
Comment options

@drmortalwombat
Comment options

@AGPX
Comment options

@drmortalwombat
Comment options

@AGPX
Comment options

Comment options

You must be logged in to vote
9 replies
@AGPX
Comment options

@drmortalwombat
Comment options

@AGPX
Comment options

@drmortalwombat
Comment options

@drmortalwombat
Comment options

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
2 participants