ack/plat/msdos386/libsys/rename.s
David Given dc1f69be83 Most of read and write now works; filename-based operations partially work; but
there's a nasty memory corruption somewhere which needs investigating.
2022-08-19 00:08:57 +02:00

54 lines
629 B
ArmAsm

#
! $Source$
! $State$
! $Revision$
! Declare segments (the order is important).
.sect .text
.sect .rom
.sect .data
.sect .bss
.sect .text
! Rename a file.
.define _rename
_rename:
mov ebx, esp
push esi
push edi
! Source filename.
mov esi, 4(ebx)
movzx edi, (transfer_buffer_ptr)
mov es, (pmode_ds)
cld
1:
lodsb
stosb
testb al, al
jnz 1b
! Destination filename.
mov eax, edi
mov esi, 8(ebx)
1:
lodsb
stosb
testb al, al
jnz 1b
! Make the DOS call.
o16 mov dx, (transfer_buffer_ptr)
o16 mov di, ax
movb ah, 0x56
or ebx, 0x210000
callf (interrupt_ptr)
pop edi
pop esi
jmp .sys_zret