If you use XDOS instead of Atari DOS you can call almost every DUP command from BASIC with a XIO command.
For DIR that would be XIO 39,#1,0,0”D1:DIR”.
According to the info on that side https://atariwiki.org/wiki/Wiki.jsp?page=XIO Command Codes DOS Handler