02 March 2018, 00:02 | #1 |
Registered User
Join Date: Oct 2003
Location: Sunny Wales
Posts: 100
|
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 |
02 March 2018, 00:08 | #2 |
Going nowhere
Join Date: Oct 2001
Location: United Kingdom
Age: 50
Posts: 8,986
|
Whats the entirety of your list of colours? Is one of them $ccc?
|
02 March 2018, 00:09 | #3 |
Registered User
Join Date: Oct 2003
Location: Sunny Wales
Posts: 100
|
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.
Last edited by Locash; 02 March 2018 at 00:42. |
02 March 2018, 00:41 | #4 |
Going nowhere
Join Date: Oct 2001
Location: United Kingdom
Age: 50
Posts: 8,986
|
That code you just listed works fine, show me the code that doesn't.
|
02 March 2018, 00:46 | #5 |
move.l #$c0ff33,throat
Join Date: Dec 2005
Location: Berlin/Joymoney
Posts: 6,863
|
I can't see that you access any values in your color table at all. Hint: what would a move.w (a2)+,d0 do?
|
02 March 2018, 00:50 | #6 |
Registered User
Join Date: Oct 2003
Location: Sunny Wales
Posts: 100
|
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.. Last edited by Locash; 02 March 2018 at 01:26. |
04 March 2018, 12:05 | #7 |
Registered User
Join Date: Oct 2003
Location: Sunny Wales
Posts: 100
|
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 |
04 March 2018, 12:52 | #8 |
Natteravn
Join Date: Nov 2009
Location: Herford / Germany
Posts: 2,496
|
???
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. |
04 March 2018, 13:03 | #9 |
Registered User
Join Date: Oct 2003
Location: Sunny Wales
Posts: 100
|
Ahh ok, I understand now. Thanks PHX, I think i need to play some more with the basics first
|
Currently Active Users Viewing This Thread: 1 (0 members and 1 guests) | |
Thread Tools | |
Similar Threads | ||||
Thread | Thread Starter | Forum | Replies | Last Post |
Limited Array Of CDTV Games | fondpondforever | Retrogaming General Discussion | 9 | 23 July 2015 14:20 |
Blitz2: Pointer to array | idrougge | Coders. Blitz Basic | 3 | 26 March 2015 21:44 |
Putting Amiga away for a Minimig | Nostromo | Retrogaming General Discussion | 111 | 12 June 2012 10:39 |
Putting a laptop into an Amiga? | Geon106 | Hardware mods | 4 | 17 January 2011 18:24 |
Putting adf onto cd-r (pc) | JACK98 | support.Other | 10 | 28 November 2008 10:44 |
|
|