English Amiga Board


Go Back   English Amiga Board > Coders > Coders. Asm / Hardware

 
 
Thread Tools
Old 02 March 2018, 00:02   #1
Locash
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
Locash is offline  
Old 02 March 2018, 00:08   #2
Galahad/FLT
Going nowhere
 
Galahad/FLT's Avatar
 
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?
Galahad/FLT is offline  
Old 02 March 2018, 00:09   #3
Locash
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.
Attached Files
File Type: s firstattempt.S (1.2 KB, 136 views)

Last edited by Locash; 02 March 2018 at 00:42.
Locash is offline  
Old 02 March 2018, 00:41   #4
Galahad/FLT
Going nowhere
 
Galahad/FLT's Avatar
 
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.
Galahad/FLT is offline  
Old 02 March 2018, 00:46   #5
StingRay
move.l #$c0ff33,throat
 
StingRay's Avatar
 
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?
StingRay is offline  
Old 02 March 2018, 00:50   #6
Locash
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.
Locash is offline  
Old 04 March 2018, 12:05   #7
Locash
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
Locash is offline  
Old 04 March 2018, 12:52   #8
phx
Natteravn
 
phx's Avatar
 
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.
phx is offline  
Old 04 March 2018, 13:03   #9
Locash
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
Locash is offline  
 


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

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT +2. The time now is 01:18.

Top

Powered by vBulletin® Version 3.8.11
Copyright ©2000 - 2024, vBulletin Solutions Inc.
Page generated in 0.10953 seconds with 16 queries