LinuxQuestions.org
Review your favorite Linux distribution.
Go Back   LinuxQuestions.org > Blogs > rainbowsally
User Name
Password

Notices

Uncategorized Entries with no category
Old

ASM: mixing assembler and C++

Posted 02-05-2012 at 12:05 PM by rainbowsally
Updated 09-04-2013 at 10:19 PM by rainbowsally

This is for intel 32 bit assembler. For 64-bits the calling convention is a bit different. See previous entries (specifically asm 64 bits) if you need a leg-up to break the 64 bit barrier.

Features:
  • Asm functions that can call class functions (using an object pointer) through jump vectors written in C.
  • Usage of extern "C" declarations to un-mangle names we need to keep simple for asm coding.

[If you really want to get down, you can use the mangled names as...
Member
Posted in Uncategorized
Views 845 Comments 0 rainbowsally is offline
Old

ASM: Intercepting (and using) Errors (like segfaults) in asm (aka SEH)

Posted 02-03-2012 at 04:10 PM by rainbowsally

This is for i86 and x86_64 types but with a bit of poking around you can probably find a similar way to do this with other CPUs.

Note: This asm requires 'sigaction'. (See the test code. And bear in mind that this is not an attempt to create a full-blown system of signal handlers. Check the libc docs for 'sigaction' for ideas on how you can use something like this for a seed for a more extensive application.)

There used to be a lot of cool little programs for the...
Member
Posted in Uncategorized
Views 933 Comments 0 rainbowsally is offline
Old

ASM: 64 bit intel asm in linux

Posted 02-03-2012 at 04:01 PM by rainbowsally

If you're used to 32 bit asm in gcc, the 64 bit asm might throw you for a loop initially. That's because part of the stack is passed around in registers.

Let's compile a bit of test code and see what's going on.

If you're using our makefile-creator put this in a subdirectory named "src" or use whatever method you prefer if not.

file: src/main.c
Code:
// main.c
#include <stdio.h>

void  dbg(){}
...
Member
Posted in Uncategorized
Views 952 Comments 0 rainbowsally is offline
Old

Computer Mad Science: The Anatomy Of A Makefile Part 2

Posted 01-28-2012 at 01:24 PM by rainbowsally
Updated 04-09-2012 at 05:44 AM by rainbowsally (updated makefile creator posted)

Note: There's a much more full featured and easily customized makefile creator here. Many features can be added without even recompiling it.
http://www.linuxquestions.org/questi...eration-34648/

For historical reasons we'll keep this blog entry for a while, I guess. -rs

------------------

Features:
  • Example: building an editable makefile creator.

CHANGELOG:
  • Feb
...
Member
Posted in Uncategorized
Views 843 Comments 0 rainbowsally is offline
Old

Computer Mad Science: The Anatomy Of A Makefile Part 1

Posted 01-28-2012 at 01:17 PM by rainbowsally

Features:
  • Anatomy of a Makefile

Requires:
  • an editor that can produce real TABs
  • make
  • And bash (with a 'B')... Not DASH, the Debian default shell, which can cause problems with some makefiles, especially on KDE sytems when trying to link
    libpthreads.

This might be interesting for even non-programmers, just to see how makefiles efficiently work through their dependencies.

[If you're already up to speed on what make does, skip to Part 2 and we'll create...
Member
Posted in Uncategorized
Views 10474 Comments 7 rainbowsally is offline

  



All times are GMT -5. The time now is 09:24 PM.

Main Menu
Advertisement

My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
identi.ca: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration