You will not be able to post if you are still using Microsoft email addresses such as Hotmail etc
See here for more information viewtopic.php?f=20&t=7296
BOOKMARK THIS PAGE !
https://www.exxosforum.co.uk:8085/IP_CHECK/
You can unban yourself if needed. It also sends me reports to investigate the ban.
DO NOT USE MOBILE / CGNAT DEVICES WHERE THE IP CHANGES CONSTANTLY!
At this time, it is unfortunately not possible to whitelist users when your IP changes constantly.
You may inadvertently get banned because a previous attack may have used the IP you are now on.
So I suggest people only use fixed IP address devices until I can think of a solution for this problem!

ASM programmer to write a simple IDE test loop program ?

News,announcements,programming,fixes,game patches & discussions.
User avatar
Smonson
Posts: 717
Joined: 28 Oct 2017 10:21
Location: Canberra, Australia

Re: ASM programmer to write a simple IDE test loop program ?

Post by Smonson »

rpineau wrote: 02 Mar 2019 02:36 this should speed up the test as memcmp is most probably faster than going through the array (it's probably written in ASM).
Which libc are you thinking of? I wouldn't mind taking a look at their implementation. GCC 8.2 created this convoluted memcmp from what I thought was a pretty straightforward C func. It was long, so I didn't look too closely, I just decided to avoid it.

Code: Select all

int memcmp(const void *s1, const void *s2, size_t n)
{
    147c:       2f02            movel %d2,%sp@-
    147e:       206f 0008       moveal %sp@(8),%a0
    1482:       226f 000c       moveal %sp@(12),%a1
    while (n--) {
    1486:       4aaf 0010       tstl %sp@(16)
    148a:       6730            beqs 14bc <memcmp+0x40>
        if (*(uint8_t *)s1 != *(uint8_t *)s2)
    148c:       1010            moveb %a0@,%d0
    148e:       1211            moveb %a1@,%d1
    1490:       b001            cmpb %d1,%d0
    1492:       6616            bnes 14aa <memcmp+0x2e>
    1494:       5289            addql #1,%a1
    1496:       242f 0010       movel %sp@(16),%d2
    149a:       d488            addl %a0,%d2
            return *(uint8_t *)s1 - *(uint8_t *)s2;
        s1++;
    149c:       5288            addql #1,%a0
    while (n--) {
    149e:       b1c2            cmpal %d2,%a0
    14a0:       671a            beqs 14bc <memcmp+0x40>
        if (*(uint8_t *)s1 != *(uint8_t *)s2)
    14a2:       1010            moveb %a0@,%d0
    14a4:       1219            moveb %a1@+,%d1
    14a6:       b200            cmpb %d0,%d1
    14a8:       67f2            beqs 149c <memcmp+0x20>
            return *(uint8_t *)s1 - *(uint8_t *)s2;
    14aa:       0280 0000 00ff  andil #255,%d0
    14b0:       0281 0000 00ff  andil #255,%d1
    14b6:       9081            subl %d1,%d0
        s2++;
    }
    return 0;
}
    14b8:       241f            movel %sp@+,%d2
    14ba:       4e75            rts
    return 0;
    14bc:       7000            moveq #0,%d0
}
    14be:       241f            movel %sp@+,%d2
    14c0:       4e75            rts
User avatar
Smonson
Posts: 717
Joined: 28 Oct 2017 10:21
Location: Canberra, Australia

Re: ASM programmer to write a simple IDE test loop program ?

Post by Smonson »

Actually in my updated version I changed the sectors from 507 bytes to 512, so I should actually compare it an array of 32-bit words instead if maximum speed is the goal.
User avatar
rpineau
Posts: 534
Joined: 17 Aug 2017 18:08
Location: USA

Re: ASM programmer to write a simple IDE test loop program ?

Post by rpineau »

yea, that gcc implementation is not really the best for sure.
I would have though that it would have done a loop with some optimization like if it's a multiple of 2 use cmp.w, if it's a multiple of 4 use cmp.l
Also instead of addq.l #1, use the (a0)+ and (a1)+more the 2 moves
Working ones : MegaSTE (68020) / TT030 / Falcon with AB040 & Eclipse / 1040STF
Need testing : Falcon with CT2
User avatar
exxos
Site Admin
Site Admin
Posts: 28160
Joined: 16 Aug 2017 23:19
Location: UK

Re: ASM programmer to write a simple IDE test loop program ?

Post by exxos »

Smonson wrote: 02 Mar 2019 02:01 Try downloading it again, I've hopefully fixed the issues.
Its passed 3 times over so far..

Now I don't know if I fixed my board somehow, or the program update broke something :lol:

Do you still have the previous version ?
User avatar
Smonson
Posts: 717
Joined: 28 Oct 2017 10:21
Location: Canberra, Australia

Re: ASM programmer to write a simple IDE test loop program ?

Post by Smonson »

Ummm, no, sorry. I can try changing the buffer size back to 507 bytes for you when I get home from work tonight, though. Maybe that's more likely to precipitate the failure.
User avatar
exxos
Site Admin
Site Admin
Posts: 28160
Joined: 16 Aug 2017 23:19
Location: UK

Re: ASM programmer to write a simple IDE test loop program ?

Post by exxos »

Smonson wrote: 04 Mar 2019 01:49 Ummm, no, sorry. I can try changing the buffer size back to 507 bytes for you when I get home from work tonight, though. Maybe that's more likely to precipitate the failure.
No worries.. I'm using my program to verify.. And that is passing currently as well, so looks like I may have solved the issue I was having :)

Return to “SOFTWARE PROGRAMMING & DISCUSSION”

Who is online

Users browsing this forum: CCBot and 5 guests