English Amiga Board


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

 
 
Thread Tools
Old 08 December 2018, 11:39   #101
meynaf
son of 68k
 
meynaf's Avatar
 
Join Date: Nov 2007
Location: Lyon / France
Age: 51
Posts: 5,323
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, 12:04   #102
litwr
Registered User
 
Join Date: Mar 2016
Location: Ozherele
Posts: 229
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, 12:19   #103
meynaf
son of 68k
 
meynaf's Avatar
 
Join Date: Nov 2007
Location: Lyon / France
Age: 51
Posts: 5,323
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, 18:31   #104
StingRay
move.l #$c0ff33,throat
 
StingRay's Avatar
 
Join Date: Dec 2005
Location: Berlin/Joymoney
Posts: 6,863
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, 11:06   #105
litwr
Registered User
 
Join Date: Mar 2016
Location: Ozherele
Posts: 229
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, 11:13   #106
meynaf
son of 68k
 
meynaf's Avatar
 
Join Date: Nov 2007
Location: Lyon / France
Age: 51
Posts: 5,323
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, 11:31   #107
hooverphonique
ex. demoscener "Bigmama"
 
Join Date: Jun 2012
Location: Fyn / Denmark
Posts: 1,624
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, 10:21   #108
StingRay
move.l #$c0ff33,throat
 
StingRay's Avatar
 
Join Date: Dec 2005
Location: Berlin/Joymoney
Posts: 6,863
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, 17:37   #109
litwr
Registered User
 
Join Date: Mar 2016
Location: Ozherele
Posts: 229
I have found out that Text call preserves A1 with A500 but corrupts it with A1200.
litwr is offline  
Old 14 December 2018, 18:08   #110
Leffmann
 
Join Date: Jul 2008
Location: Sweden
Posts: 2,269
D0-D1/A0-A1 are scratch registers, this has always been the case for system calls.
Leffmann is offline  
Old 14 December 2018, 20:50   #111
litwr
Registered User
 
Join Date: Mar 2016
Location: Ozherele
Posts: 229
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 05:59.
litwr is offline  
Old 14 December 2018, 21:10   #112
Don_Adan
Registered User
 
Join Date: Jan 2008
Location: Warsaw/Poland
Age: 55
Posts: 1,958
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 online now  
 


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 14 20 October 2019 02:05
The 6502 assembler code in "The Terminator" (1984) Shoonay Nostalgia & memories 2 15 May 2009 13:52
Assembler System Friendly code redblade Coders. General 3 29 July 2008 12:15
Amiga Cross Assembler to code intros! - Help! W4r3DeV1L Amiga scene 6 30 May 2008 16:53
3D code and/or internet code for Blitz Basic 2.1 EdzUp Retrogaming General Discussion 0 10 February 2002 11: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 16:39.

Top

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