6502.org Forum  Projects  Code  Documents  Tools  Forum
It is currently Sun Apr 28, 2024 3:42 am

All times are UTC




Post new topic Reply to topic  [ 19 posts ]  Go to page Previous  1, 2
Author Message
 Post subject: Re: Lisa assembler v.3.2
PostPosted: Sun Jul 22, 2018 11:54 pm 
Offline
User avatar

Joined: Sun Jun 30, 2013 10:26 pm
Posts: 1927
Location: Sacramento, CA, USA
Yeah, the opinion he presented in the quote is more puzzling when you discover that he is the author of HLA (high-level assembler) for the x86 crowd, which seems to add quite a thick layer between source code and machine code.

_________________
Got a kilobyte lying fallow in your 65xx's memory map? Sprinkle some VTL02C on it and see how it grows on you!

Mike B. (about me) (learning how to github)


Top
 Profile  
Reply with quote  
 Post subject: Re: Lisa assembler v.3.2
PostPosted: Mon Jul 23, 2018 5:38 am 
Online
User avatar

Joined: Fri Aug 30, 2002 1:09 am
Posts: 8428
Location: Southern California
barrym95838 wrote:
I think he means that the resultant machine code may have redundant instructions that would be easier to see and optimize out if the macros weren't obscuring the details.

Conditional assembly inside the macro can watch for and evaluate the various possible situations, and optimize the output.

_________________
http://WilsonMinesCo.com/ lots of 6502 resources
The "second front page" is http://wilsonminesco.com/links.html .
What's an additional VIA among friends, anyhow?


Top
 Profile  
Reply with quote  
 Post subject: Re: Lisa assembler v.3.2
PostPosted: Mon Jul 23, 2018 9:20 am 
Offline
User avatar

Joined: Tue Mar 02, 2004 8:55 am
Posts: 996
Location: Berkshire, UK
Some of my programs use lots of macros and some use none at all. It really boils down to the type of problem you are trying to solve.

If your program calls for lots of repetitive code blocks while some minor differences in each block then macros work fine. If you need each block finely tuned to its circumstances then they probably wont.

They are a tool and like all tools they can be used well or badly. Much of the art of programming is deciding which of the tools in your toolbox to apply to a problem. They say that if you only have a hammer then everything looks like a nail. Personally I like to carry a screwdriver and a spanner as well.

_________________
Andrew Jacobs
6502 & PIC Stuff - http://www.obelisk.me.uk/
Cross-Platform 6502/65C02/65816 Macro Assembler - http://www.obelisk.me.uk/dev65/
Open Source Projects - https://github.com/andrew-jacobs


Top
 Profile  
Reply with quote  
 Post subject: Re: Lisa assembler v.3.2
PostPosted: Mon Jul 23, 2018 9:20 pm 
Offline

Joined: Sat Dec 13, 2003 3:37 pm
Posts: 1004
BitWise wrote:
They say that if you only have a hammer then everything looks like a nail.

I've always liked this one:
Quote:
When C++ is your hammer, everything looks like your thumb.

As for macros, when in college, I basically wrote a large set of Forth macros.

Essentially, it was a Forth, but done in macros, rather than as an interpreter.

On the plus side, it made my assembly language assignments for my PDP Macro-11 class REALLY easy.

We had on assignment, for example, that we had to extract bit fields from a packed word. You know, an exercise in masking and shifting. No big deal.

Pretty sure nobody else turned one in that output the fields and values in binary and decimal (but they didn't have a BASE variable and common routines for reading and writing numbers). 2 lines of code for me!

Anyway, it was clever at the time. The macro library listing dwarfed the combined assignment listings (some of the assignments were really just 5 lines of "code").

But, boy, it sure was slow! and bloated and all sorts of horrible things lol! For one thing, I always saved and restored registers, no doubt I used more macro expansion at places I probably could have better used a subroutine, stuff like that.

It was a neat set, but made for a lousy compiler.

Was fun though, I got an A! :)


Top
 Profile  
Reply with quote  
Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 19 posts ]  Go to page Previous  1, 2

All times are UTC


Who is online

Users browsing this forum: No registered users and 14 guests


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot post attachments in this forum

Search for:
Jump to: