Re: Two Click disassembly/reassembly



Evenbit wrote:

....
Oh, what was I thinking?  Churches tend to burn down when *you* pass
by.  :)

Churches are no issue to me, one way or the other. Like C, some people seem to enjoy it. I'm reluctant to be seen as advocating beer! As Betov would put it, "I have paid to know" that as a recreational drug, alcohol is a pretty good motor fuel. Around bottle 95, you're beginning to do yourself physical harm. If we make a checklist comparing alcohol and heroin, they compare pretty close, except that heroin doesn't have the long-term liver damage. Don't get me started, I can go on for quite a while...


I suspect
the way I allocated a buffer could be done in a more "hla-like" way. I
tried several permutations of "string", but anything I could get hla to
swallow segfaulted...

static
	english_number :byte[128];
...
	conv.utoEng( ecx, &english_number );
...

Seems to work okay, but there's probably a "nicer" way to do it. If it's
going up as an "example", it ought to be "nice".


There several dozen different methods given in the text and the
examples that it is difficult to decide which is "nicest" or the
"official" way.

One way...

static
	mystring	:string	:=	"19 dummy characters";
var
	pMyString	:pointer to mystring;


Another way...

static
	s	:string;
	...
	mov(str.alloc(256), s);


Yet another way...

static
	MyText	:str.strvar(256);


Can't think of the others at this moment, but this short list should help you investigate the issue.

*Me*??? I'm not an hla user! *You* guys figure out how hla can best represent itself. My only contribution to this is to point out that "utoEng" exists in the library. (I only know it's there 'cause I cribbed some code from it - "roman", too)


These variations demo the Standard Library, and how easy it makes it to write - and modify - "portable" code. Randy's version stresses hla's macro capabilities more. But it *also* shows how a clever arrangement of your data can simplify the logic of your code. (IMHO, this second point is somewhat "shrouded" by the "cleverness", but...)

But don't put Randy's code on the "99 Bottles" site until he gets it
right! That's the first rule of assembly homework, as I understand it,
"must assemble". :)

Well, we can at least give him half of a gold star and a C- for getting it to work on Windows. :)

Yeah. There's no requirement that it work on Linux. Many - perhaps most(?) - of the languages represented on that site *are* portable. Assembly is generally considered not portable - and we *can't* do non-x86...


I happen to think that hla's ability to assemble the same code (with some care) for either Windows *or* Linux is one of it's best features (in fact, it's one of the relatively few things about hla that I *do* like). A shame not to show off that feature, when you get an invitation to show off. :)

Best,
Frank
.



Relevant Pages

  • A Friendly review of "Windows Programming in Assemble Language" chapter 2
    ... This is an independent evaluation of Randall Hydes book "Windows ... Programming in Assemble Language". ... Chapter 2: Advanced HLA Programming ... this is about HLA only. ...
    (alt.lang.asm)
  • Re: Why I Dont Use Computers for Audio Very Much
    ... To me its obvious that only the very knowledgeable should assemble ... a computer and install a defined sound card and exactly one software ... motherboard (not a Gigabit, Asus, Abit, or Intel, the brands we talk ... Smoke test time came, and, while there was no smoke, Windows kept not ...
    (rec.audio.pro)
  • Re: Why I Dont Use Computers for Audio Very Much
    ... To me its obvious that only the very knowledgeable should assemble ... a computer and install a defined sound card and exactly one software ... motherboard (not a Gigabit, Asus, Abit, or Intel, the brands we talk ... Smoke test time came, and, while there was no smoke, Windows kept not ...
    (rec.audio.pro)
  • Re: RosAsm now Crashes 3x Faster Than Before!
    ... > RosAsm has certain flaws, ... While HLA, can do nada. ... comes pretty close to doing nada) can assemble those equates without ... > HLA is damaging asm, ...
    (alt.lang.asm)
  • Re: On-line Review of "Art of Assembly"
    ... There are user-written examples in HLA out there, ... But check out what people have to say about AoA. ... > IMO Spasm is like having sex now. ... assemble and run it? ...
    (alt.lang.asm)