16 July 2023, 02:14 | #621 |
Moderator
Join Date: Nov 2004
Location: Eksjö / Sweden
Posts: 5,604
|
C++ is also full of nonsense keywords such as void, empty parentheses of different shapes, and lots of declarative nonsense such as
Struct struct = struct; or anything similar that will make any thinking man squint and blink. It is rather terrible for readability compared to let's say, ideal pseudocode where you break down a problem into constituent parts with as little of the nonsense as you can manage. But I'm succumbing a bit here to the criticisms of C, which was not my intent. Rather to provide positives from coding in Assembler over C, and I don't have anything to add to what I already suggested. Main point is have fun coding for Amiga, my friends. |
16 July 2023, 02:31 | #622 |
Registered User
Join Date: Sep 2007
Location: Stockholm
Posts: 4,337
|
Clang has an option to load a profile from a profiled run of a program and recompile it using that information to reorganise the code according to hot paths identified during the profiling stage. It is not quite as dynamic as a JIT, but allows static optimisation to get closer to dynamic optimisation – assuming your profiling run is close enough to all your users' use cases.
|
16 July 2023, 09:49 | #623 | |
Alien Bleed
Join Date: Aug 2022
Location: UK
Posts: 4,165
|
Quote:
|
|
16 July 2023, 11:14 | #624 | |
Registered User
Join Date: Aug 2010
Location: Germany
Posts: 532
|
Quote:
There must be a reason why contemporary 'C' literature (introductory or reference) is what it is: either brief and/or out of print or so large you may wonder whether you bought a C++ book by mistake. 'C' is the perfect combination of weird and useful. |
|
16 July 2023, 11:33 | #625 |
Alien Bleed
Join Date: Aug 2022
Location: UK
Posts: 4,165
|
The fact is, the C preprocessor has it's own syntax and is separate from C, even though it's part of any standard C compiler distributions included tooling. It doesn't understand C itself (though implementations are free to improve upon that) and just operates on the raw text. It will happily mangle C code via macros into something that either doesn't compile, or worse still will compile but just not into what the developer may have expected.
So no, it's not part of the compiled C language syntax. It's a separate tool that's included to make conditional compilation of C more manageable. I've used the C preprocessor to process other languages. |
16 July 2023, 12:00 | #626 |
Registered User
Join Date: Mar 2012
Location: Norfolk, UK
Posts: 1,153
|
Fun fact: if an assembly language source file's name ends with ".S" instead of ".s", GCC will run it through the C preprocessor before assembling it!
(I abused this horribly in the early days of my CPU project because I was too lazy to write an assembler until I was sure the project was worth carry to completion: http://retroramblings.net/?p=1272 ) |
16 July 2023, 12:20 | #627 | |
Alien Bleed
Join Date: Aug 2022
Location: UK
Posts: 4,165
|
Quote:
|
|
16 July 2023, 12:39 | #628 |
Ex nihilo nihil
Join Date: Oct 2017
Location: CH
Posts: 4,884
|
|
16 July 2023, 13:11 | #629 |
Registered User
Join Date: Jan 2019
Location: Germany
Posts: 3,233
|
No, tnat is not quite the point. For assembly, you are just distracted by all the low-level register logic and cannot quite focus on the algorithmic details of a problem. Also "brainfuck" is "human readable", if you are trained to it, but it is still not a practical language.
|
16 July 2023, 13:45 | #630 |
Alien Bleed
Join Date: Aug 2022
Location: UK
Posts: 4,165
|
Sure, you can read a long array of byte values that contains a mixture of opcode values and encoded multibyte values for branch offsets and varying size integer and floating point immediates. I don't think it's quite as friendly as a bunch of function like C macros that generate the same using mnemonic like names.
|
16 July 2023, 14:20 | #631 | |
Registered User
Join Date: Sep 2007
Location: Stockholm
Posts: 4,337
|
Quote:
One cannot realistically separate C from its preprocessor. |
|
16 July 2023, 15:00 | #632 |
Ex nihilo nihil
Join Date: Oct 2017
Location: CH
Posts: 4,884
|
Friendliness in reading will vary from people to people.
https://www.protemgl.com/articles/th...-movie-arrival You can use this keyboard also : [ Show youtube player ] Edit : If you have never seen this one : start at 5:15 [ Show youtube player ] Last edited by malko; 16 July 2023 at 19:31. |
16 July 2023, 15:45 | #633 | |
Alien Bleed
Join Date: Aug 2022
Location: UK
Posts: 4,165
|
Quote:
Of course, writing single gigantic file programs that only work on a single platform is probably water off a ducks back to your common or garden variety assembler programmer. Maybe they'd enjoy C a lot more this way. *Not strictly required if you don't mind duplicating all your declarations in multiple files. Last edited by Karlos; 16 July 2023 at 15:54. |
|
16 July 2023, 16:48 | #634 |
Computer Nerd
Join Date: Sep 2007
Location: Rotterdam/Netherlands
Age: 47
Posts: 3,763
|
Not a chance Multiple files in both ASM and C is the best thing since sliced bread
|
16 July 2023, 18:08 | #635 |
Alien Bleed
Join Date: Aug 2022
Location: UK
Posts: 4,165
|
|
16 July 2023, 18:49 | #636 | |
Registered User
Join Date: May 2015
Location: Australia
Posts: 131
|
Quote:
Who now hold the keys of Doom. ;-) Speaking of Doom, here's an example. So it's made made clear why C would be used over ASM for practicality to deal with an algorithm. In particular graphic algorithm. And with Doom we see it is written in C and not ASM, though the PC did have coding tutorials in ASM just like the Amiga. Now the Amiga received several Doom ports. But some has some ASM optimisation. If the C code already existed with a decent compiler, which the Amiga had, then why attempt to rewire the wheel? Furthermore, and here's a clincher, if at the end of the day C is the best tool for job with compilers like SAS/C then why did they write those chunky to planar algorithms in ASM instead of C? :-? Last edited by Hypex; 19 July 2023 at 15:27. |
|
16 July 2023, 20:58 | #637 |
Registered User
Join Date: Dec 2014
Location: germany
Posts: 439
|
OT: The original DOS version of doom included routines for the texture mapping inner loops in asm.
|
16 July 2023, 21:13 | #638 |
Registered User
Join Date: Feb 2017
Location: Denmark
Posts: 1,105
|
As did quake, and likely every other "serious" game that used software rendering until things switched to using GPUs. More interesting (for this discussion) I think, is that even wolfenstein (1992) used C for most part (though with heavy use of [inline] assembly).
|
16 July 2023, 21:17 | #639 |
Alien Bleed
Join Date: Aug 2022
Location: UK
Posts: 4,165
|
Actually, quake initially had no asm code, even for DOS. That's what Abrash was there for. Almost everything written by Carmack was pure C.
|
16 July 2023, 21:19 | #640 |
Alien Bleed
Join Date: Aug 2022
Location: UK
Posts: 4,165
|
Just to nitpick, DOS was not the original Doom. It was written on a 68040 powered NeXT system IIRC.
|
Currently Active Users Viewing This Thread: 1 (0 members and 1 guests) | |
Thread Tools | |
Similar Threads | ||||
Thread | Thread Starter | Forum | Replies | Last Post |
Chat GPT Amiga Assembly | rcman | Coders. Asm / Hardware | 3 | 26 March 2023 20:24 |
An Amiga coder was banned without a reason - is it ok? | litwr | project.EAB | 1 | 18 June 2021 20:38 |
Beginning Amiga Assembly Tutorial(s) | Curbie | Coders. Asm / Hardware | 15 | 29 May 2020 00:21 |
Beginning Amiga Assembly Programming | Hewitson | Coders. Tutorials | 32 | 09 October 2012 18:25 |
Amiga Assembly sources - Please help! | W4r3DeV1L | Amiga scene | 21 | 16 July 2008 08:13 |
|
|