English Amiga Board


Go Back   English Amiga Board > Coders > Coders. General > Coders. Tutorials

 
 
Thread Tools
Old 08 December 2018, 12:39   #101
meynaf
son of 68k
meynaf's Avatar
 
Join Date: Nov 2007
Location: Lyon / France
Age: 46
Posts: 3,404
Quote:
Originally Posted by StingRay View Post
You can use local labels. Though, the approach to use the stack to obtain the (string) addresses can indeed be quite useful.
Well, it's a real pain to disassemble (and to debug).
This program was just full of this and if i could kick the author's ass i'd have done it.
meynaf is offline  
Old 08 December 2018, 13:04   #102
litwr
Registered User

 
Join Date: Mar 2016
Location: Ozherele
Posts: 164
Quote:
Originally Posted by meynaf View Post
Well, it's a real pain to disassemble (and to debug).
This program was just full of this and if i could kick the author's ass i'd have done it.
Don't hack!
litwr is offline  
Old 08 December 2018, 13:19   #103
meynaf
son of 68k
meynaf's Avatar
 
Join Date: Nov 2007
Location: Lyon / France
Age: 46
Posts: 3,404
Quote:
Originally Posted by litwr View Post
Don't hack!
Tell that to people who got happy with my game ports
meynaf is offline  
Old 08 December 2018, 19:31   #104
StingRay
move.l #$c0ff33,throat

StingRay's Avatar
 
Join Date: Dec 2005
Location: Berlin/Joymoney
Posts: 6,209
Quote:
Originally Posted by meynaf View Post
Well, it's a real pain to disassemble (and to debug).
This program was just full of this and if i could kick the author's ass i'd have done it.

Well, nothing a simple MACRO in ReSource couldn't solve! Quite a few games actually use constructs like this (check the Wizkid code for a prime example) but I do agree, they are painful to debug/disassemble.
StingRay is offline  
Old 09 December 2018, 12:06   #105
litwr
Registered User

 
Join Date: Mar 2016
Location: Ozherele
Posts: 164
I have the next sequence in my x86 code
Code:
     test [data],3
     jne label

    ...
data dw 0
How to do something similar with 68k? I could find out
Code:
    btst.w #0,data   ;or btst.b #0,data+1
    bne label

    btst.w #1,data
    bne label
And a bit shorter code
Code:
    move data,ccr
    bcc label
    bvc label
It is a bit odd that MOVE to CCR takes a word not a byte - it is not important, indeed.
Have I missed a better way? Thanks.
litwr is offline  
Old 09 December 2018, 12:13   #106
meynaf
son of 68k
meynaf's Avatar
 
Join Date: Nov 2007
Location: Lyon / France
Age: 46
Posts: 3,404
Quote:
Originally Posted by litwr View Post
Have I missed a better way? Thanks.
Why not the obvious :
Code:
 moveq #3,d0
 and.w data,d0
 bne label
meynaf is offline  
Old 10 December 2018, 12:31   #107
hooverphonique
ex. demoscener "Bigmama"
 
Join Date: Jun 2012
Location: Fyn / Denmark
Posts: 854
Quote:
Originally Posted by litwr View Post
Code:
    btst.w #0,data   ;or btst.b #0,data+1

btst is always byte-sized when operating on memory!
hooverphonique is offline  
Old 11 December 2018, 11:21   #108
StingRay
move.l #$c0ff33,throat

StingRay's Avatar
 
Join Date: Dec 2005
Location: Berlin/Joymoney
Posts: 6,209
And it doesn't have a size spezifier either, i.e. btst.w is wrong and any assembler which accepts that is broken IMHO.
StingRay is offline  
Old 14 December 2018, 18:37   #109
litwr
Registered User

 
Join Date: Mar 2016
Location: Ozherele
Posts: 164
I have found out that Text call preserves A1 with A500 but corrupts it with A1200.
litwr is offline  
Old 14 December 2018, 19:08   #110
Leffmann
 
Join Date: Jul 2008
Location: Sweden
Posts: 2,248
D0-D1/A0-A1 are scratch registers, this has always been the case for system calls.
Leffmann is offline  
Old 14 December 2018, 21:50   #111
litwr
Registered User

 
Join Date: Mar 2016
Location: Ozherele
Posts: 164
Quote:
Originally Posted by Leffmann View Post
D0-D1/A0-A1 are scratch registers, this has always been the case for system calls.
Thank you. I hoped that A1200 remains more compatible with A500 and was surprised when my code failed to work with A1200. I am going to follow documentation more strictly.

Last edited by litwr; 15 December 2018 at 06:59.
litwr is offline  
Old 14 December 2018, 22:10   #112
Don_Adan
Registered User
 
Join Date: Jan 2008
Location: Warsaw/Poland
Age: 50
Posts: 1,101
Quote:
Originally Posted by litwr View Post
Thank you. I hoped that A1200 remains more compatible with A500 and was surprised when my code failed to work with A500. I am going to follow documentation more strictly.
Remember some Amiga ROM-s routines were reworked a few times. D0-D1/A0-A1 are always Amiga scratch registers, except a few math and exec routines (info is stored inside docs). Of course not always all scratch registers are used/changed.
Don_Adan 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
Misc Amiga Assembler Source Code copse Coders. General 11 16 December 2009 12:06
The 6502 assembler code in "The Terminator" (1984) Shoonay Nostalgia & memories 2 15 May 2009 14:52
Assembler System Friendly code redblade Coders. General 3 29 July 2008 13:15
Amiga Cross Assembler to code intros! - Help! D4Ni3L3 Amiga scene 6 30 May 2008 17:53
3D code and/or internet code for Blitz Basic 2.1 EdzUp Retrogaming General Discussion 0 10 February 2002 12:40

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 04:42.


Powered by vBulletin® Version 3.8.11
Copyright ©2000 - 2019, vBulletin Solutions Inc.
Page generated in 0.08053 seconds with 15 queries