Liste des Groupes | Revenir à se design |
On a sunny day (Mon, 18 Nov 2024 10:38:06 -0000 (UTC)) it happened
antispam@fricas.org (Waldek Hebisch) wrote in
<vhf5ec$2h6bb$1@paganini.bofh.team>:
Jan Panteltje <alien@comet.invalid> wrote:>
Yes it all depends, I still have my old 8052 BASIC computer:
https://panteltje.nl/pub/8052AH_BASIC_computer/8052AH_BASIC_computer_inside2_img_1757.jpg
wrote an assembler for it so I could do inline assembler in the BASIC.
I used 5 pole audio connectors to make teh i2c bus external, with sensors and stuff connected to it all around the house.
from before year 2000.
Around 1985 I planned to build a Z80 machine, but then I got ZX Spectrum
and there was no need to build it.
>As to PIC serial code>
As you can see from the below example, PIC asm is very simple and straight forward.
That is the code in my GPS based radiation meter / logger with OLED display and SDcard storage:
https://panteltje.nl/panteltje/pic/gm_pic2/
Still working 24/7 after all these years... can hear it ticking on rasiation, logs to a Raspberry Pi 4 4 GB via a serial to
USB adaptor.
ASM code:
https://panteltje.nl/panteltje/pic/gm_pic2/gm_pic2-0.8.asm
I like to comment in the code, but it is basically very simple.
Well, I used to think "assembler requires comparable effort to C and
is more efficient", but then I looked how much time both take
and compared efficiency: assembler may be more efficient but
efficient assember requires significantly more effort than C.
One can write assembler in a way that saves effort, but then
it tends to be less efficient than output of a good C compiler,
and still takes a bit more effort than C. You may be used
to assembler, but if you are used to both, then reading C is
easier than reading assembler.Anyway, I see no reason to use PIC-s, from normal sources
I would have to pay more for them than I pay for STM32 and
I see no special advantage of PICs.
>
BTW: It seems that there are few thousends of instructions in
your code, AFAICS object code for such a program when compiled
for something like STM32 would be of comparable size and C source
would be smaller.
Yep, but most of that is in every 18F14K22 PIC code I wrote or from that
so all that just an afternoon or 2 to make it work.
I am not against C, but so close to the hardware as in the example I gave it makes little sense.
I use C all the time:
https://panteltje.nl/panteltje/newsflex/download.html
this Newsrreader I am using to read and reply here is written in C:
https://panteltje.nl/panteltje/newsflex/index.html
that uses linked lists,
I have a database of Usenet postings that goes back to my first Linux use in 1998 or so...
wrote that newsreader as there was no Free Agent for Linux...
Also in C is all the raspi code I wrote, no asm there at all,
but I use many libraries that may contain asm...
https://panteltje.nl/panteltje/newsflex/download.html
No C plush plush here... No Python either..
The problem with using someone else's libraries is that those often change,
change maintainer and then lose functionalities or do not work at all anymore.
Les messages affichés proviennent d'usenet.