27 October 2015, 13:22 | #21 | |
Natteravn
Join Date: Nov 2009
Location: Herford / Germany
Posts: 2,496
|
Quote:
The problem of programming in assembler is that you need to write a lot of code for small tasks and that it is not as readable as a structured languages like C, when you look into it at a later point. So, when performance is not the most important aspect of your program, or when the program is becoming more complex, I would always prefer C. You can still insert sub-routines in asssembler, when needed. |
|
27 October 2015, 14:56 | #22 | |||
Computer Nerd
Join Date: Sep 2007
Location: Rotterdam/Netherlands
Age: 47
Posts: 3,754
|
Quote:
Quote:
Quote:
And then comes the hard part: Figuring out how to use them properly. |
|||
27 October 2015, 15:10 | #23 |
Total Chaos forever!
Join Date: Aug 2007
Location: Waterville, MN, USA
Age: 49
Posts: 2,186
|
Speaking of inline assembly, the user-mode assembly instruction set is implemented in Blitz Basic and AmigaE so that using an external assembler is unnecessary. C has yet to match that functionality.
Also, somebody like the original poster who is familiar with Java already, would benefit from the ability to make VTables without having to hand-roll them to get OOP functionality. I wish ANSI/ISO C 2011 (aka C11) was more available. It has type-sensitive generic macro definitions that make the preprocessor actually flexible enough to use for powerful stuff! Kind of like generics on Java or templates on C++! |
27 October 2015, 19:52 | #24 | ||
son of 68k
Join Date: Nov 2007
Location: Lyon / France
Age: 51
Posts: 5,323
|
Quote:
Quote:
Asm may be more difficult to learn but it's worth - especially because this knowledge helps writing better code in other languages. I have made enough BASIC and C to be able to compare all three ; in Asm you do things yourself so it's always done your way. On the other hand you may find things difficult in other languages as they have their limits - the more i used them, the more i ran into these limits. Want to enter a function at another point than the start ? You can't (old basics could, ok). Want a dynamic area allocated in the stack ? You can't - must be of static size. Want to return to another point in the call stack ? You can, but it's cumbersome while in asm it's very easy. Want to turn the callee into the caller ? You can't. Want to compute stuff directly on bytes and words ? You can't. Want to make a pointer on a label for a future goto ? You can't. Want to use bit fields ? You never know in which direction they will be allocated. Want to express a number in binary in your source ? You can't (or tell me how). Want to detect arithmetic overflow ? It's just an horror to do. Want to do macros with conditional assembly ? You can't. And so on, the list is very long. Only Asm provides full freedom. |
||
27 October 2015, 19:58 | #25 |
Computer Nerd
Join Date: Sep 2007
Location: Rotterdam/Netherlands
Age: 47
Posts: 3,754
|
For some it is.
There are people who strongly disagree with this. They'll tell you that it's impossible to write big programs in assembly language, and they'll also tell you that you'll often write better code in C. As you know, I'm not one of them. |
27 October 2015, 20:00 | #26 | ||
son of 68k
Join Date: Nov 2007
Location: Lyon / France
Age: 51
Posts: 5,323
|
Quote:
Sometimes i had to read the asm to understand what a small C block really did - C can be very unreadable sometimes. And yes you need to write quite some code - but once it is written you can reuse it. I can open an Intuition screen and do some graphics on it in five minutes in asm. Matters more in C than in ASM. In ASM any debugger will show you instructions as they are - in C you need source level debugging for the same clarity. Maybe. But as a school of programming they're still the best. Quote:
Has never been a problem for me. |
||
27 October 2015, 20:06 | #27 | |
son of 68k
Join Date: Nov 2007
Location: Lyon / France
Age: 51
Posts: 5,323
|
Everything is difficult when one doesn't know it properly and doesn't want to learn.
Quote:
But better code, certainly not. I've disassembled too many compiled horrors in my life to eat this - and the compiler wasn't necessarily the culprit ! |
|
27 October 2015, 21:04 | #28 | |||||||
Join Date: Jul 2008
Location: Sweden
Posts: 2,269
|
Quote:
Quote:
Quote:
Quote:
Quote:
Quote:
Quote:
|
|||||||
27 October 2015, 22:00 | #29 |
Banned
Join Date: Jul 2014
Location: Vienna/Austria
Posts: 15
|
vbcc is outdated and not worth to use.
Maybe it generate fast code, but only because it suport very basic subset of C. gcc crosscompiler - gcc 3.4.0 You may found at: http://kas1e.mikendezign.com/zeroher...piler_os3.html If You want to use c++ on amiga gcc is best choice. Other c++ compilers are very old and outdated. |
27 October 2015, 22:30 | #30 |
Registered User
Join Date: Sep 2013
Location: Ireland
Posts: 800
|
We studied the 68000 in college. Little did my tiny brain know that the same processor was inside my A600 - I'd have paid far more attention had I known!
This thread is making me want to write a small app in all languages now just to compare and contrast. Maybe an BBC news ticker? It could be expanded to do general RSS later. Just to throw some petrol on the conversation, here's an operating system written in ASM http://kolibrios.org/en/ |
27 October 2015, 23:16 | #31 |
Registered User
Join Date: Jun 2009
Location: Dublin, then Glasgow
Posts: 6,335
|
Wow... Look, this is all getting way out of hand. I too have programmed in all three, although I admit I haven't programmed much Assembly on the Amiga. For the meager benefits it gave me, I soon switched back to C and BASIC. Being able to type 10 lines of code and have a fully working GUI wins over ASM every time for me. My time for hobby programming is limited, and the time and effort it takes to program something in ASM means that I simply wouldn't bother at all.
For what it's worth, my MP3 decoder can decode 192kbps 44.1kHz stereo in realtime on an 060. Playing rubbish quality 22kHz mono music "just because" isn't anywhere on my to-do list. But anyway, that's not what it's for. Its main purpose is a general-purpose engine mainly for use with mhi.library for hardware decoding and the software engine is only provided for powerful enough Amigas - 060, emulation or nextgen. Yes, of course ASM gives full freedom, but just because you have some above average skills in keeping track of everything all your ASM projects are doing doesn't mean us mere mortals should do things that way too. I see that freedom as living your life without using transport. Sure, you can get anywhere for free given enough time and dedication, but despite the cost, I'm much happier getting a train or driving, and I go places I would never go if I had to walk. |
28 October 2015, 08:26 | #32 | ||||
son of 68k
Join Date: Nov 2007
Location: Lyon / France
Age: 51
Posts: 5,323
|
If you don't like freedom, it's indeed not a merit.
When enough code is made, odd and curious usage cases start to appear. Not many Amiga compilers support C99... What's hard to understand there ? Quote:
I know C better than that. Actually at start i liked it, seemed good. But the more i used it, the more i ran into its limits. Quote:
You only have to do the full GUI stuff once, then you reuse. Quote:
22kHz mono isn't exactly rubbish quality - and better play rubbish than not play at all. All streams can play in realtime on a 030, even 320kbps. Of course the same code on a 060 doesn't need to halve frequency and plays anything real time... Quote:
Perhaps we should write some example program in all languages and compare ? |
||||
28 October 2015, 10:31 | #33 |
Registered User
Join Date: Jun 2009
Location: Dublin, then Glasgow
Posts: 6,335
|
Well, it seems the belief against freedom of choice is very very strong too...
It's not about belief, it's about my personal experience. C and BASIC both give me results that I couldn't get with ASM. Simple as that. Why is that so difficult to understand? There are more important things in life than having the "purest", most "free" code, like having the time and motivation to actually produce something. Yep, fully aware of reusable code, as I said my aim was to use mhi.library anyway so it was more a personal exercise to see if I could do it. But do you see how your ideas are so skewed there? You've no problem listening to poor quality music but you hate the idea of a few wasted CPU cycles. It seems that you get an idea in your head and refuse to accept there is any other way. I'm delighted you are so proficient with ASM that you can out-code everyone else. I don't know how much ASM software you've written, but I can only imagine everyone must be using your work at this stage. Perhaps we will all benefit from this when you write alternative versions of software that's out there, and suddenly have all these extra CPU cycles to spare. If you're looking for a project to prove your skills, try writing a native version of SMBFS that fully implements the SMB2 protocol. I'll actually pay good money for that! I'm not particularly interested in a simple program comparison; BASIC will always win with the fewest lines required, ASM will always win with the most efficient code. I simply think you're being ridiculous by refusing to acknowledge that there are many advantages to other languages that make them more suited to certain tasks. For me, ease of development is far more important, and the more complex a project gets, the larger the gap in ease of development is between the languages, and that means that ASM is completely unsuitable for me. |
28 October 2015, 11:32 | #34 | |||||
son of 68k
Join Date: Nov 2007
Location: Lyon / France
Age: 51
Posts: 5,323
|
Quote:
It's just that i don't want to see wrong things being said about ASM. If you just write that you prefer language A or B, no problem. But if you say ASM is more difficult to write, unreadable, or ill-suited for some tasks then you may eventually see me coming. Quote:
If YOU can not get something in ASM, it doesn't imply that ASM is unsuitable for the task - it's just that you can't do it, like you can't pilot a helicopter and prefer using your car. Quote:
And for doing this on a "slow" machine, guess what's needed. If your lib can't play more than 192kbps and puts a 060 to its knee, where my code can play up to 320kbps and leaves 50% cpu free, then there's perhaps something wrong with your code. Quote:
And also a Mac to Amiga game conversion. This is only possible with ASM. Period. Quote:
It's that i refuse the position where ease of development is necessarily poor for ASM. It's that other people usually refuse to acknowledge that their fave language has inherent flaws which can make them sometimes annoying to use. |
|||||
28 October 2015, 11:45 | #35 |
son of 68k
Join Date: Nov 2007
Location: Lyon / France
Age: 51
Posts: 5,323
|
To fix misunderstandings.
I'm not telling anyone that they must use asm. The problem is that most people are saying that asm is inherently complicated, that it takes ages and many lines for just a simple project, that serious coding with it is just not possible, and so on. But all that (for 68k asm) is simply not true - or it's not true for everyone. If I can do something in another language (whichever) then i can also do it in asm. Asm is a different way of thinking. |
28 October 2015, 12:45 | #36 |
Registered User
Join Date: Jun 2009
Location: Dublin, then Glasgow
Posts: 6,335
|
Okay, take it as meant this way: ASM is unsuitable for me because the length of time and effort required to do the same in ASM means my project would not have been possible. I've no doubt you could easily have written InstallerGen in ASM for example quicker than I did in BASIC, and that the reaction times of the gadgets would've been milliseconds faster as a result. But if I had started the project in ASM it wouldn't have ever been finished, and that's why ASM was unsuitable. To re-use your point about poor quality music being better than none, I would say it's better to have casual coders writing applications in C or BASIC than not writing anything. Bottom line is that unless you're very dedicated, ASM does appear more complicated, does require more lines and does require more time to code with. If it didn't, everyone would always use ASM for everything. So why don't they? Just because you and a small number of others are excellent at it, doesn't mean you're in a majority. Amongst the many coders I know, you're a distinct minority and it's important that you realise that.
Of course everything's possible in ASM, I never said it wasn't. It's just a tradeoff as to whether it's worthwhile for the benefits that may or may not be important to the finished article. |
28 October 2015, 13:17 | #37 | |
son of 68k
Join Date: Nov 2007
Location: Lyon / France
Age: 51
Posts: 5,323
|
Then ok, we can agree (mostly).
But beware of arguments such as : Quote:
Everyone usually don't take the easiest path (or else why is so many people using Java ? ). Another thing. People who know asm are normally better programmers at other languages because they know what lies behind. Something to take into account, i think. So the tradeoff may be a longterm one, but it really pays off. |
|
28 October 2015, 13:50 | #38 |
Unregistered User
Join Date: Sep 2012
Location: Copenhagen / DK
Age: 43
Posts: 4,190
|
Even when using higher level languages, it is always good to be able to understand what happens at the lower levels when you do something in your preferred language.
When I do some time-critical stuff in C/C++, I often check the ASM output from the compiler to see if it looks reasonable. Sometimes even a small change in your C code, although still functionally identical, can make a big performance difference in the output. This could be things like reorganising loops or making the scope on variables smaller. Another example is that using if instead of the ternary operator ? could be faster. If you do not check the Asm output, you might not realize this. What I have seen is that sometimes the compiler runs out of CPU registers so it uses the stack extensively inside your inner loop, but with some small modifications, you can sometimes avoid this behaviour completely. The compiler does not know your intentions with the code, so knowing about the underlying structure and Asm is very useful even if you never write Asm directly. Eventually you learn how best to write your high level code to suit the compiler you are using. |
28 October 2015, 14:35 | #39 |
Registered User
Join Date: Jun 2009
Location: Dublin, then Glasgow
Posts: 6,335
|
I understand it's a hollow argument, it's a little different from many people choosing one thing though since they're choosing many other options instead. Programmers will choose what they see as the best tools for the job, and that will depend on the project, time constraints, their abilities and their preference. They don't all choose C, and they don't all choose Java (thankfully).
For the record, I do know ASM, I just don't have your level of proficiency. Most of my programming for my job is done writing firmware which is usually either C or AVR, or occasionally 6809. That's the experience I'm basing my arguments on - I know first-hand that I can achieve far more with a higher-level language than a lower-level one, so I'll opt for the higher-level one when it suits and only use ASM for code that needs cycle-exact timing or extremely limited RAM or flash use. And why I mostly use BASIC for my hobby programming. I agree that it's good to check and understand compiler output, but that's a whole different thing to writing the entire assembly from scratch. |
28 October 2015, 14:57 | #40 | |
Natteravn
Join Date: Nov 2009
Location: Herford / Germany
Posts: 2,496
|
Quote:
I understand Meynaf. The M68k is such a nice CPU and it makes so much fun to code for it, but sometimes you just need to get your GUI done. Or just some conversion tool you need, or something very complex and/or portable. For example I wrote the game Solid Gold in pure 68k assembler (because it's a game and because it's fun), but the tools for converting WAVs and BMPs, or compressing files, were best written in C. This also allowed cross development, as the tools ran on every host system. |
|
Currently Active Users Viewing This Thread: 1 (0 members and 1 guests) | |
Thread Tools | |
Similar Threads | ||||
Thread | Thread Starter | Forum | Replies | Last Post |
Amiga 3D game programming | Steve | Coders. General | 37 | 17 June 2013 22:15 |
Game Programming for Teens, 3rd Edition Book | Amiga Forever | MarketPlace | 3 | 28 February 2011 20:19 |
Andre Lamothe's Tricks of the 3d game programming gurus | Anding | Coders. General | 1 | 18 December 2010 10:58 |
The wrong attitude over bedroom programming and legendary game developers! | manicx | Retrogaming General Discussion | 51 | 10 January 2004 14:09 |
GBA Game Programming Project | CHiEF | Retrogaming General Discussion | 6 | 15 November 2002 00:15 |
|
|