Re: Two Click disassembly/reassembly
- From: Frank Kotler <fbkotler@xxxxxxxxxxx>
- Date: Sun, 22 Jan 2006 20:28:34 -0500
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 .
- Follow-Ups:
- Re: Two Click disassembly/reassembly
- From: Betov
- Re: Two Click disassembly/reassembly
- From: \\\\\\o///annabee
- Re: Two Click disassembly/reassembly
- References:
- Two Click disassembly/reassembly
- From: randyhyde@xxxxxxxxxxxxx
- Re: Two Click disassembly/reassembly
- From: Frank Kotler
- Re: Two Click disassembly/reassembly
- From: Evenbit
- Re: Two Click disassembly/reassembly
- From: Frank Kotler
- Re: Two Click disassembly/reassembly
- From: Evenbit
- Two Click disassembly/reassembly
- Prev by Date: Re: a challenge
- Next by Date: Re: Masm32 Installation
- Previous by thread: Re: Two Click disassembly/reassembly
- Next by thread: Re: Two Click disassembly/reassembly
- Index(es):
Relevant Pages
|