diff --git a/demos/asm/header.h b/demos/asm/header.h index fc9ed4f3..e2ff7716 100644 --- a/demos/asm/header.h +++ b/demos/asm/header.h @@ -1 +1 @@ -#define SOME_VALUE 0x1111 +#define SOME_VALUE 0x1a5 diff --git a/demos/asm/test.S b/demos/asm/test.S index 32217583..40cdaaa2 100644 --- a/demos/asm/test.S +++ b/demos/asm/test.S @@ -4,12 +4,18 @@ .align 2 val: - .long 10 + .long SOME_VALUE -# Multiply input value by 10... +// Multiply input value by 421... .global mult10 .type mult10, function mult10: - movl val,%eax - imul 4(%esp),%eax - ret + pushq %rbp + movq %rsp,%rbp + + movl val,%eax + imull %edi,%eax + + popq %rbp + ret + diff --git a/demos/asm/wscript b/demos/asm/wscript index 78a5d48f..312e6ac6 100644 --- a/demos/asm/wscript +++ b/demos/asm/wscript @@ -1,8 +1,12 @@ #! /usr/bin/env python # encoding: utf-8 +import sys + def configure(conf): conf.load('gcc gas') + if sys.maxint < 4**21: + conf.fatal('this example is for 64-bit systems only') def build(bld): # http://docs.waf.googlecode.com/git/apidocs_16/tools/asm.html @@ -11,3 +15,8 @@ def build(bld): target = 'asmtest', includes = '.') + def disp(ctx): + node = ctx.bldnode.ant_glob('asmtest*', remove=False)[0] + ctx.exec_command('%s' % node.abspath(), shell=False) + bld.add_post_fun(disp) +