2022-08-07 20:10:08 +00:00
|
|
|
#
|
|
|
|
! $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:
|
2022-08-18 22:08:57 +00:00
|
|
|
mov ebx, esp
|
|
|
|
push esi
|
|
|
|
push edi
|
|
|
|
|
|
|
|
! Source filename.
|
|
|
|
|
|
|
|
mov esi, 4(ebx)
|
2022-08-24 15:17:04 +00:00
|
|
|
movzx edi, (transfer_buffer_ptr)
|
|
|
|
mov es, (pmode_ds)
|
|
|
|
cld
|
2022-08-18 22:08:57 +00:00
|
|
|
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
|
2022-08-07 20:10:08 +00:00
|
|
|
movb ah, 0x56
|
2022-08-24 15:17:04 +00:00
|
|
|
mov ebx, 0x210000
|
2022-08-18 22:08:57 +00:00
|
|
|
callf (interrupt_ptr)
|
|
|
|
pop edi
|
|
|
|
pop esi
|
2022-08-24 15:17:04 +00:00
|
|
|
push ss
|
|
|
|
pop es
|
2022-08-07 20:10:08 +00:00
|
|
|
jmp .sys_zret
|