[Coco] Linville's ramblings on assembly vs machine code

Salvador Garcia salvadorgarciav at yahoo.com
Mon Jul 10 12:42:32 EDT 2017


Dave, I remember one. The venerable "divide/multiply by 2" operation. Instead of using the CPU's builtin instruction, if there was one, and throwing cycles all over the place, a speedy shift could be used instead. Salvador



On Monday, July 10, 2017, 11:37:21 AM CDT, Dave Philipsen <dave at davebiz.com> wrote:

That's my point exactly. Your experience with machine language actually made you a better assembly language programmer.

I also appreciated Mark McDougall's point that if you get into any sizable assembler project you'll probably become at least partially acquainted with m/l through osmosis or perhaps almost out of necessity. Machine language *is* the native language of the CPU.  Assembler is an ever so slight abstraction from that.

I don't have a good example in front of me at the moment but I can remember several instances early on in my experience with assembler looking at some code and wondering why on earth a programmer would have coded in a certain way.  It was only after disassembly into m/l (or breaking down the assembler mnemonics into actual numbers) that I could see why and understand the clever trick that the programmer had pulled.


Dave

> On Jul 10, 2017, at 8:30 AM, Dennis Bathory-Kitsz <bathory at maltedmedia.com> wrote:

> ...
> I started machine language with the KIM-1. You didn't get an assembler with
> only 1K of RAM (actually 2K with the piggyback). Everything was entered with
> the hex keypad, which was itself an abstraction from the binary codes.
> 
> I brought this attitude over to the CoCo -- for example, optimizing my sound
> player in binary. I could manipulate bits and have the code rewrite itself in
> places in order to save machine cycles.
> 


-- 
Coco mailing list
Coco at maltedmedia.com
https://pairlist5.pair.net/mailman/listinfo/coco


More information about the Coco mailing list