On 08.12.2021 10:16, R.Wieser wrote:
A program is written in order to be executed. To write a program
Why is 16-bit DOS programming a good choice in the year 2021?
The code below reads from stdin, converts any upper case to lower
case letters and writes it to stdout:
loop: bsr.l getc ; get char from stdin
cmpq.l #-1,r0 ; EOF
bne.b _10 ; branch if not
andq.l #0,r0
bsr.l exit
_10: cmp.b #'A',r0
blo.b _20
cmp.b #'Z',r0
bhi.b _20
add.b #'a'-'A',r0
_20: bsr.l putc ; write char to stdout
br.b loop ; go on
Is this 16 bit DOS or 32 bit Windows programming or is it even
a LINUX program?
Now the answer to the above question, it is neither a DOS, Windows or Linux code,
it is all three at the same time. Just set OS to 0,1 or 2 and the assembler will generate an executable for the selected OS from the same source code. Not even a single byte is generated by the assembler or a linker which is
not explicitly specified in the source code.
It doesn't matter how much software you have to install to create a
program.
But once created, it should be possible to execute the program on a
standard Windows installation without first installing additional
software.
It is always frustrating if you copy a program on an USB drive
to use it on a different PC and then all what you get is: This program
can't be executed because ......
No, that's not the reason. I always used .com programs in DOS so I never had to mess around with segment registers.
To use 32 bit addressing modes has nothing to do with libraries.
This tells the compiler what he has to do, not how it has to be down.
Why is 16-bit DOS programming a good choice in the year 2021?
Is this 16 bit DOS or 32 bit Windows programming or is it even
a LINUX program?
*as opposed to slap-dashing some scripting / high-level language
together.
I would even go a step further and directly generate all bytes in
the executable file, this way you can see how the interface to the OS
works.
If it doesn't matter which platform you use, then there is no advantage
in using an obsolete platform instead of a current platform.
But it is a big disadvantage if the generated code can't be executed on a current platform.
Now the answer to the above question, it is neither a DOS, Windows or
Linux code,
it is all three at the same time.
Just set OS to 0,1 or 2 and the assembler will generate an executable for the selected OS from the same source code.
I suspect you also need am assembler/compiler that isn't available (without installing) on any of the OS's.
So why dis anyone doing their own thing?
(16bit x86 asm DOS for me, if you noticed my attempt at a tetris update)
On 08.12.2021 18:37, Kerr-Mudd, John wrote:
I suspect you also need am assembler/compiler that isn't available (without installing) on any of the OS's.
As I already said, it doesn't matter what you have to install
to create a program. But the created program should run without
the need of additional software/libraries which are not part of
a standard OS installation. The assembler I use is a single exe
file and doesn't need to be "installed". And the C source of the
assembler (also only a single C file) can be compiled with any
C compiler.
So why dis anyone doing their own thing?
Because I learned more about assembly programming writing the
assembler than writing assembly programs using the assembler.
(16bit x86 asm DOS for me, if you noticed my attempt at a tetris update)
I know, but I can't test the programs because they don't run in
64 bit Windows. Why not do it with 1024 byte 32 bit exe files instead
of 256 byte 16 bit com files?
| Sysop: | Amessyroom |
|---|---|
| Location: | Fayetteville, NC |
| Users: | 65 |
| Nodes: | 6 (0 / 6) |
| Uptime: | 05:10:09 |
| Calls: | 862 |
| Files: | 1,311 |
| D/L today: |
921 files (14,318M bytes) |
| Messages: | 264,602 |