Announcing MacPac

Programming, for all ages and all languages.
Post Reply
tjhastings
Posts: 12
Joined: Sat Feb 02, 2008 5:49 pm

Announcing MacPac

Post by tjhastings »

Hello all,

I have created a macro pack (macpac) for NASM and decided to make it a public project with the hope that others may find the macros useful. All the usual stuff is included: procedures, loops, structs...

Please note thse macros are probably full of bugs. :oops: I have only just finished writing them and have not yet used them in real code.

http://code.google.com/p/macpac/

- TJ
Theorem: a cat has nine tails.

Proof: No cat has eight tails. A cat has one tail more than no cat.

Therefore, a cat has nine tails.
User avatar
stephenj
Member
Member
Posts: 140
Joined: Wed Jul 23, 2008 1:37 am
Location: Canada

Re: Announcing MacPac

Post by stephenj »

After a brief review, it looks like we've implemented some of the same macros. I haven't looked at it too much yet, but I suspect your implementation is better than my own.

One macro that I tend to implement is the XOR swap trick (I've yet to find a good alternative to xchg). I'd check my macro include, but my main computer (and only amd64 capable machine) is fried, and I won't have an alternative for a few hours.

Great job though!
tjhastings
Posts: 12
Joined: Sat Feb 02, 2008 5:49 pm

Re: Announcing MacPac

Post by tjhastings »

stephenj wrote:After a brief review, it looks like we've implemented some of the same macros. I haven't looked at it too much yet, but I suspect your implementation is better than my own.
Are the macros you wrote available for download somwhere? I am always interested in seeing how other people implement macros as I often learn something that way.
stephenj wrote:One macro that I tend to implement is the XOR swap trick (I've yet to find a good alternative to xchg).
There is quite a bit more I could add. Current focus is on writing SWITCH/CASE macros to generate branch tables. Once finished with that focus will shift to writing test programs to make sure all the macros work properly.
stephenj wrote:I'd check my macro include, but my main computer (and only amd64 capable machine) is fried, and I won't have an alternative for a few hours.
Sorry to hear your computer is down. I do not have a 64-bit machine to test with and so none of the macpac's macros are 64-bit aware. (64-bit support is planned, however.)
stephenj wrote:Great job though!
Thanks!


- TJ
Theorem: a cat has nine tails.

Proof: No cat has eight tails. A cat has one tail more than no cat.

Therefore, a cat has nine tails.
User avatar
stephenj
Member
Member
Posts: 140
Joined: Wed Jul 23, 2008 1:37 am
Location: Canada

Re: Announcing MacPac

Post by stephenj »

I've yet to publish anything (I don't feel I have anything good enough to publish). But I plan on publishing some of it... Someday.

When I write assembly, I tend not to write 32-bit stuff... There's just something about writing code that will be obsolete (from my perspective) within a few years, that is unappealing.
User avatar
Troy Martin
Member
Member
Posts: 1686
Joined: Fri Apr 18, 2008 4:40 pm
Location: Langley, Vancouver, BC, Canada
Contact:

Re: Announcing MacPac

Post by Troy Martin »

stephenj wrote:When I write assembly, I tend not to write 32-bit stuff... There's just something about writing code that will be obsolete (from my perspective) within a few years, that is unappealing.
I find real mode to be the kind of thing that lives forever, since all computers support it. So that's why I write in 16-bit assembly.

TJ, your macros look real nifty, good luck with them!
Image
Image
Solar wrote:It keeps stunning me how friendly we - as a community - are towards people who start programming "their first OS" who don't even have a solid understanding of pointers, their compiler, or how a OS is structured.
I wish I could add more tex
Post Reply