English Amiga Board

Go Back   English Amiga Board > Coders > Coders. System

Thread Tools
Old 27 December 2017, 21:07   #1
This cat is no more
jotd's Avatar
Join Date: Dec 2004
Location: FRANCE
Age: 48
Posts: 4,054
assembly code to test for assign (2.0+)

I have this code to test for an assign. Ex: pass a pointer on "T:" in D0 and it returns 0 if not found

    move.l    _DosBase,A6
   move.l	D0,D5
    JSRLIB    LockDosList
    move.l    D0,D6        ; head of dos list

    ; search in the list
    move.l    D5,D2
    move.l    #LDF_READ|LDF_WRITE,D3    ; flags
    move.l    D6,D1
    JSRLIB    FindDosEntry

    move.l    D0,D4            ; return

    ; unlock dos list

    move.l    #LDF_READ|LDF_WRITE,D1    ; flags
    JSRLIB    UnLockDosList

    move.l    D4,D0            ; NULL: not found
The issue with that code (took me a while to narrow it down) is that using it randomly locks my application on system calls like Read or Lock...

Someone knows why? I'd like to keep that code, but if I have to get rid of it and replace by a "Lock" I'll do it (since my app switches the requesters off, I suppose it won't be an issue)

Edit: replacing the flags by just
move.l    #LDF_READ,D1
fixes the lock but not sure if the test works in that case

Last edited by jotd; 27 December 2017 at 21:17.
jotd is offline  
Old 27 December 2017, 22:38   #2
Per aspera ad astra

ross's Avatar
Join Date: Mar 2017
Location: Crossing the Rubicon
Age: 49
Posts: 2,520
Hi jotd, have You tried

From Autodocs there is a possible deadlock using LDF_WRITE without
AttemptLockDosList() before.
ross is offline  
Old 27 December 2017, 23:16   #3
This cat is no more
jotd's Avatar
Join Date: Dec 2004
Location: FRANCE
Age: 48
Posts: 4,054
tried that and it didn't lock, but didn't find the assign either. Anyway, used a good old "doslib.Lock" with requesters off, and it does exactly the same thing (I don't need assign, I need to see if the T: directory exists). Moreover, my code needs to be 1.3 compatible, so the Lock solution works. thanks
jotd 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
How to test time for piece of code Powergoo Coders. Asm / Hardware 16 17 October 2015 23:08
ALWAYS test your code on real hardware!! h0ffman Coders. General 32 16 July 2015 21:02
CD32 Frog Feast test available. Test out the final! cdoty News 42 01 April 2008 16:20
Assign command fc.studio support.Apps 2 28 December 2005 18:36
Multi-Assign Shoonay support.Apps 17 12 April 2005 15:16

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 15:33.

Powered by vBulletin® Version 3.8.11
Copyright ©2000 - 2020, vBulletin Solutions Inc.
Page generated in 0.06182 seconds with 13 queries