View Single Post
Old 27 December 2017, 21:07   #1
jotd
This cat is no more
jotd's Avatar
 
Join Date: Dec 2004
Location: FRANCE
Age: 48
Posts: 3,654
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

Code:
    move.l    _DosBase,A6
   move.l	D0,D5
   move.l    #LDF_READ|LDF_WRITE|LDF_ALL,D1
    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
Code:
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  
 
Page generated in 0.04778 seconds with 11 queries