Array putting garbage in register
Good evening all,
Sorry this is probably really simple but its been bugging me all day. I'm trying to populate an array with some colour values then point A2 at them. I'm not getting any compiler (AsmTwo) errors but looking at the value of A2 it just shows the value CCC. e.g. lea colour,a2 colour: dc.w $100,$200,$300,$400,$500 etc Any thoughts or pointers? har har |
Whats the entirety of your list of colours? Is one of them $ccc?
|
1 Attachment(s)
Its just a straight run of $100,$200,$300,$400,$500,$600,$700,$800,$900,$a00,$b00,$c00,$d00,$e00,$f00 to get a red fade. I have attached the whole code, following Protons guide but im trying to wander a bit.
|
That code you just listed works fine, show me the code that doesn't.
|
I can't see that you access any values in your color table at all. Hint: what would a move.w (a2)+,d0 do?
|
Sorry both i'm a bit shamefaced here, I just did a moveq #11,d2 and I see the correct value. It appears I'm not understanding how the output of AsmTwo displays data it seems. What was confusing me was when i exited the programe, AsmTwo was displaying CCC for the value of A2, I was expecting it to show $100 as the value for A2 as i had not advanced it. (sorry if im getting the terminology wrong)
Stingray, I think it moves the contents of A2 to D0 then increments A2 by two? Sorry another edit. Ok i get it now, CCC is the memory address that A2 is pointing to, not the first value of the array like I expected. If i look in the debugger I see all the values I stored starting at CCC through to CDB!. Assume this is because its an address register and not a data register.. |
Morning all, sorry another question.
In the attached code in the copper block, where i set the line to white with dc.w $180,$fff. If i change it to a move.w #$fff,$dff180 the rest of the copper executes successfully (top and bottom colour change borders are there but the white line isn't drawn. The HRM says copper accepts moves, waits and skips so i'm unsure why the line is not there. Any thoughts as to why the move isn't working? Thanks |
???
The copper does not understand 68000 code. When the HRM says it understands Move instructions, then it is refering to the Copper Move instruction, which is an even register in the first word and the value in the second word. |
Ahh ok, I understand now. Thanks PHX, I think i need to play some more with the basics first :)
|
All times are GMT +2. The time now is 11:51. |
Powered by vBulletin® Version 3.8.11
Copyright ©2000 - 2024, vBulletin Solutions Inc.