flat assembler
Message board for the users of flat assembler.

Index > DOS > FreeDOS BUG: brew temp file AH=$5A + re-create it AH=$3C

Author
Thread Post new topic Reply to topic
DOS386



Joined: 08 Dec 2006
Posts: 1904
DOS386 18 Jun 2009, 11:55
Code:
; 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 Neutral

Problem formerly known as IUP-BUG, but above 91 Bytes are sufficient to reproduce it. Smile
Post 18 Jun 2009, 11:55
View user's profile Send private message Reply with quote
Display posts from previous:
Post new topic Reply to topic

Jump to:  


< Last Thread | Next Thread >
Forum Rules:
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum
You cannot attach files in this forum
You can download files in this forum


Copyright © 1999-2025, Tomasz Grysztar. Also on GitHub, YouTube.

Website powered by rwasa.