Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8898297
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 15, 20262026-06-15T00:34:39+00:00 2026-06-15T00:34:39+00:00

the codes: extern inline int strncmp(const char * cs, const char * ct, int

  • 0

the codes:

extern inline int strncmp(const char * cs, const char * ct, int count)
{
register int __res;
__asm__("cld\n"
"1:\tdecl %3\n\t"
"js 2f\n\t"
"lodsb\n\t"
"scasb\n\t"
"jne 3f\n\t"
"testb %%al, %%al\n\t"
"jne 1b\n"
"2:\txorl %%eax,%%eax\n\t"
"jmp 4f\n"
"3:\tmovl $1,%%eax\n\t"
"j1 4f\n\t"
"negl %%eax\n"
"4:"
:"=a" (__res):"D" (cs), "S" (ct), "c" (count):"si","di","cx");
return __res;
}

I don’t understand the f in “js 2f\n\t” and the b in “jne 1b\n“, How to
understand this ? which book I should look? Thank you.

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-15T00:34:41+00:00Added an answer on June 15, 2026 at 12:34 am

    In this context f means forward and b means backward. So js 2f means jump forward to label 2, if sign set.

    You’ll want to look into gcc inline assembly. I can’t seem to find any reference online to include this bit, but I know you can find it in Professional Assembly Language.

    Why can’t we use named labels ? To quote from the book:

    If you have another asm section in your C code, you cannot use the
    same labels again, or an error message will result due to duplicate
    use of labels.

    So what can we do ?

    The solution is to use local labels. Both conditional and
    unconditional branches allow you to specify a number as a label, along
    with a directional flag to indicate which way the processor should
    look for the numerical label. The first occurrence of the label found
    will be taken.

    About modifiers:

    Use the f modifier to indicate the label is forward from the jump
    instruction. To move backward, you must use the b modifier.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

Here is part of my code: extern C REGISTRATION_API int extreme(char* lKey) { string
Consider this C code: extern volatile int hardware_reg; void f(const void *src, size_t len)
Any idea why this code: extern C __declspec(dllexport) void Transform(double x[], double y[], int
Here is the code in C++ dll: extern C _declspec(dllexport) int testDelegate(int (*addFunction)(int, int),
my test code is below: main1.c: #include <stdio.h> extern struct tt ; int main()
c code extern C __declspec(dllexport) int export(LPCTSTR inputFile, string &msg) { msg = haha
Why aren't the codes below working ? Please explain. #include<stdio.h> #include<stdlib.h> int main(int number,
This code: extern void *malloc(unsigned int); struct Box { int x, y ,w, h;
Basically I want to create the data IR for following C code: extern int
Basically the line of code extern char *strlwr OF((char *s)); gives the error warning

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.