31 October 2019, 12:06 | #1 |
OCS forever!
Join Date: Mar 2019
Location: Birmingham, UK
Posts: 418
|
Really DUMB stuff you learned/unlearned recently
Is there anything you learned recently (or a long time into your asm knowledge) that made you go "I am a moron for thinking that". I'll embarrass myself first.
The big one. I thought that bgt/blt were exactly the same as bhi/blo. Seriously. At some point my 16yr old self has decided that and I never questioned it even during writing https://www.pouet.net/prod.php?which=81350 But I was chatting to ross about a starfield I was doing and I had some code to check that something was in the range 0-128 and I was doing a two tests for 0 and 128. ross showed a snippet of something similar and he was purely doing something like: cmpi.w #128,d0 bhi.s .outofrange Which confused me because what about the 0 check... so I dug out my original two books "Amiga Machine Language" and "Amiga System Programmers Guide". The AML book had a tiny section on condition codes and had a table that listed bgt as "greater than" and bhi as "higher than" which is why I think my 16yr old self assumed they were the same. But looking at it now the status flags were different. So I did some more digging and found http://mrjester.hapisan.com/04_MC68/...t07/Index.html Omg...I understood about treating numbers as signed and unsigned but somehow thought the branch instructions were all signed and you had to "work around it". I WAS MORTIFIED. I checked two other 68000 books online and neither make it clear about the sign vs unsigned as well. Everyone must think it obvious from the status flags table. If I'd written that section it would be in bold The other thing I never used to use were the carry flag/addx/roxr type instructions and the fact that the shift/overflows end up there and can be checked or rotated in/out. So that's been useful to learn. So is it just me or does anyone else have anything dumb to admit? Last edited by Antiriad_UK; 31 October 2019 at 12:24. |
31 October 2019, 12:17 | #2 |
Inviyya Dude!
Join Date: Sep 2016
Location: Amiga Island
Posts: 2,784
|
Lots of dumb shit that I do wrong all the time.
I must be the worst 68k asm coder in the world. Somehow I managed to code an Amiga game, though.. When I notice something dumb I did in the future, I will write it here... |
31 October 2019, 13:52 | #3 |
Registered User
Join Date: Oct 2017
Location: Sunderland, England
Posts: 2,702
|
I actually cover this in my up coming episode of amigagamedev.
But yep - i am with you, back in the day i dont think i even considered the flags that much. |
31 October 2019, 17:03 | #4 |
German Translator
Join Date: Aug 2018
Location: Drübeck / Germany
Age: 49
Posts: 187
|
The branches can be confusing. That's why I had created a table
and a small program for analysis. |
31 October 2019, 17:13 | #5 |
Defendit numerus
Join Date: Mar 2017
Location: Crossing the Rubicon
Age: 53
Posts: 4,479
|
You have to master these, some pure acrobatic code possible
|
31 October 2019, 17:28 | #6 |
Registered User
Join Date: Feb 2018
Location: London / UK
Posts: 112
|
I've released a few AGA demos that didn't use the AGA fetch modes. They had mainly c2p effects, no sprites or hw scrolling, so there was no technical reason I couldn't use 4x fetch.
For example this demo: https://www.pouet.net/prod.php?which=69702 runs about 10% faster with this fixed. In other cases like when using blitter, on slow CPUs etc the difference can be much bigger. So, on AGA, always use 4x if you can. |
31 October 2019, 19:58 | #7 |
Registered User
Join Date: Dec 2016
Location: England
Posts: 87
|
Amiga coding in general - didn't do any at all when I had my A600
It's only very recently I've got into it. |
01 November 2019, 11:52 | #8 |
Natteravn
Join Date: Nov 2009
Location: Herford / Germany
Posts: 2,509
|
I had decades of experience in 68k assembler coding and wrote all kinds of hardware scrolling routines since the 80s, but it lasted until 2012, when I read Georg Steger‘s ScrollingTrick (Aminet), before I understood how to do a decent „corkscrew“ scroller.
I felt really dumb, because I thought about scrolling techniques so many times, but I was never able to develop this idea myself. |
03 November 2019, 16:23 | #9 |
Registered User
Join Date: Sep 2008
Location: Germany
Age: 49
Posts: 138
|
@Antiriad:
Had the some problems back then _really_ understanding the differences between the conditional branches when applied best. Started 65xx assembly last year and developed a theory that, in the 80s, the guys coming from MOS 65xx had something of an advantage here as they had to get this things right in first place. As I started direct on the 68k I was using 'workarounds' (like in your example using two checks for the upper/lower limit) as I knew they worked for me. Often learned by hours of try/error. I way too long went on with 'feeled' coding (f.ex. not fully understanding twos complement or making use of the condition codes). It didn't help either that at least one of the early assembler courses in one of the german Amiga magazines didn't got the conditional branches right. |
Currently Active Users Viewing This Thread: 1 (0 members and 1 guests) | |
Thread Tools | |
Similar Threads | ||||
Thread | Thread Starter | Forum | Replies | Last Post |
Any DirectX11 changes recently behind the scenes? | Mclane | support.WinUAE | 2 | 24 November 2018 18:07 |
WinUAE on Hyper-V Lessons Learned. | Greyspirit | support.WinUAE | 3 | 26 August 2018 13:42 |
Recently acquired A3000 | AmigaJules | Hardware pics | 9 | 07 October 2008 10:24 |
Sensible Soccer or I How I Stopped Worrying and Learned to Love the Ball | CodyJarrett | Amiga scene | 5 | 14 December 2007 17:43 |
|
|