At 32KB, you want to spend your time fighting the memory
constraints, not the toolchain.
Am 17.03.2026 um 19:34 schrieb Scott Lurndal:
Startup performance (think BIOS and OS boot time, for example), is
very important to real customers. It is particularly important for
industrial and commercial microcontrollers in appliances and
industrial applications.
Yes, 1us vs 1ms.
On Tue, 17 Mar 2026 12:30:14 +0300, Oguz Kaan Ocal wrote:
At 32KB, you want to spend your time fighting the memory
constraints, not the toolchain.
At 32kiB, I would write it all in assembler. Seems like it would be
worth the trouble to hand-tune every instruction to get the size down
and the speed up.
On 05/04/2026 00:29, Lawrence D’Oliveiro wrote:
On Tue, 17 Mar 2026 12:30:14 +0300, Oguz Kaan Ocal wrote:
At 32KB, you want to spend your time fighting the memory
constraints, not the toolchain.
At 32kiB, I would write it all in assembler. Seems like it would be
worth the trouble to hand-tune every instruction to get the size down
and the speed up.
No, it would not. The time when that made sense is decades past. People use C (and even C++) for microcontrollers with a lot less than 32KB of flash. You need a decent compiler, you need to know how to use it properly, and you need to know how to write code appropriate for such devices - but you do it in C, not assembly.
On 06/04/2026 11:21, David Brown wrote:
On 05/04/2026 00:29, Lawrence D’Oliveiro wrote:
On Tue, 17 Mar 2026 12:30:14 +0300, Oguz Kaan Ocal wrote:
At 32KB, you want to spend your time fighting the memory
constraints, not the toolchain.
At 32kiB, I would write it all in assembler. Seems like it would be
worth the trouble to hand-tune every instruction to get the size
down and the speed up.
No, it would not. The time when that made sense is decades past.
People use C (and even C++) for microcontrollers with a lot less
than 32KB of flash. You need a decent compiler, you need to know
how to use it properly, and you need to know how to write code
appropriate for such devices - but you do it in C, not assembly.
I spent some years programming Z80 systems that had up to 64KB. While
I was adept at writing decent assembly code, I still strived to
create a HLL for it.
Assembly was only be used where necessary; implementing the HLL
compiler for a start, then where there were bottlenecks, or working
with closely with hardware (and it was usually done from inline
assembly within the HLL).
Having limited memory was always going be an issue on such systems; I
don't remember that using a simple compiler made much difference.
In any case, even if I'd used C at the time, the available compilers wouldn't have been that much better, in the size and speed of the
code generated, but they'd've been considerably poorer in how they
were deployed.
(I'm agreeing with you BTW.)
On Mon, 6 Apr 2026 12:31:20 +0100
Bart <bc@freeuk.com> wrote:
On 06/04/2026 11:21, David Brown wrote:
On 05/04/2026 00:29, Lawrence D’Oliveiro wrote:
On Tue, 17 Mar 2026 12:30:14 +0300, Oguz Kaan Ocal wrote:
At 32KB, you want to spend your time fighting the memory
constraints, not the toolchain.
At 32kiB, I would write it all in assembler. Seems like it would be
worth the trouble to hand-tune every instruction to get the size
down and the speed up.
No, it would not. The time when that made sense is decades past.
People use C (and even C++) for microcontrollers with a lot less
than 32KB of flash. You need a decent compiler, you need to know
how to use it properly, and you need to know how to write code
appropriate for such devices - but you do it in C, not assembly.
I spent some years programming Z80 systems that had up to 64KB. While
I was adept at writing decent assembly code, I still strived to
create a HLL for it.
Assembly was only be used where necessary; implementing the HLL
compiler for a start, then where there were bottlenecks, or working
with closely with hardware (and it was usually done from inline
assembly within the HLL).
Having limited memory was always going be an issue on such systems; I
don't remember that using a simple compiler made much difference.
In any case, even if I'd used C at the time, the available compilers
wouldn't have been that much better, in the size and speed of the
code generated, but they'd've been considerably poorer in how they
were deployed.
(I'm agreeing with you BTW.)
It sounds like you're talking about limitations of self-hosted C
compilers.
The rest of the thread is concerned with cross-development.
Except of the post of Lawrence D’Oliveiro for which I can't quite figure out what he had in mind.
On Tue, 17 Mar 2026 12:30:14 +0300, Oguz Kaan Ocal wrote:
At 32KB, you want to spend your time fighting the memory
constraints, not the toolchain.
At 32kiB, I would write it all in assembler. Seems like it would be
worth the trouble to hand-tune every instruction to get the size down
and the speed up.
On 06/04/2026 12:52, Michael S wrote:
On Mon, 6 Apr 2026 12:31:20 +0100
Bart <bc@freeuk.com> wrote:
Assembly was only be used where necessary; implementing the HLL
compiler for a start, then where there were bottlenecks, or working
with closely with hardware (and it was usually done from inline
assembly within the HLL).
Having limited memory was always going be an issue on such systems; I
don't remember that using a simple compiler made much difference.
In any case, even if I'd used C at the time, the available compilers
wouldn't have been that much better, in the size and speed of the
code generated, but they'd've been considerably poorer in how they
were deployed.
(I'm agreeing with you BTW.)
It sounds like you're talking about limitations of self-hosted C
compilers.
The rest of the thread is concerned with cross-development.
Except of the post of Lawrence D’Oliveiro for which I can't quite figure >> out what he had in mind.
LD'O's suggestion was to use 100% assembly to get the best performance
and code density, for systems with around 32KB of memory.
My experience showed that even long ago, a HLL was preferable to using >assembly. That is, at a time when compilers weren't so good at
optimising, especially for small devices.
Lawrence D’Oliveiro <ldo@nz.invalid> wrote:
At 32kiB, I would write it all in assembler. Seems like it would be
worth the trouble to hand-tune every instruction to get the size
down and the speed up.
In old times usual trick was to compile to bytecode and use bytecode interpreter.
Bart <bc@freeuk.com> writes:
On 06/04/2026 12:52, Michael S wrote:
On Mon, 6 Apr 2026 12:31:20 +0100
Bart <bc@freeuk.com> wrote:
Assembly was only be used where necessary; implementing the HLL
compiler for a start, then where there were bottlenecks, or working
with closely with hardware (and it was usually done from inline
assembly within the HLL).
Having limited memory was always going be an issue on such systems; I
don't remember that using a simple compiler made much difference.
In any case, even if I'd used C at the time, the available compilers
wouldn't have been that much better, in the size and speed of the
code generated, but they'd've been considerably poorer in how they
were deployed.
(I'm agreeing with you BTW.)
It sounds like you're talking about limitations of self-hosted C
compilers.
The rest of the thread is concerned with cross-development.
Except of the post of Lawrence D’Oliveiro for which I can't quite figure >>> out what he had in mind.
LD'O's suggestion was to use 100% assembly to get the best performance
and code density, for systems with around 32KB of memory.
That hasn't been true for decades, if it ever was true. L d'o has
a history of posting nonesense about computing history.
My experience showed that even long ago, a HLL was preferable to using
assembly. That is, at a time when compilers weren't so good at
optimising, especially for small devices.
Indeed, that was generally true even in the 1970s.
On 06/04/2026 18:57, Scott Lurndal wrote:
Bart <bc@freeuk.com> writes:
On 06/04/2026 12:52, Michael S wrote:
On Mon, 6 Apr 2026 12:31:20 +0100
Bart <bc@freeuk.com> wrote:
Assembly was only be used where necessary; implementing the HLL
compiler for a start, then where there were bottlenecks, or
working with closely with hardware (and it was usually done from
inline assembly within the HLL).
Having limited memory was always going be an issue on such
systems; I don't remember that using a simple compiler made much
difference.
In any case, even if I'd used C at the time, the available
compilers wouldn't have been that much better, in the size and
speed of the code generated, but they'd've been considerably
poorer in how they were deployed.
(I'm agreeing with you BTW.)
It sounds like you're talking about limitations of self-hosted C
compilers.
The rest of the thread is concerned with cross-development.
Except of the post of Lawrence D’Oliveiro for which I can't quite
figure out what he had in mind.
LD'O's suggestion was to use 100% assembly to get the best
performance and code density, for systems with around 32KB of
memory.
That hasn't been true for decades, if it ever was true. L d'o has
a history of posting nonesense about computing history.
My experience showed that even long ago, a HLL was preferable to
using assembly. That is, at a time when compilers weren't so good
at optimising, especially for small devices.
Indeed, that was generally true even in the 1970s.
To be fair, there are differences depending on the processor in
question. For some of the older "brain-dead" 8-bit CISC
microcontroller cores, C compilers often could not come close to the
space or time efficiency of assembly - and those that were good, were
usually very expensive. And you typically had to program in "8051
IAR C" rather than in "C" - your code was so specialised for the
target compiler supplier and target processor that it was more like a C-assembly hybrid. HLL's were a lot better for better processors
(including the Z80).
But for a long time, a "small microcontroller" means a 32-bit ARM
processor with limited flash and ram, for which C works extremely
well. The only 8-bit microcontrollers with any market significance
outside of updates of old systems are AVR devices, and they are also
good with C.
| Sysop: | DaiTengu |
|---|---|
| Location: | Appleton, WI |
| Users: | 1,113 |
| Nodes: | 10 (0 / 10) |
| Uptime: | 492402:22:16 |
| Calls: | 14,249 |
| Files: | 186,315 |
| D/L today: |
85 files (22,085K bytes) |
| Messages: | 2,515,148 |