ack/plat/msdos386/libsys/sys_rawcreat.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

46 lines
575 B
ArmAsm

#
! $Source$
! $State$
! $Revision$
! Declare segments (the order is important).
.sect .text
.sect .rom
.sect .data
.sect .bss
.sect .text
! Create or truncate a file.
.define __sys_rawcreat
__sys_rawcreat:
! Copy filename to transfer buffer.
mov ebx, esp
push esi
push edi
mov esi, 4(ebx)
movzx edi, (transfer_buffer_ptr)
mov es, (pmode_ds)
cld
1:
lodsb
stosb
testb al, al
jnz 1b
! Make the DOS call.
movb ah, 0x3c
movzx edx, (transfer_buffer_ptr)
movb al, 8(ebx)
or ebx, 0x210000
callf (interrupt_ptr)
pop edi
pop esi
jmp .sys_axret