Assembly language in X-Code

I am currently taking assembly language for my undergrad. i have Xcode installed in my computer but i have no idea how to use the xcode for the assembly language. can anyone help me with that.

Which assembly language are you referring to?
The documentation from apple can be found here: http://developer.apple.com/library/mac/documentation/DeveloperTools/Reference/As sembler/Assembler.pdf.

Similar Messages

  • Using C functions from IA-32 assembly language

    Is it possible to use 32-bit assembly language to call C functions in 64-bit linux?
    Background: I'm learning 32-bit AT&T syntax Linux assembly language programming. The only reason for 32-bit is that's what's covered in the book I have. Some simple examples assemble, link, and execute in Arch 64 using GNU either gcc or as + ld -- with no changes either to code or command line flags.
    The problem: I'm having trouble with C function calls. Even after replacing register names (e.g., edi -> rdi) and mnemonics (e.g., movl -> movq), I find that a program which calls printf and exit never prints anything, and never returns. Hence the question.
    I can post code if needed (it's on my other machine), but this is really more of a general question -- is it possible to call C functions in Arch 64 using 32-bit AT&T syntax, and if so, how.
    Thanks!

    Not even a typo, just confusion. The CPU is an Intel Core 2 Duo -- so it's actually x86-64.
    I realize that NASM is not GAS, but checking the NASM manual helped me figure out a few things about calling 64-bit C functions:
        http://www.nasm.us/doc/nasmdo11.html
    It took a while to figure out how to correctly call printf. The missing clue was here:
        http://www.mit.edu/~6.035/handouts-2007 … convention
    printf reads the number of variable arguments from %rax. In this example, printf is called with no variable arguments:
    # c_functions.s - Calls 64-bit C functions putchar, printf, and exit
    .section .data
    a:
    .byte 'a'
    newline:
    .byte '\n'
    hello:
    .asciz "hello, world\n"
    .section .text
    .globl main
    main:
    movq a, %rdi # used as argument for putchar
    call putchar
    movq newline, %rdi # used as argument for putchar
    call putchar
    movq $hello, %rdi # first argument for printf (i.e., the format string)
    movq $0, %rax # number of variable arguments for printf
    call printf
    movq $0, %rdi
    call exit
    For simplicity, I compiled and linked with gcc (in other words, I let gcc figure out how to properly call as and ld):
        gcc c_functions.s
    If I can figure out how to pass variable arguments to printf, I'll post that. Based on the MIT reference linked above, it sounds like those arguments would be passed in SSE registers.

  • Assembly language on Mac OS X

    I just purchased two books. The first is called "Write Great Code -- Volume 1: Understanding the Machine". It is not about assembly language in specific, just about understanding how computers work on a low level. The other is called "Assembly Language: Step-by-Step" by Jeff Duntemann. I've only read the introduction. It teaches assembly language for Intel-based computers (that's me!), but it also says that it's for DOS and Linux. However, I believe that the reason it says this is because it teaches using the NASM assembler, which, at the time this second edition of the book was published, was only available for DOS and Linux. However, they now have a Mac OS X version of NASM, and I've download it. So, here are my questions:
    1.) Given the information I just gave about this book, I want to make sure that the information and code in it will apply to Mac OS X. It certainly sounds like it will, and I understand that there may be minor differences, but I just want to make sure that I'm in the right ballpark here by using this book.
    2.) Since it teaches NASM, I'm assuming that NASM was the right assembler for me to download. I also just wanted to check and see if there's any other tools I should be downloading. The book mentions a NASM-IDE, but says that it's for DOS only. Is there anything else like this (or anything else at all) that I should obtain?
    3.) Does NASM need to be installed? I went to the NASM website and downloaded the newest version (2.08rc1) for Mac OS X, and it unzipped in my Downloads folder. I've opened the folder and it's a bunch of files that I can't recognize (no install or app files in other words -- just files like rdf2bin, rdf2com, idrdf, and so forth). Is there anything else I need to do? Should I move this folder somewhere? What else do I need to do to get started here? Where would I write my code? How would I run the code? As of right now I have no idea where to go from here, and as you can tell I know nothing about how all this works. Maybe the book will tell me more when I get to the first code sample in the book, but it doesn't look like it, so I just wanted to ask for any information that anyone has time to give about anything relating to getting starting with assembly language and NASM on Mac OS X.
    Thanks in advance for any help. I'd love to hear any input or recommendations on this subject, since it's something I really know nothing about, but you gotta start somewhere!

    Okay, so I found a site to guide me through the installation of NASM on Mac OS X, and it said that 2.08rc1 is a "release candidate" (thus the "rc" part -- yeah, I'm not too sharp), and that I should have downloaded the newest version that didn't have "rc" in it, so I went back and downloaded 2.07. Unlike with 2.08rc1, there wasn't a folder on the website for a Mac OS X version, just DOS and Linux and Win32 and whatnot, but the site that was guiding me said to download the file called nasm-2.07.tar.bz2 (or something like that), so that's what I did. It then gave me instructions for configuring and installing NASM via the terminal, and it worked great! I've compiled and installed NASM, so I've gotten that far, but the rest of my questions in the previous post still apply. For example, I still want to make sure the book I bought will be applicable to assembly language on Mac OS X. Also, I'd like to know if there is anything else (like the NASM-IDE I mentioned in the above post) that I should download. And, finally, I still don't know where to go from here to get started with coding assembly language (I mean, for example, I think I read in my book that you write the code in a text editor -- is that right? How's that work?). Any further input on any of this or anything from the previous post above would be greatly appreciated. Thanks!

  • Is it possible to use assembly language..?

    is it possible to use assembly language code with the packager for iphone?

    I hope we can write assembly language in XCode and not in packager for iphone. it supports flash and the script of flash AS3.0

  • Assembly Language in Xcode

    I am currently taking a Java course in college and it runs great in Xcode.
    I just found out today that I will have to take an assembly language course sometime next year. I talked to the genius at my local apple store and he said that assembly language will work in Xcode, but will be different for PPC and intel macs.
    However, he did not tell me how to start in assembly language in xcode. If anyone knows how please tell me and, if possible, supply some sample code for an intel mac so I can test it out.
    iBook G4 14 1.2GHz, 1.25GB, iMac Core Duo 17" 1.83GHz 1GB   Mac OS X (10.4.8)  

    There is "gas", the GNU Assembler. As a student, you can buy Borland's Turbo Assembler for $130. The more common Turbo C++, Turbo Delphi(s), and Turbo C# are now free.
    A MBP with Parallels will pretty much handle anything that will run on a PC. It would be an excellent choice for any programmer.
    Still, tele_player is correct. There is no way to tell what platform your assembly class may be using. Few people use assembly anymore and those that do are a little bonkers or just stubborn. You may find yourself learning assembly for the Z80, 68000, or IBM System/360. On the bright side, there are probably emulators for all of those that run on a modern Mac. On the downside, you may still have to submit your assignments on the lab machine.
    It is definitely an excellent course to take. There are not enough programmers who know assembly. You will really learn a lot about how a computer runs software and how to write software.

  • ASSEMBLY LANGUAGE FILE TO .CLASS --- URGENT!!!!

    Can someone please tell me how to convert a MIPS assembly language file to a .class so I can run it in a JVM? It's URGENT (there's a bus about to hit me and the driver will only stop if I can tell him how to do this).

    Looking for real boobs? I have the best for you. Look
    at www.realandnatural.info you will find the largest
    archive on the net. Enjoy! =)You can't have read many of the posts here. We have quite a set of them ourselves.

  • Assembly Language Help

    I know this proably not the right place to post this topic but I couldn't find anywhere else.
    Basically I am developing a program for high school kids learning assembly language. I am developing it in Java but it has been over 10 years since I have ever done any assembly. I am working through good books and tutorials to refresh my mind. I have come to the example below and got stuck. can anyone spare 5 mins to explain ech line of the following to me in real simple terms. Duke dollars available.
    Load R1,R8
    add R1,16
    Loadind R2,R1
    add R1,8
    loadind R3,R1
    add R3,R2
    sub R1,4
    storeind R3,R1
    Many thanks

    It looks like an addition of operands on the heap of a 32bit processor.
    R8 is a pointer to a heap which has the following format:   +-------+-------+-------+-------+-------+-------+-------+
       |       |       |       |       |   A   |   C   |   B   |
       +-------+-------+-------+-------+-------+-------+-------+
       R8    R8+4    R8+8    R8+12   R8+16   R8+20   R8+24What we want is to execute C=A+B.
    Load R1,R8We are going to have R1 pointing on the place in the heap we are interested in. R8 is probably a register reserved for the heap, which should not be changed, so we copy it into R1.
    add R1,16Move R1 pointer so that it points 16 bytes higher, where A is.
    Loadind R2,R1Load the content of A (pointed by R1) into R2. Note that we are not interested here in the value of R1, but in the value pointed by R1, thus the "ind" for "indirect".
    add R1,8Move the R1 pointer to point 8 bytes higher, where B is.
    loadind R3,R1Load the content of B (pointed bt R1) into R3.
    add R3,R2Add R2 to R3 (the result is stored into R3).
    sub R1,4Move the R1 pointer to point 4 bytes lower, where C is.
    storeind R3,R1Store the result into C.
    Jerome.

  • WHAT IS ASSEMBLY LANGUAGE?

    I know this isn't really related to java.
    What is assembly language? I've heard of it but I'm not sure what it is.

    Simply, it is a language that depends on the particular machine you program.
    High level languages like Java,Pascal, etc ... don't depend from the particualr machine where you program ... you have to run the java program .. or re-compile the Pascal program .... to obtain portability on a particular platform ....
    an assembly (asm) program is not portable ... (since the born of emulators)

  • Executing tiny programming language compiled byte code with the JVM

    Hello,
    For a project, I am developing a simple programming language, with a syntax not unlike Pascal, which compiles to Java Byte Code. Currently I execute the compiled byte code using my own interpreter. This works OK, but what I'd like to do now is to execute the compiled byte code using the actual existing JVM. The compiled byte code resides in a text file upon compilation of a sample program written in my tiny programming language. Does anyone know how I may start to go about this? Thanks in advance.
    adam

    The only way of getting a standard Java virtual machine to execute your java byte code, is to wrap it up into a completely valid java class file.
    Any constants you use, must be put into the classes constant pool.
    Any local variables will have to go into the local variable table of the method which uses them... etc, etc.
    Something like ASM, would let you dynamically create a Java class file.
    http://asm.objectweb.org/
    regards,
    Owen

  • Japanese Language in Company Code

    Hi Gurus,
    I have this scenario. First I configured the City of the Company Code and I am logged using EN language. Then I log using JA(Japan) and I also configured the City using Japanese character. When I log again using EN and looked at the city field, the data is in Japanese Character. The City which is supposed in EN was overwritten.
    Does anyone encountered the same scenario? How can it be resolved?
    Also i noticed that the TRANSLATION button was deactivated in SPRO. Could this be an installation problem of ECC6 Japanese language? Or am I not doing the right thing.
    Thanks,
    Andre

    Are you using a Unicode system? If not, then this what are you doing can't work.
    Markus

  • Why do web pages print out in some kind of weird language or binary code?

    When I look at a web page (ie. on-line order from Staples) it looks normal. When I go to print it, the formatting is bizarre - I cannot even reproduce it for you as it is full of marks and squiggles. Numbers do not come out at all.
    I just always used Explorer if their was something I knew I was going to want a printed copy of.
    (50@$0.49) $24.50 printed as E RM ] AMKQV F AOQKRM
    PST/QST printed as mpqLnpq
    The word Documents comes out as acAiaEaie with ~`" ^ type marks above the letters.

    There's a Bug which causes Firefox to print '''gibberish''' or '''garbeled''' characters for certain fonts, with certain print drivers.
    https://bugzilla.mozilla.org/show_bug.cgi?id=454532
    ''(Please don't comment in that Bug report unless you can provide a patch to fix the problem.)''
    https://bugzilla.mozilla.org/page.cgi?id=etiquette.html

  • Get Locale country and language codes

    I have checked the documentation, but nothing is jumping out
    at me. Is there a function that returns the locale country and
    language codes? GetLocale() returns the "locale name as it is
    represented in ColdFusion":
    ie:
    English (US)
    Spanish (Standard)
    What I am looking for is the
    ISO
    codes
    en US
    es ES
    I can get the information using getPageContext(), but just
    wondered if I was overlooking a built-in CF function.

    -==cfSearching==- wrote:
    > The problem with the functions I have seen is that they
    return
    locale name
    > as it is represented in ColdFusion (ie English (US)
    ). But what I am
    > looking for the ISO language and country codes.
    ...hmm this didn't go thru on the 16th. let me try again.
    that should only be for the "traditional" cf supported
    locales (backwards
    compatibility is always foremost in the cf team's minds), the
    rest should be in
    normal java style locale ID (th_TH, ar_AE, etc).
    no, there's nothing built-in in cf for what you want. you'll
    have to dip down
    into java:
    <cfscript>
    localeObj=createObject("java","java.util.Locale");
    locales=localeObj.getAvailableLocales();
    writeOutput("<table border='1'>");
    writeOutput("<tr align='center'><td
    colspan='2'>Locale</td><td>Language</td><td>Country</td></tr>");
    for (i=1; i LTE arrayLen(locales);i=i+1) {
    thisLocale=locales
    thisLanguage=thisLocale.getLanguage();
    thisCountry=thisLocale.getCountry();
    writeOutput("<td>#thisLocale.toString()#</td><td>#thisLocale.getDisplayName()#</td><td>#t hisLanguage#</td><td>#thisCountry#</td></tr>");
    writeOutput("</table>");
    </cfscript>
    note that this snippet doesn't show variants (eg. th_TH_TH)
    & shows language
    only locales (en, fr, etc.), nor is it sorted in any order i
    can recognize. also
    keep in mind that what this shows depends on the server's JRE
    version. if you
    want a "better" source of locales, use the icu4j lib's
    ULocale class. it's based
    on the latest CLDR & contains way more locales (and they
    actually tend to fix
    locale bugs in your lifetime).

  • ISO Code in Idocs,Language dependent settings,UoM "PCE" and Russian lang.

    Dear EDI Experts,
    I have to deal with the following issue:
    MATMAS05 Idoc created via BD10 and covnerted to an XML file.
    This files are "deployed" to SQL Servers in different countries, e.g. RUSSIA, UKRAINE.
    When transferring that material master the ISO code for Base unit of measurement is "PCE" (Transaction CUNI) used for the idoc.
    How can I establish the logic that when RU is language the ISO code "Шт." is sent, when UA it is "на".
    Is there a language-dependent setting possible for the ISO-codes?
    If not, any BADI possible?
    Any help appreaciated.
    Thanks so much.
    Regards
    JW

    Hi there,
    thanks a lot for your quick answer. Entries in table T006 and transcation CUNI are unerstood.
    Entry for e.g. UoM "ST" in T006: ISO-Code "PCE"
    When creating a material idoc MATMAS05 PCE is copied toe the repsective segment field. How can I establish that the system sends "Шт" for language RU and "на" for language UA.
    Any standard setting available for such logic or is coding requested? If so, any BADI, FM you may recomment?
    Thanks a lot
    Cheers
    JW
    Example for UoM "ST"  - ISO-code (table T006)
    How can we establish the

  • How to set the return language? i read the api already

    import java.io.*;
    import java.util.*;
    class Listing_Available_Locales
         public static void main(String args[])   
             Locale[] locales = Locale.ENGLISH(); //error is here
                             //Locale[] locales = Locale.getAvailableLocales(); //this line no error
             for (int i=0; i<locales.length; i++) {
                 // Get the 2-letter language code
                 String language = locales.getLanguage();
         // Get the 2-letter country code; may be equal to ""
         String country = locales[i].getCountry();
         // Get localized name suitable for display to the user
         String locName = locales[i].getDisplayName();
         System.out.println(language+" "+country+" "+locName);
    local api is like below
    java.util
    Class Locale
    java.lang.Object
    java.util.Locale
    All Implemented Interfaces:
    Cloneable, Serializable
    public final class Locale
    extends Object
    implements Cloneable, Serializable
    A Locale object represents a specific geographical, political, or cultural region. An operation that requires a Locale to perform its task is called locale-sensitive and uses the Locale to tailor information for the user. For example, displaying a number is a locale-sensitive operation--the number should be formatted according to the customs/conventions of the user's native country, region, or culture.
    Create a Locale object using the constructors in this class:
    Locale(String language)
    Locale(String language, String country)
    Locale(String language, String country, String variant)
    The language argument is a valid ISO Language Code. These codes are the lower-case, two-letter codes as defined by ISO-639. You can find a full list of these codes at a number of sites, such as:
    http://www.ics.uci.edu/pub/ietf/http/related/iso639.txt
    The country argument is a valid ISO Country Code. These codes are the upper-case, two-letter codes as defined by ISO-3166. You can find a full list of these codes at a number of sites, such as:
    http://www.chemie.fu-berlin.de/diverse/doc/ISO_3166.html
    The variant argument is a vendor or browser-specific code. For example, use WIN for Windows, MAC for Macintosh, and POSIX for POSIX. Where there are two variants, separate them with an underscore, and put the most important one first. For example, a Traditional Spanish collation might construct a locale with parameters for language, country and variant as: "es", "ES", "Traditional_WIN".
    Because a Locale object is just an identifier for a region, no validity check is performed when you construct a Locale. If you want to see whether particular resources are available for the Locale you construct, you must query those resources. For example, ask the NumberFormat for the locales it supports using its getAvailableLocales method.
    Note: When you ask for a resource for a particular locale, you get back the best available match, not necessarily precisely what you asked for. For more information, look at ResourceBundle.
    The Locale class provides a number of convenient constants that you can use to create Locale objects for commonly used locales. For example, the following creates a Locale object for the United States:
    Locale.US
    Once you've created a Locale you can query it for information about itself. Use getCountry to get the ISO Country Code and getLanguage to get the ISO Language Code. You can use getDisplayCountry to get the name of the country suitable for displaying to the user. Similarly, you can use getDisplayLanguage to get the name of the language suitable for displaying to the user. Interestingly, the getDisplayXXX methods are themselves locale-sensitive and have two versions: one that uses the default locale and one that uses the locale specified as an argument.
    The Java 2 platform provides a number of classes that perform locale-sensitive operations. For example, the NumberFormat class formats numbers, currency, or percentages in a locale-sensitive manner. Classes such as NumberFormat have a number of convenience methods for creating a default object of that type. For example, the NumberFormat class provides these three convenience methods for creating a default NumberFormat object:
    NumberFormat.getInstance()
    NumberFormat.getCurrencyInstance()
    NumberFormat.getPercentInstance()
    These methods have two variants; one with an explicit locale and one without; the latter using the default locale.
    NumberFormat.getInstance(myLocale)
    NumberFormat.getCurrencyInstance(myLocale)
    NumberFormat.getPercentInstance(myLocale)
    A Locale is the mechanism for identifying the kind of object (NumberFormat) that you would like to get. The locale is just a mechanism for identifying objects, not a container for the objects themselves.
    Each class that performs locale-sensitive operations allows you to get all the available objects of that type. You can sift through these objects by language, country, or variant, and use the display names to present a menu to the user. For example, you can create a menu of all the collation objects suitable for a given language. Such classes must implement these three class methods:
    public static Locale[] getAvailableLocales()
    public static String getDisplayName(Locale objectLocale,
    Locale displayLocale)
    public static final String getDisplayName(Locale objectLocale)
    // getDisplayName will throw MissingResourceException if the locale
    // is not one of the available locales.
    Since:
    1.1
    See Also:
    ResourceBundle, Format, NumberFormat, Collator, Serialized Form
    Field Summary
    static Locale CANADA
    Useful constant for country.
    static Locale CANADA_FRENCH
    Useful constant for country.
    static Locale CHINA
    Useful constant for country.
    static Locale CHINESE
    Useful constant for language.
    static Locale ENGLISH
    Useful constant for language.
    static Locale FRANCE
    Useful constant for country.
    static Locale FRENCH
    Useful constant for language.
    static Locale GERMAN
    Useful constant for language.
    static Locale GERMANY
    Useful constant for country.
    static Locale ITALIAN
    Useful constant for language.
    static Locale ITALY
    Useful constant for country.
    static Locale JAPAN
    Useful constant for country.
    static Locale JAPANESE
    Useful constant for language.
    static Locale KOREA
    Useful constant for country.
    static Locale KOREAN
    Useful constant for language.
    static Locale PRC
    Useful constant for country.
    static Locale SIMPLIFIED_CHINESE
    Useful constant for language.
    static Locale TAIWAN
    Useful constant for country.
    static Locale TRADITIONAL_CHINESE
    Useful constant for language.
    static Locale UK
    Useful constant for country.
    static Locale US
    Useful constant for country.
    Constructor Summary
    Locale(String language)
    Construct a locale from a language code.
    Locale(String language, String country)
    Construct a locale from language, country.
    Locale(String language, String country, String variant)
    Construct a locale from language, country, variant.
    Method Summary
    Object clone()
    Overrides Cloneable
    boolean equals(Object obj)
    Returns true if this Locale is equal to another object.
    static Locale[] getAvailableLocales()
    Returns a list of all installed locales.
    String getCountry()
    Returns the country/region code for this locale, which will either be the empty string or an upercase ISO 3166 2-letter code.
    static Locale getDefault()
    Gets the current value of the default locale for this instance of the Java Virtual Machine.
    String getDisplayCountry()
    Returns a name for the locale's country that is appropriate for display to the user.
    String getDisplayCountry(Locale inLocale)
    Returns a name for the locale's country that is appropriate for display to the user.
    String getDisplayLanguage()
    Returns a name for the locale's language that is appropriate for display to the user.
    String getDisplayLanguage(Locale inLocale)
    Returns a name for the locale's language that is appropriate for display to the user.
    String getDisplayName()
    Returns a name for the locale that is appropriate for display to the user.
    String getDisplayName(Locale inLocale)
    Returns a name for the locale that is appropriate for display to the user.
    String getDisplayVariant()
    Returns a name for the locale's variant code that is appropriate for display to the user.
    String getDisplayVariant(Locale inLocale)
    Returns a name for the locale's variant code that is appropriate for display to the user.
    String getISO3Country()
    Returns a three-letter abbreviation for this locale's country.
    String getISO3Language()
    Returns a three-letter abbreviation for this locale's language.
    static String[] getISOCountries()
    Returns a list of all 2-letter country codes defined in ISO 3166.
    static String[] getISOLanguages()
    Returns a list of all 2-letter language codes defined in ISO 639.
    String getLanguage()
    Returns the language code for this locale, which will either be the empty string or a lowercase ISO 639 code.
    String getVariant()
    Returns the variant code for this locale.
    int hashCode()
    Override hashCode.
    static void setDefault(Locale newLocale)
    Sets the default locale for this instance of the Java Virtual Machine.
    String toString()
    Getter for the programmatic name of the entire locale, with the language, country and variant separated by underbars.
    Methods inherited from class java.lang.Object
    finalize, getClass, notify, notifyAll, wait, wait, wait
    Field Detail
    ENGLISH
    public static final Locale ENGLISHUseful constant for language.
    FRENCH
    public static final Locale FRENCHUseful constant for language.
    GERMAN
    public static final Locale GERMANUseful constant for language.
    ITALIAN
    public static final Locale ITALIANUseful constant for language.
    JAPANESE
    public static final Locale JAPANESEUseful constant for language.
    KOREAN
    public static final Locale KOREANUseful constant for language.
    CHINESE
    public static final Locale CHINESEUseful constant for language.
    SIMPLIFIED_CHINESE
    public static final Locale SIMPLIFIED_CHINESEUseful constant for language.
    TRADITIONAL_CHINESE
    public static final Locale TRADITIONAL_CHINESEUseful constant for language.
    FRANCE
    public static final Locale FRANCEUseful constant for country.
    GERMANY
    public static final Locale GERMANYUseful constant for country.
    ITALY
    public static final Locale ITALYUseful constant for country.
    JAPAN
    public static final Locale JAPANUseful constant for country.
    KOREA
    public static final Locale KOREAUseful constant for country.
    CHINA
    public static final Locale CHINAUseful constant for country.
    PRC
    public static final Locale PRCUseful constant for country.
    TAIWAN
    public static final Locale TAIWANUseful constant for country.
    UK
    public static final Locale UKUseful constant for country.
    US
    public static final Locale USUseful constant for country.
    CANADA
    public static final Locale CANADAUseful constant for country.
    CANADA_FRENCH
    public static final Locale CANADA_FRENCHUseful constant for country.
    Constructor Detail
    Locale
    public Locale(String language,
    String country,
    String variant)Construct a locale from language, country, variant. NOTE: ISO 639 is not a stable standard; some of the language codes it defines (specifically iw, ji, and in) have changed. This constructor accepts both the old codes (iw, ji, and in) and the new codes (he, yi, and id), but all other API on Locale will return only the OLD codes.
    Parameters:
    language - lowercase two-letter ISO-639 code.
    country - uppercase two-letter ISO-3166 code.
    variant - vendor and browser specific code. See class description.
    Throws:
    NullPointerException - thrown if any argument is null.
    Locale
    public Locale(String language,
    String country)Construct a locale from language, country. NOTE: ISO 639 is not a stable standard; some of the language codes it defines (specifically iw, ji, and in) have changed. This constructor accepts both the old codes (iw, ji, and in) and the new codes (he, yi, and id), but all other API on Locale will return only the OLD codes.
    Parameters:
    language - lowercase two-letter ISO-639 code.
    country - uppercase two-letter ISO-3166 code.
    Throws:
    NullPointerException - thrown if either argument is null.
    Locale
    public Locale(String language)Construct a locale from a language code. NOTE: ISO 639 is not a stable standard; some of the language codes it defines (specifically iw, ji, and in) have changed. This constructor accepts both the old codes (iw, ji, and in) and the new codes (he, yi, and id), but all other API on Locale will return only the OLD codes.
    Parameters:
    language - lowercase two-letter ISO-639 code.
    Throws:
    NullPointerException - thrown if argument is null.
    Since:
    1.4
    Method Detail
    getDefault
    public static Locale getDefault()Gets the current value of the default locale for this instance of the Java Virtual Machine.
    The Java Virtual Machine sets the default locale during startup based on the host environment. It is used by many locale-sensitive methods if no locale is explicitly specified. It can be changed using the setDefault method.
    Returns:
    the default locale for this instance of the Java Virtual Machine
    setDefault
    public static void setDefault(Locale newLocale)Sets the default locale for this instance of the Java Virtual Machine. This does not affect the host locale.
    If there is a security manager, its checkPermission method is called with a PropertyPermission("user.language", "write") permission before the default locale is changed.
    The Java Virtual Machine sets the default locale during startup based on the host environment. It is used by many locale-sensitive methods if no locale is explicitly specified.
    Since changing the default locale may affect many different areas of functionality, this method should only be used if the caller is prepared to reinitialize locale-sensitive code running within the same Java Virtual Machine, such as the user interface.
    Parameters:
    newLocale - the new default locale
    Throws:
    SecurityException - if a security manager exists and its checkPermission method doesn't allow the operation.
    NullPointerException - if newLocale is null
    See Also:
    SecurityManager.checkPermission(java.security.Permission), PropertyPermission
    getAvailableLocales
    public static Locale[] getAvailableLocales()Returns a list of all installed locales.
    getISOCountries
    public static String[] getISOCountries()Returns a list of all 2-letter country codes defined in ISO 3166. Can be used to create Locales.
    getISOLanguages
    public static String[] getISOLanguages()Returns a list of all 2-letter language codes defined in ISO 639. Can be used to create Locales. [NOTE: ISO 639 is not a stable standard-- some languages' codes have changed. The list this function returns includes both the new and the old codes for the languages whose codes have changed.]
    getLanguage
    public String getLanguage()Returns the language code for this locale, which will either be the empty string or a lowercase ISO 639 code.
    NOTE: ISO 639 is not a stable standard-- some languages' codes have changed. Locale's constructor recognizes both the new and the old codes for the languages whose codes have changed, but this function always returns the old code. If you want to check for a specific language whose code has changed, don't do
    if (locale.getLanguage().equals("he")
    Instead, do
    if (locale.getLanguage().equals(new Locale("he", "", "").getLanguage())
    See Also:
    getDisplayLanguage()
    getCountry
    public String getCountry()Returns the country/region code for this locale, which will either be the empty string or an upercase ISO 3166 2-letter code.
    See Also:
    getDisplayCountry()
    getVariant
    public String getVariant()Returns the variant code for this locale.
    See Also:
    getDisplayVariant()
    toString
    public final String toString()Getter for the programmatic name of the entire locale, with the language, country and variant separated by underbars. Language is always lower case, and country is always upper case. If the language is missing, the string will begin with an underbar. If both the language and country fields are missing, this function will return the empty string, even if the variant field is filled in (you can't have a locale with just a variant-- the variant must accompany a valid language or country code). Examples: "en", "de_DE", "_GB", "en_US_WIN", "de__POSIX", "fr__MAC"
    Overrides:
    toString in class Object
    Returns:
    a string representation of the object.
    See Also:
    getDisplayName()
    getISO3Language
    public String getISO3Language()
    throws MissingResourceExceptionReturns a three-letter abbreviation for this locale's language. If the locale doesn't specify a language, this will be the empty string. Otherwise, this will be a lowercase ISO 639-2/T language code. The ISO 639-2 language codes can be found on-line at ftp://dkuug.dk/i18n/iso-639-2.txt
    Throws:
    MissingResourceException - Throws MissingResourceException if the three-letter language abbreviation is not available for this locale.
    getISO3Country
    public String getISO3Country()
    throws MissingResourceExceptionReturns a three-letter abbreviation for this locale's country. If the locale doesn't specify a country, this will be tbe the empty string. Otherwise, this will be an uppercase ISO 3166 3-letter country code.
    Throws:
    MissingResourceException - Throws MissingResourceException if the three-letter country abbreviation is not available for this locale.
    getDisplayLanguage
    public final String getDisplayLanguage()Returns a name for the locale's language that is appropriate for display to the user. If possible, the name returned will be localized for the default locale. For example, if the locale is fr_FR and the default locale is en_US, getDisplayLanguage() will return "French"; if the locale is en_US and the default locale is fr_FR, getDisplayLanguage() will return "anglais". If the name returned cannot be localized for the default locale, (say, we don't have a Japanese name for Croatian), this function falls back on the English name, and uses the ISO code as a last-resort value. If the locale doesn't specify a language, this function returns the empty string.
    getDisplayLanguage
    public String getDisplayLanguage(Locale inLocale)Returns a name for the locale's language that is appropriate for display to the user. If possible, the name returned will be localized according to inLocale. For example, if the locale is fr_FR and inLocale is en_US, getDisplayLanguage() will return "French"; if the locale is en_US and inLocale is fr_FR, getDisplayLanguage() will return "anglais". If the name returned cannot be localized according to inLocale, (say, we don't have a Japanese name for Croatian), this function falls back on the default locale, on the English name, and finally on the ISO code as a last-resort value. If the locale doesn't specify a language, this function returns the empty string.
    getDisplayCountry
    public final String getDisplayCountry()Returns a name for the locale's country that is appropriate for display to the user. If possible, the name returned will be localized for the default locale. For example, if the locale is fr_FR and the default locale is en_US, getDisplayCountry() will return "France"; if the locale is en_US and the default locale is fr_FR, getDisplayLanguage() will return "Etats-Unis". If the name returned cannot be localized for the default locale, (say, we don't have a Japanese name for Croatia), this function falls back on the English name, and uses the ISO code as a last-resort value. If the locale doesn't specify a country, this function returns the empty string.
    getDisplayCountry
    public String getDisplayCountry(Locale inLocale)Returns a name for the locale's country that is appropriate for display to the user. If possible, the name returned will be localized according to inLocale. For example, if the locale is fr_FR and inLocale is en_US, getDisplayCountry() will return "France"; if the locale is en_US and inLocale is fr_FR, getDisplayLanguage() will return "Etats-Unis". If the name returned cannot be localized according to inLocale. (say, we don't have a Japanese name for Croatia), this function falls back on the default locale, on the English name, and finally on the ISO code as a last-resort value. If the locale doesn't specify a country, this function returns the empty string.
    getDisplayVariant
    public final String getDisplayVariant()Returns a name for the locale's variant code that is appropriate for display to the user. If possible, the name will be localized for the default locale. If the locale doesn't specify a variant code, this function returns the empty string.
    getDisplayVariant
    public String getDisplayVariant(Locale inLocale)Returns a name for the locale's variant code that is appropriate for display to the user. If possible, the name will be localized for inLocale. If the locale doesn't specify a variant code, this function returns the empty string.
    getDisplayName
    public final String getDisplayName()Returns a name for the locale that is appropriate for display to the user. This will be the values returned by getDisplayLanguage(), getDisplayCountry(), and getDisplayVariant() assembled into a single string. The display name will have one of the following forms:
    language (country, variant)
    language (country)
    language (variant)
    country (variant)
    language
    country
    variant
    depending on which fields are specified in the locale. If the language, country, and variant fields are all empty, this function returns the empty string.
    getDisplayName
    public String getDisplayName(Locale inLocale)Returns a name for the locale that is appropriate for display to the user. This will be the values returned by getDisplayLanguage(), getDisplayCountry(), and getDisplayVariant() assembled into a single string. The display name will have one of the following forms:
    language (country, variant)
    language (country)
    language (variant)
    country (variant)
    language
    country
    variant
    depending on which fields are specified in the locale. If the language, country, and variant fields are all empty, this function returns the empty string.
    clone
    public Object clone()Overrides Cloneable
    Overrides:
    clone in class Object
    Returns:
    a clone of this instance.
    See Also:
    Cloneable
    hashCode
    public int hashCode()Override hashCode. Since Locales are often used in hashtables, caches the value for speed.
    Overrides:
    hashCode in class Object
    Returns:
    a hash code value for this object.
    See Also:
    Object.equals(java.lang.Object), Hashtable
    equals
    public boolean equals(Object obj)Returns true if this Locale is equal to another object. A Locale is deemed equal to another Locale with identical language, country, and variant, and unequal to all other objects.
    Overrides:
    equals in class Object
    Parameters:
    obj - the reference object with which to compare.
    Returns:
    true if this Locale is equal to the specified object.
    See Also:
    Object.hashCode(), Hashtable
    Overview Package Class Use Tree Deprecated Index Help
    JavaTM 2 Platform
    Std. Ed. v1.4.2
    PREV CLASS NEXT CLASS FRAMES NO FRAMES
    SUMMARY: NESTED | FIELD | CONSTR | METHOD DETAIL: FIELD | CONSTR | METHOD
    Submit a bug or feature
    For further API reference and developer documentation, see Java 2 SDK SE Developer Documentation. That documentation contains more detailed, developer-targeted descriptions, with conceptual overviews, definitions of terms, workarounds, and working code examples.
    Copyright 2003 Sun Microsystems, Inc. All rights reserved. Use is subject to license terms. Also see the documentation redistribution policy.

    Was it really necessary to post the whole API description?!?
    Locale[] locales = Locale.ENGLISH();ENGLISH is not a method in class Locale, so do not add the braces "( );".
    Also, the constant ENGLISH is not an array, but just a single Locale object.
    You didn't say what your problem was. What do you want to achieve with your program and what is it that you don't understand?

  • Generating debug symbols from a source file in assembly

    Hi,
    I have a file written in the SPARC assembly language, which I can successfully assemble using the "as" command and produce an object file. However, the object file that it being produced does not have any debugging information in it. So when I link that object file into my program, I cannot debug that assembly code. (I don't need to be able to do full-fledged debugging, I would just like to know which lines in that assembly language file are being executed).
    My question is: how can I get the assembler to produce the object file with enough debugging information to do this. A MIPS assembler that I used before accepts a combination of options "ahls", which allows you to know the lines that are being executed in the assembly source file when you debug the program. The SPARC assembler does not appear to have such options.
    Do I need to extend the source file itself with additional information manually? Is there a manual that tells you how to do this?
    Any help would be appreciated.
    Thanks!

    Are you using dbx to debug your assembly code? dbx allows you to step through and view assembly instructions with the stepi, stopi, nexti, and listi commands.
    (dbx) listi
        2         print *, "Hello World"
    0x00011390: MAIN       :        save    %sp, -0x78, %sp
    0x00011394: MAIN+0x0004:        mov     0x8, %l0
    0x00011398: MAIN+0x0008:        st      %l0, [%fp - 0x18]
    0x0001139c: MAIN+0x000c:        sethi   %hi(0x21400), %l0
    0x000113a0: MAIN+0x0010:        or      %l0, 0x270, %l0
    0x000113a4: MAIN+0x0014:        st      %l0, [%fp - 0x14]
    0x000113a8: MAIN+0x0018:        add     %fp, -0x18, %l0
    0x000113ac: MAIN+0x001c:        call    __f90_sslw [PLT]
    0x000113b0: MAIN+0x0020:        mov     %l0, %o0
    0x000113b4: MAIN+0x0024:        add     %fp, -0x18, %l0
    0x000113b8: MAIN+0x0028:        sethi   %hi(0x11400), %l1
    0x000113bc: MAIN+0x002c:        or      %l1, 0x140, %l1
    0x000113c0: MAIN+0x0030:        mov     0xb, %l2
    0x000113c4: MAIN+0x0034:        mov     %l0, %o0
    0x000113c8: MAIN+0x0038:        mov     %l1, %o1
    0x000113cc: MAIN+0x003c:        call    __f90_slw_ch [PLT]
    0x000113d0: MAIN+0x0040:        mov     %l2, %o2
    0x000113d4: MAIN+0x0044:        add     %fp, -0x18, %l0
    0x000113d8: MAIN+0x0048:        call    __f90_eslw [PLT]
    0x000113dc: MAIN+0x004c:        mov     %l0, %o0
    0x000113e0: MAIN+0x0050:        ret    
    0x000113e4: MAIN+0x0054:        restore
        3         end(dbx) stopi at MAIN+0x001c
    (2) stopi at &MAIN+0x1c
    (dbx) run
    Running: main
    (process id 28657)
    stopped in MAIN at 0x113ac
    0x0001113ac: MAIN+0x001c: call __f90_sslw [PLT]
    (dbx) examine $fp
    0xffbfee48: 0x00000001
    (dbx) examine $l0
    0xffbfee30: 0x00000008
    Is this the sort of thing for which you are looking? If not, could you describe the specific capabilities you need?

Maybe you are looking for

  • Error while Refreshing Dashboard

    Hi Experts, I have created a Dashboard from a Webi report using Live Office... The reports consists of prompts for year which is bounded with an excel cell. Now in the Preview mode when i am trying to select another Year Value, The dashboard is showi

  • IE 10 in Captured OSD WIM will not launch on certain platforms

    All, I've been fighting this issue for a couple of months now. I have an active case that I've opened with Microsoft recently that I am still working on them with. For some background, I have a Windows 7 SP1 OS WIM that was built and captured via SCC

  • Installed 10.4.8 updater, now I can't start the computer

    I just ran the 10.4.8 updater through the auto software updater control panel. After the install/restart I shut down for the night. When I came back later to restart I got as far as the loading screen and it just stalled with the multicolor spinning

  • Office/word 2007

    Hi, My boss has started using office 2007 on his pc at work but my "word for mac" can't open the files he sends me. Is there an update or fix for this? Thanks!

  • HTTPS Email

    I have an ASA5505, ASA7.1(2), ASDM 7.1(3) which functions as the DHCP server on my mini-network.  I have a base computer with Windows 7 installed.  WIndows 2012R2 server resides in a VM and Windows 10 on another VM on this same base computer (VMWare)