Lets say I have declared:
enemy_collided .rs 4
is it the same to refer to element zero as;
(a) STA enemy_collided
(b) STA enemy_collided, x (when x is 0)
I thought is was the same, but I am having some bug related to this.
Arrays in ASM question
Moderator: Moderators
Re: Arrays in ASM question
It is exactly the same.
Here come the fortune cookies! Here come the fortune cookies! They're wearing paper hats!
- rainwarrior
- Posts: 8062
- Joined: Sun Jan 22, 2012 12:03 pm
- Location: Canada
- Contact:
Re: Arrays in ASM question
Not exactly the same. The finished result should be the same, but the indexed instructions take slightly longer to execute, and there are other obscure differences.
Re: Arrays in ASM question
If X = 0, absolute indexed loads take exactly as long as absolute loads. Stores take longer because the CPU is busy double-checking the carry from the low byte of the address to the high byte before it does anything permanent
Re: Arrays in ASM question
What's your bug, exactly?sempressimo wrote:I thought is was the same, but I am having some bug related to this.
- sempressimo
- Posts: 46
- Joined: Wed Nov 04, 2015 7:13 am
Re: Arrays in ASM question
Cant tell know as I opted to rewrite most of the affected logic anyhow. Before I was treating the player as one object, enemeies as its own object array but then decided to just have them all as one object array and share background collision logic among others. Still keeping items as a separate objects.furrykef wrote:What's your bug, exactly?sempressimo wrote:I thought is was the same, but I am having some bug related to this.