From: Frank Cox <theatre@sasktel.net>
To: linux-msdos@vger.kernel.org
Subject: dosemu, powerbasic program, centos 5 and Fedora 10
Date: Wed, 11 Mar 2009 18:27:23 -0600 [thread overview]
Message-ID: <20090311182723.25156ffc.theatre@sasktel.net> (raw)
I seem to have uncovered some sort of a bug, but I'm not sure in what.
I have a computer set up with Fedora 10/x86_64, and another with Centos 5/i386.
Both have dosemu 1.4.0 installed.
I have a program that's written in powerbasic that runs fine on the Centos box
but crashes dosemu on the Fedora box. The dosemu window closes without
any error reported -- the window just disappears.
I have narrowed the problem down to some interaction between a "DEFINT A-Z"
compiler directive and a word wrap subroutine that's part of the program. If I
either remove the DEFINT directive, comment-out the word wrap subroutine or
remove the parts of the program that actually call that subroutine, the program
doesn't crash on Fedora 10.
I'm sure this program worked fine up until at least fairly recently. I see
that the last time I modified it was in October of 2008, so it apparently worked
fine on Fedora 9/x86_64, which is what I was running on this machine at that
time.
I have included the word wrap routine here so you can see what it does. It
runs fine as-is on Centos 5/i386 but crashes on Fedora 10/x86_64. Removing the
DEFINT line makes it work fine on both machines. It's just this routine alone
that's causing the problem because the crash occurs when attempting to run the
compiled version of exactly what you see here. If anyone else would like to
try this, I have put the powerbasic-compiled version of the following program
on my website at http://www.melvilletheatre.com/dosemu-crash.tar.bz2
Again, it runs fine on Centos 5/i386 but crashes on Fedora 10/x86_64.
$cpu 80386
$float npx
$lib all off
DEFINT A-Z ' -- If this line commented out it works.
WordWrap text$,1,76,5
' ********************************
' text$, column, wrap length, row
SUB WordWrap (text$, x1, x2, y1)
shared wrapped.text$()
x=0
savetext$ = text$
s = x2 - x1
y = y1
' LOCATE y, x1
IF LEN(text$) > s THEN
DO
IF LEN(text$) = 0 THEN EXIT DO
text$ = LTRIM$(text$)
IF LEN(text$) >= s THEN
tmp$ = LEFT$(text$, s)
ELSE
tmp$ = text$
END IF
stmp$ = tmp$
GOSUB ReverseTmp
IF MID$(text$, s + 1, 1) = " " THEN
wrapped.text$(x)= stmp$
incr x
text$ = MID$(text$, s + 1)
ELSE
a = INSTR(tmp$, " ")
IF a = 0 THEN
wrapped.text$(x)= stmp$
incr x
text$ = MID$(text$, s + 1)
ELSE
wrapped.text$(x)= LEFT$(text$, s - a)
incr x
text$ = MID$(text$, s - a + 1)
END IF
END IF
incr y
' LOCATE y, x1
LOOP
ELSE
wrapped.text$(x)=text$
END IF
text$ = savetext$
EXIT SUB
ReverseTmp:
t$ = ""
FOR I = LEN(tmp$) TO 1 STEP -1
t$ = t$ + MID$(tmp$, I, 1)
NEXT I
tmp$ = t$
RETURN
END SUB
--
MELVILLE THEATRE ~ Melville Sask ~ http://www.melvilletheatre.com
next reply other threads:[~2009-03-12 0:27 UTC|newest]
Thread overview: 5+ messages / expand[flat|nested] mbox.gz Atom feed top
2009-03-12 0:27 Frank Cox [this message]
2009-03-12 4:47 ` dosemu, powerbasic program, centos 5 and Fedora 10 Frank Cox
2009-03-27 3:14 ` Frank Cox
2009-10-11 5:44 ` Frank Cox
2009-10-12 5:06 ` Frank Cox
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20090311182723.25156ffc.theatre@sasktel.net \
--to=theatre@sasktel.net \
--cc=linux-msdos@vger.kernel.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox