; FreeDOS "Brew-temp-file-BUG" test | (CL) 2009 | 91 Bytes
define pope pop
define popef popf
macro movntq mdst, msrc {
if mdst eq cs
err "CS is not a valid destination"
end if
if mdst in <ds,es,ss> & msrc in <cs,ds,es,ss>
push msrc
pope mdst
else
if mdst in <ax,bx,cx,dx,si,di,bp> & msrc eq 0
xor mdst, mdst
else
mov mdst, msrc
end if
end if
} ; endmacro
format binary as "COM"
use16
org $0100
mov ah, $5A
mov dx, buff
movntq cx, 0
int $21 ; Brew temp
jc short er
mov si, buff
call pr ; Boast
call eol
mov ah, $3C
mov dx, buff
int $21 ; Re-Create it
jc short er
mov bx, ax ; He
mov cx, 9999
mov di, buff
mov dx, di
@@: mov [di], di
inc di
inc di
loop short @b
mov ah, $40
mov cx, 19998
int $21 ; WRTFF
jc short er
mov ah, $3E
int $21 ; Closed: IS a BUG
jc short er
ret
;----
er: mov si, fu
pr: lodsb
cmp al, 0
je short @f
xchg ax, dx
mov ah, 2
int $21
jmp short pr
;--------------
@@: ret
;----
eol: mov si, qeol
jmp short pr
;--------------
qeol: db 13,10,0
fu: db "error"
buff: db 0
This works in EDR-DOS but in FreeDOS it leaves an empty file + a dead cluster chain, BUG persists in 2038 kernel, to be fixed ASAP
Problem formerly known as
IUP-BUG, but above 91 Bytes are sufficient to reproduce it.
