English Amiga Board


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

 
 
Thread Tools
Old 18 March 2013, 09:32   #41
Vikke
Registered User
 
Join Date: Feb 2013
Location: Lovisa / Finland
Age: 48
Posts: 80
Quote:
Originally Posted by bippym View Post
why does the following give me an out of range: 16bit error

Code:
    move.l    320/8*256*5(a6),(a4.l)+    ; bpl4
In this case something like this would work better:

Code:
; Before the loop
move.l #320/8*256*5,d7
 
; in the loop
move.l (a6,d7),(a4)+
This method uses more registers, but works with any size and upto 6 bitplanes, on AGA you can combine the methods, or splt the move into 2 parts to be able to move more bitplanes.

This is the problem with quick and dirty methods of doing things, they seldomly work in other places than where they were planned to work.
Vikke is offline  
Old 18 March 2013, 09:36   #42
StingRay
move.l #$c0ff33,throat

StingRay's Avatar
 
Join Date: Dec 2005
Location: Berlin/Joymoney
Posts: 6,159
Quote:
Originally Posted by Vikke View Post
Code:
  
; in the loop
move.l (a6,d7),(a4)+
It needs to be move.l (a6,d7.L),(a4)+ since otherwise it will not point to the desired location (see: 16 bit signed offset in my post before.
StingRay is offline  
Old 18 March 2013, 09:53   #43
Vikke
Registered User
 
Join Date: Feb 2013
Location: Lovisa / Finland
Age: 48
Posts: 80
StingRay,

You're right. The .L has to be included as the default addressing is .W.

Sorry for that. It was either a typing error on this tablet, or then a bug in the code
Vikke is offline  
Old 18 March 2013, 10:50   #44
BippyM
Registered User

BippyM's Avatar
 
Join Date: Nov 2001
Location: Nottingham, UK
Age: 43
Posts: 8,720
why is the default addressing word and not long when move.l is used??

and why does (a6,d7.L),(a4)+ work?
BippyM is offline  
Old 18 March 2013, 11:06   #45
phx
Natteravn

phx's Avatar
 
Join Date: Nov 2009
Location: Herford / Germany
Posts: 1,226
Quote:
Originally Posted by bippym View Post
why is the default addressing word and not long when move.l is used??
The size of the index register d7 has nothing to do with the size of the move operation. You want to move a 32-bit longword, but you still might choose to read that longword using a 16-bit displacement on a6.

Word-sized indexes are default, when not specified. But it is good to know that Long-sized indexes do not cause any speed penalty.

Quote:
and why does (a6,d7.L),(a4)+ work?
Why not?
phx is offline  
Old 18 March 2013, 12:13   #46
StingRay
move.l #$c0ff33,throat

StingRay's Avatar
 
Join Date: Dec 2005
Location: Berlin/Joymoney
Posts: 6,159
Quote:
Originally Posted by bippym View Post
and why does (a6,d7.L),(a4)+ work?
Think about it. What happens if use .w for a value > 32767? Will the offset be positive or negative when the instruction uses signed values? And then think about this question again if you use .l for the same value.


Quote:
Originally Posted by phx View Post
Why not?
Coders answer at its best.
StingRay is offline  
Old 18 March 2013, 13:33   #47
BippyM
Registered User

BippyM's Avatar
 
Join Date: Nov 2001
Location: Nottingham, UK
Age: 43
Posts: 8,720
Re: First tutorial on ASM- and HW-coding

I thought about it on the treadmill at the gym

I need to read up more on basic 68k I think.. although it's coming back to me now.
BippyM 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
4th tutorial on ASM- and HW-coding Vikke Coders. Asm / Hardware 11 10 April 2013 21:32
3rd tutorial on ASM- and HW-coding Vikke Coders. Asm / Hardware 6 26 March 2013 16:57
2nd tutorial on ASM- and HW-coding Vikke Coders. Asm / Hardware 10 17 March 2013 12:49
REQ: AF 115 (C Coding Tutorial) quenthal AMR suggestions and feedback 2 23 July 2007 15:08
Help coding alexh Coders. General 14 15 August 2006 10:24

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 21:56.


Powered by vBulletin® Version 3.8.11
Copyright ©2000 - 2018, vBulletin Solutions Inc.
Page generated in 0.07090 seconds with 14 queries