Discussion:
resources for learning 16-bit assembly
(too old to reply)
r***@gmail.com
2019-12-06 07:30:12 UTC
Permalink
Johann, you still here? Still interested?

It's not much, but I still feel the need to point you to a few links.

I'm vaguely sure that I recommended that you use FPC with its
inline assembly. Here's one quick 16-bit example that I once
posted for someone else (D2X.PAS):

* https://board.flatassembler.net/topic.php?t=19495&postdays=0&postorder=asc&start=41

Hey, even _The 8086 Primer_ (second edition) has a chapter on Pascal!
This guy co-designed the 8086/8088, so he knows his stuff!

* https://stevemorse.org/8086/

I can also vaguely remember some really old, DOS IDEs for assembly:

NASM-IDE (Rob Anderton, circa 2002):

* https://github.com/OS2World/DEV-ASM-UTIL-NASM-IDE

(I don't know of a better link, but I still have an old .ZIP
lying around, worst case scenario.)

ASM Edit (circa 1996??, now freeware, Olaf Krusche)
(You might need to load Japheth's HX/HDPMI16 first.)

* http://www.o-love.net/asmedit/

Oh, for fun, didn't I already mention? There was a Mario clone
written in Turbo Pascal (last updated circa 2001)!

* http://www.wieringsoftware.nl/mario/download.html

(Not sure how easy it would be to port to FPC, probably
not impossibly hard. Bah, just use TP 5.5 freeware, it
has altered sources just for that. TP6 was when inline
asm was first introduced.)
T. Ment
2019-12-06 13:37:22 UTC
Permalink
Post by r***@gmail.com
Johann, you still here? Still interested?
I'm vaguely sure that I recommended that you use FPC with its
inline assembly. Here's one quick 16-bit example that I once
* https://board.flatassembler.net/topic.php?t=19495&postdays=0&postorder=asc&start=41
He said he wants to use Watcom C++. Pascal is a waste of time. It offers
no advantage.
r***@gmail.com
2019-12-14 13:58:34 UTC
Permalink
Hi,
Post by T. Ment
Post by r***@gmail.com
I'm vaguely sure that I recommended that you use FPC with its
inline assembly. Here's one quick 16-bit example that I once
He said he wants to use Watcom C++. Pascal is a waste of time. It offers
no advantage.
In that FASM link, there were various other links to other resources,
including Wikipedia (comparison vs. C) and FPC's "advantages" page.

I'm not complaining about OpenWatcom. It's still good. But, as far
as programming language dialects are concerned, it has incomplete
support for C99 and not even full C++98. FPC supports Turbo and Delphi
dialects fully and some others partially (e.g. classic/ISO).

So, I didn't mean original J&W Pascal here but rather the familiar DOS
favorite of Turbo Pascal (dialect). No makefiles needed, stronger
typing, OOP, and (depending on version) inline assembly, among a bunch
of other reasons (smartlinker, IDE).

Besides units (roughly speaking, modules like Modula-2, which even
C++20 will finally have), the big advantage is strings (easier to use).
Specifically, arrays are easier to use and don't decay into pointers.
Actually, with Delphi dialect, you have "huge" {$H+} ANSI strings on
the heap, not just limited to short strings (of 255-byte capacity).
So, in Pascal, you don't need addresses/pointers at all except for
new/dispose on the heap. (This is why Oberon is garbage-collected.)

C is not a bad nor inefficient language. Obviously, many good things
are written in it, and it's well-supported. But it does also reparse
its own header files too often. The data typing is a bit confusing,
leading to too many typecasts (normally unnecessary in Pascal and
derivatives). Also, I'm mostly sure that OpenWatcom has limited
(if any proper) smartlinking. For static linking, it can hurt
to always include printf(), especially with C99 and newer bloated
standards. Pascal's write/writeln is much easier to use and more
type-safe anyways, but it's less dynamic at runtime (but faster).

Most of BWK's complaints against Pascal were fixed in later versions
(Turbo, Extended) or derivatives (Modula-2, Oberon). You can check
for I/O errors (missing file) manually, open files by name, or
low-level "SYSTEM" stuff nowadays. So-called "open arrays" fixed the
variable-sized arrays flaw. "Set of char" is convenient in many
cases, so is const (static) initialized data. TP supports (signed)
longint, similar to C89's long, but C99 has long long while FPC
(and Delphi?) has int64. Oh, TP has bitwise operators instead
of set calculation kludges. FPC does support (Delphi's?) dynamic
arrays, too, which use exceptions behind the scenes. (Modern C++
and Delphi can't live without exceptions. Even ISO Modula-2 has it,
so does Ada and Modula-3.)

I'm no expert. Dialect does matter, but it depends on what you're
trying to do, level of experience, etc. Whatever works is fine,
but sometimes there is a better way. (Unfortunately, Pascal's
two ISO "standards" are mostly obscure and ignored. Ironically,
it's more portable to stick to TP dialect than those! In other
words, if you need ISO support, use GPC/DJGPP; otherwise use FPC.)
T. Ment
2019-12-14 16:42:03 UTC
Permalink
Post by r***@gmail.com
Post by T. Ment
He said he wants to use Watcom C++. Pascal is a waste of time. It offers
no advantage.
I'm not complaining about OpenWatcom. It's still good. But, as far
as programming language dialects are concerned, it has incomplete
support for C99 and not even full C++98. FPC supports Turbo and Delphi
dialects fully and some others partially (e.g. classic/ISO).
Who cares. Those standards are post DOS. I can work without them.
Post by r***@gmail.com
Most of BWK's complaints against Pascal were fixed
As he said, Pascal is for learning. C is for getting things done. BEGIN
and END instead of {}? Nope.
Post by r***@gmail.com
I'm no expert
You talk a lot. I wonder if you ever do any work.
r***@gmail.com
2019-12-16 20:48:04 UTC
Permalink
Hi,
Post by T. Ment
Post by r***@gmail.com
Post by T. Ment
He said he wants to use Watcom C++. Pascal is a waste of time.
It offers no advantage.
I'm not complaining about OpenWatcom. It's still good. But, as far
as programming language dialects are concerned, it has incomplete
support for C99 and not even full C++98. FPC supports Turbo and Delphi
dialects fully and some others partially (e.g. classic/ISO).
Who cares. Those standards are post DOS. I can work without them.
We're living in a weird era, stuck between legacy, modern, and
ultra-modern. It's hard to know the difference between all
the tons of variations (languages, cpus, OSes).

"Post DOS" means nothing, only that interest from commercial
companies waned. But working without newer standards is probably
a virtue.

DJGPP has been around for thirty years. Even 2.00 was 1996, the
big release with Win95-compatible LFN support and "DPMI only".
Newer GCCs obviously support newer dialects of C, C++, Ada,
Fortran, etc. However, DJGPP is still incomplete supporting
those, but it's still better than OpenWatcom in most ways,
assuming you don't mind depending on 386 + pmode. (Just
a reminder, FPC has had a 16-bit i8086-msdos target since
2015. I don't grok Delphi, but it supports more features
than just "{$mode tp}", e.g. LFNs!)
Post by T. Ment
Post by r***@gmail.com
Most of BWK's complaints against Pascal were fixed
As he said, Pascal is for learning. C is for getting things done.
BWK's paper was in 1981. Wirth left Pascal in 1977, where it was
soon standardized (1982). Even K&R C would be frozen in 1984 and
standardized later (1989). Modula-2 was already implemented in
1979! But PIM reports didn't come out until later. So probably
BWK was just unaware of it or it hadn't been widely implemented
elsewhere. Modula-2 had already fixed most of the problems.

Even Turbo Pascal came out in 1983 and fixed lots of complaints.
Keep in mind that some things are only learned from experience,
so hindsight is always 20/20. In the '70s, sequential storage
and batch-oriented processing were more common. (TP got modular
with units in v4 in 1987.)

Wirth was a professor, so yes, he used Pascal in teaching.
But he was teaching engineers, scientists, and mathematicians.
It was also designed for practical work, even beyond compilers.
It was an improved Algol, better than the old Fortran of the
day, good for structured programming and dynamic data structures.

Granted, Wirth found Modula-2 better and thus only used that
for many years until he did Oberon. And Oberon is where he
has remained (mostly) since then (1986 or such). Oberon
is basically a simplified Modula-2 (no separate .DEFs,
no enums, no subranges, no CARDINAL, only bitsets; but added
type inclusion, type extension [OOP], garbage collection).

The compiler and OS of Oberon were written in itself. Many
related books were published (and third-party compilers).
Oberon was simplified and resurrected in 2007 (-07 dialect).
Project Oberon was resurrected in 2013. Yes, I've used
several (admittedly old) DOS Oberon compilers..
Post by T. Ment
BEGIN and END instead of {}? Nope.
That was simplified/fixed in Modula-2. Most blocks now require
"END", thus many fewer "BEGIN"s.

Even complaints like this (or uppercase reserved words) can
be fixed automatically with external tools, if needed. Such
minor syntactic problems are a non-issue for most people.
T. Ment
2019-12-17 02:23:03 UTC
Permalink
Post by r***@gmail.com
Post by T. Ment
BEGIN and END instead of {}? Nope.
That was simplified/fixed in Modula-2.
Too late. You're preaching to empty pews.

Rod Pemberton
2019-12-15 14:02:27 UTC
Permalink
On Sat, 14 Dec 2019 05:58:34 -0800 (PST)
Post by r***@gmail.com
I'm not complaining about OpenWatcom. It's still good. But, as far
as programming language dialects are concerned, it has incomplete
support for C99 and not even full C++98.
Not to sound troll-ish, but who would need all of that? ...

I.e., all you need is C89, and generally not that much of the C
libraries to code just about anything and everything.

AISI, you only need C99 if someone made the mistake of using newer
features for code you don't intend to rework. You most definitely
don't need C99 for DOS programming, app programming, or OS
development. BTDT.

P.S. I'm not sure why you keep responding to "T. Ment". He comes off
as exceptionally hostile. Every time he posts, I think about one of
Pantera's songs on their 1992 "Vulgar Display of Power" album:
http://www.bnrmetal.com/v5/band/band/Pant


Rod Pemberton
--
"It's OK to be White." <-- investigated by FBI as a hate crime
"Black Lives Matter." <-- not being investigated ...
r***@gmail.com
2019-12-16 20:03:49 UTC
Permalink
Hi,
Post by Rod Pemberton
On Sat, 14 Dec 2019 05:58:34 -0800 (PST)
Post by r***@gmail.com
I'm not complaining about OpenWatcom. It's still good. But, as far
as programming language dialects are concerned, it has incomplete
support for C99 and not even full C++98.
Not to sound troll-ish, but who would need all of that? ...
I.e., all you need is C89, and generally not that much of the C
libraries to code just about anything and everything.
Some languages (dialects) and tools are better than others!
More portable, elegant, efficient. But it's hard even knowing
what exists, what is supported, what is the best way, etc.

Writing everything from scratch, you can use whatever tool or
dialect you want. I agree that C89 is good enough for most things,
and I would encourage not always demanding "latest standard" in
newer code. (However, always expecting legacy support is naive.)

However, overwhelmingly I've noticed that most people don't care.
Like at all. They use C99 and beyond (POSIX-isms, e.g. mmap()
or deleting/renaming an open file). Or Windows-only. Or x64-only.
Or C++11 only (if even that "old").
Post by Rod Pemberton
AISI, you only need C99 if someone made the mistake of using newer
features for code you don't intend to rework. You most definitely
don't need C99 for DOS programming, app programming, or OS
development. BTDT.
DJGPP already partially supports newer dialects, so that's probably
our best bet (in various ways). However, even that isn't nearly
as popular (or well-supported by third-parties) as it used to be.
Seriously, if code doesn't work with DJGPP (or similarly-related,
compatible tools like FPC or FBC), there's little hope ... unless
you rewrite everything from scratch, which very few do.
Loading...