Rocksolid Light

Welcome to novaBBS (click a section below)

mail  files  register  nodelist  faq  login

The documentation is in Japanese. Good luck. -- Rich $alz


programming / comp.lang.asm.x86 / Could anyone help me re-writing a function with gcc inline-assembly ?

SubjectAuthor
* Could anyone help me re-writing a function with gcc inline-assembly ?Bonita Montero
`- SolvedBonita Montero

1
Subject: Could anyone help me re-writing a function with gcc inline-assembly ?
From: Bonita Montero
Newsgroups: comp.lang.asm.x86
Organization: albasani.net
Date: Wed, 13 May 2020 06:54 UTC
Path: i2pn2.org!i2pn.org!eternal-september.org!feeder.eternal-september.org!reader01.eternal-september.org!.POSTED!not-for-mail
From: Bonita.M...@nospicedham.gmail.com (Bonita Montero)
Newsgroups: comp.lang.asm.x86
Subject: Could anyone help me re-writing a function with gcc inline-assembly ?
Date: Wed, 13 May 2020 08:54:31 +0200
Organization: albasani.net
Lines: 20
Approved: fbkotler@myfairpoint.net - comp.lang.asm.x86 moderation team.
Message-ID: <r9g5j4$heg$1@news.albasani.net>
Mime-Version: 1.0
Content-Type: text/plain; charset=utf-8; format=flowed
Content-Transfer-Encoding: 7bit
Injection-Info: reader02.eternal-september.org; posting-host="6974bb6d0e09b3acee0555ce6c1b39e9";
logging-data="10405"; mail-complaints-to="abuse@eternal-september.org"; posting-account="U2FsdGVkX1/VBQvLiBtHvUbo/79cQ8bHWuG2BDiEtRc="
User-Agent: Mozilla/5.0 (Windows NT 10.0; WOW64; rv:68.0) Gecko/20100101
Thunderbird/68.8.0
Cancel-Lock: sha1:7XWLY1M3ap81GxK5IgAxrhWQKyA=
View all headers
I've got this Masm-code:

PUBLIC ?spendCycles@@YAX_K@Z
_TEXT SEGMENT
?spendCycles@@YAX_K@Z PROC
test    rcx, rcx
jz      byebye
cycleLoop:
dec     rcx       ; roughly one jump per clock-cycle
jnz     cycleLoop ; because there's only one branch-unit
byebye:
ret
?spendCycles@@YAX_K@Z ENDP
_TEXT ENDS
END

I need a C++-function with gcc inline-assembly that does the same.
Unfortunately I'm not familiar with gcc inline-assembly.
So could anyone here re-write me that code ?



Subject: Solved
From: Bonita Montero
Newsgroups: comp.lang.asm.x86
Organization: albasani.net
Date: Wed, 13 May 2020 18:57 UTC
References: 1
Path: i2pn2.org!i2pn.org!news.swapon.de!eternal-september.org!feeder.eternal-september.org!reader01.eternal-september.org!.POSTED!not-for-mail
From: Bonita.M...@nospicedham.gmail.com (Bonita Montero)
Newsgroups: comp.lang.asm.x86
Subject: Solved
Date: Wed, 13 May 2020 20:57:18 +0200
Organization: albasani.net
Lines: 3
Approved: fbkotler@myfairpoint.net - comp.lang.asm.x86 moderation team.
Message-ID: <r9hfue$sdv$1@news.albasani.net>
References: <r9g5j4$heg$1@news.albasani.net>
Mime-Version: 1.0
Content-Type: text/plain; charset=utf-8; format=flowed
Content-Transfer-Encoding: 7bit
Injection-Info: reader02.eternal-september.org; posting-host="6974bb6d0e09b3acee0555ce6c1b39e9";
logging-data="1230"; mail-complaints-to="abuse@eternal-september.org"; posting-account="U2FsdGVkX1/FvJTLpe80C3RCiStYqlimpAVaxxbKZxI="
User-Agent: Mozilla/5.0 (Windows NT 10.0; WOW64; rv:68.0) Gecko/20100101
Thunderbird/68.8.0
Cancel-Lock: sha1:JBOhnAA02gxJGnyZOyiZtZ6Sj2Y=
View all headers
I simply compiled the C++-code to asm,
modified it and got what I wanted.



1
rocksolid light 0.7.2
clearneti2ptor