home bbs files messages ]

Forums before death by AOL, social media and spammers... "We can't have nice things"

   comp.lang.asm.x86      Ahh, the lost art of x86 assembly      4,675 messages   

[   << oldest   |   < older   |   list   |   newer >   |   newest >>   ]

   Message 3,101 of 4,675   
   Robert Prins to Rick C. Hodgin   
   Re: Easy message box   
   27 Nov 17 13:04:49   
   
   From: robert@nospicedham.prino.org   
      
   On 2017-11-26 20:00, Rick C. Hodgin wrote:   
   > On Sunday, November 26, 2017 at 2:50:12 PM UTC-5,   
   > a...@nospicedham.spamtrap.com wrote:   
   >> Hi!   
   >>   
   >> Hey, wouldn't ya know, there is an easy way to show a windows-like message   
   >> box in Linux:   
   >>   
   >> [72 lines of assembly code snipped]   
   >>   
   >> Multiples of 3 and 5   
   >>   
   >> If we list all the natural numbers below 10 that are multiples of 3 or 5,   
   >> we get 3, 5, 6 and 9. The sum of these multiples is 23.   
   >>   
   >> Find the sum of all the multiples of 3 or 5 below 1000. -- aen   
   >   
   > I would like to ask people's opinions here.  I realize this is an assembly   
   > language group, so posting things like this in assembly is what everybody   
   > expects.   
   >   
   > My question is:  Don't you think things like this are far better handled in a   
   > higher level language like C, and that assembly should be used for only those   
   > things where it really matters?   
   >   
   > Back in the late 90s and early 2000s, I wrote an entire OS kernel in   
   > assembly.  It works great and is less than 64 KB, less than 256 KB if you   
   > include the full kernel debugger and disassembler.   
   >   
   > But I would never do it again that way.  In my 20s it was easier to think and   
   > move in that way than it is for me now in my 40s.  And I did not give any   
   > thought to the long-term maintenance issues of going back to assembly code   
   > 10-20 years later and editing it.   
   >   
   > At the very least, C would seem a better target for nearly all things we do   
   > in assembly, with assembly being used for only those things which C does not   
   > handle well, including things specific to a given CPU core or ISA extension.   
   >   
   > In the OP's example, I would rather write some C code to handle the UI part,   
   > and link in any assembly parts.  The code would then require more than just   
   > an assembler, but I think now in terms of maintenance and machine   
   > capabilities.  Unless it has to be rocket fast, C/C++ will be more than   
   > adequate for most needs, and so much faster to develop and maintain.   
      
   Well commented assembler code is, as many in this group are likely to agree   
   with, not (much) harder to maintain than high-level languages. And   
   "rocket-fast"   
   is relative, I use LibreOffice Calc quite a lot, and that's written in C++, and   
   with every new release it seems to be slower...   
      
   Robert   
   --   
   Robert AH Prins   
   robert(a)prino(d)org   
      
   --- SoupGate-Win32 v1.05   
    * Origin: you cannot sedate... all the things you hate (1:229/2)   

[   << oldest   |   < older   |   list   |   newer >   |   newest >>   ]


(c) 1994,  bbs@darkrealms.ca