English Amiga Board

English Amiga Board (https://eab.abime.net/index.php)
-   Coders. Tutorials (https://eab.abime.net/forumdisplay.php?f=73)
-   -   I am trying to make my first GFX assembler code (https://eab.abime.net/showthread.php?t=95154)

meynaf 08 December 2018 11:39

Quote:

Originally Posted by StingRay (Post 1289585)
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. :mad

litwr 08 December 2018 12:04

Quote:

Originally Posted by meynaf (Post 1289589)
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. :mad

Don't hack! :D

meynaf 08 December 2018 12:19

Quote:

Originally Posted by litwr (Post 1289597)
Don't hack! :D

Tell that to people who got happy with my game ports :cheese

StingRay 08 December 2018 18:31

Quote:

Originally Posted by meynaf (Post 1289589)
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. :mad


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.

litwr 09 December 2018 11:06

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.

meynaf 09 December 2018 11:13

Quote:

Originally Posted by litwr (Post 1289749)
Have I missed a better way? Thanks.

Why not the obvious :
Code:

moveq #3,d0
 and.w data,d0
 bne label


hooverphonique 10 December 2018 11:31

Quote:

Originally Posted by litwr (Post 1289749)
Code:

    btst.w #0,data  ;or btst.b #0,data+1


btst is always byte-sized when operating on memory!

StingRay 11 December 2018 10:21

And it doesn't have a size spezifier either, i.e. btst.w is wrong and any assembler which accepts that is broken IMHO.

litwr 14 December 2018 17:37

I have found out that Text call preserves A1 with A500 but corrupts it with A1200. :shocked

Leffmann 14 December 2018 18:08

D0-D1/A0-A1 are scratch registers, this has always been the case for system calls.

litwr 14 December 2018 20:50

Quote:

Originally Posted by Leffmann (Post 1290873)
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.

Don_Adan 14 December 2018 21:10

Quote:

Originally Posted by litwr (Post 1290897)
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.


All times are GMT +2. The time now is 22:50.

Powered by vBulletin® Version 3.8.11
Copyright ©2000 - 2024, vBulletin Solutions Inc.

Page generated in 0.05198 seconds with 11 queries