tech-userlevel archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

Re: Adding asm examples



On Sun, Nov 13, 2011 at 12:44:51AM -0500, Julio Merino wrote:
> Me, for example: someone who is reading a book on architecture X, finds
> something interesting that wants to try (like inspecting some particular
> register values) and has no trivial way to do so right away because all
> the examples in the book are written for a different assembler and I
> have no idea how to manually construct a pure assembler binary for
> NetBSD that performs the correct syscalls.

Yeah, well, what uwe says, and the way you are demonstrating in the example
surely looks like the most complex possible way.

Why not just do something like:

        .text
        .global main
        main:
                ... some asm stuff
                call printf
                ret

and "assemble" it by running "gcc test.S"?

Martin


Home | Main Index | Thread Index | Old Index