polio: exit copy, add writefile

This commit is contained in:
2025-10-06 22:51:59 +02:00
parent 84ea4d5cae
commit a1275671b3

View File

@@ -40,20 +40,6 @@ dosdbt: # assumes es=0
.section .text.int80stuff
# near copy [param 2] bytes, ds:[param 0] -> ds:[param 1]
copy:
mov ax, [bp-14] # ds
mov es, ax
mov ds, ax
mov cl, 4
shl si, cl
mov si, [bp+0] # source
mov di, [bp+2] # destination
mov cx, [bp+4] # length
cld
rep movsb
ret
## floppy stuff
# same as read but with a different int13h:ah value
@@ -122,8 +108,19 @@ readfile:
add ax, si
mov dx, [bp+2]
add dx, si
call fat12_readfile
ret
jmp fat12_readfile
# params: ds:fname, ds:src, size
writefile:
mov si, [bp-14] # ds
mov cl, 4
shl si, cl
mov ax, [bp+0]
add ax, si
mov dx, [bp+2]
add dx, si
mov cx, [bp+4]
jmp fat12_writefile
# params: ds:addr, size
sendpara:
@@ -133,8 +130,7 @@ sendpara:
mov ax, [bp+0]
add ax, si
mov dx, [bp+2]
call parasend
ret
jmp parasend
# params: ds:addr, size
recvpara:
@@ -144,7 +140,10 @@ recvpara:
mov ax, [bp+0]
add ax, si
mov dx, [bp+2]
call pararecv
jmp pararecv
dummy:
mov ax, -1
ret
.section .text.int80h
@@ -155,6 +154,7 @@ int80h:
push bp
push ds
push es
mov bp, sp
xor cx, cx
mov es, cx
mov ds, cx
@@ -163,7 +163,6 @@ int80h:
cmp cl, offset int80h_entries
jge 0f
mov si, cx
mov bp, sp
add bp, 16 # 10 for us, 6 for the interrupt
call cs:[int80h_table+si]
jmp 1f
@@ -179,7 +178,7 @@ int80h:
.section .rodata.int80h
int80h_table:
.word offset copy # 0x00
.word offset dummy # 0x00
.word offset readsector # 0x01
.word offset writesector # 0x02
.word offset formattrack # 0x03
@@ -187,5 +186,6 @@ int80h_table:
.word offset recvpara # 0x05
.word offset sendpara # 0x06
.word offset xferpara # 0x07
.word offset writefile # 0x08
int80h_entries = . - int80h_table