Results 1 to 10 of 10

Thread: Java to Assembly

  1. #1

    Thread Starter
    Addicted Member MethadoneBoy's Avatar
    Join Date
    Oct 2001
    Location
    Preferably somewhere between Keira Knightley and Diane Kruger but I'm not fussy
    Posts
    180

    Java to Assembly

    Hi

    Does anyone know how to convert this command into Assembly Language (namely the Motorola 68K)?

    public static int MOVEL(int A, int B) throws IOException {

    int SRC = A;
    int DST = B;

    DST = SRC;
    return DST;

    }

  2. #2
    Retired VBF Adm1nistrator plenderj's Avatar
    Join Date
    Jan 2001
    Location
    Dublin, Ireland
    Posts
    10,359
    Try posting in the assembly forum too....

    But anyway, I dont think swapping 2 ints would cause an exception.... and your code is bull**** anyway ...


    But regarding the assembly, well I think that you could put in a label, and then it just swaps the D0 and D1 registers or something. Then just do BRA into another label.
    Or the user could have to put the next instruction address into A0.
    Then you could do :

    BRA A0

    ... or something...
    Microsoft MVP : Visual Developer - Visual Basic [2004-2005]

  3. #3
    Dazed Member
    Join Date
    Oct 1999
    Location
    Ridgefield Park, NJ
    Posts
    3,418
    Yes i would post this in the Assembly formn. Maybe DarkKnight
    or someone else will be able to answer your question.

    Im still trying to find out if i can run ASM from a java application. Assembly cant be run inline with java but using the JNI (Java native interface) maybe i can work my way around it.

    Hey why are you programing for a Motorola processor? Im just curious. Is the instruction set better?


    Thanks

  4. #4
    Addicted Member Mrs Kensington's Avatar
    Join Date
    Sep 2001
    Location
    Dorset, UK
    Posts
    144
    I didn't think it was possible to stick ASM into Java, at least not without loosing portablility. An instruction set is just for that processor, you write some assembly on a IBM PC and try and run it on a Mac, naturally it wont work!
    So wouldn't using ASM in java completely destroy the point of using Java?

    please tell me if i'm wrong!

  5. #5
    Retired VBF Adm1nistrator plenderj's Avatar
    Join Date
    Jan 2001
    Location
    Dublin, Ireland
    Posts
    10,359
    What bob's trying to do is write an application to convert java source code into M68K ASM.

    And yeah the M68K Instruction set is so much sexier than the x86 instruction set. Its really easy to use
    8 Data registers D0 to D7, 7 Address Registers A0 to A6... ahh x86 ASM just doesnt compare
    Microsoft MVP : Visual Developer - Visual Basic [2004-2005]

  6. #6
    Dazed Member
    Join Date
    Oct 1999
    Location
    Ridgefield Park, NJ
    Posts
    3,418
    mmmmmmm interesting. thanks for the information! Ive been looking a assembly code and ive see lots of examples for diffrent processors. x86, Sparc, Motorola ect........

  7. #7
    Retired VBF Adm1nistrator plenderj's Avatar
    Join Date
    Jan 2001
    Location
    Dublin, Ireland
    Posts
    10,359
    Course I can solve the problem
    Microsoft MVP : Visual Developer - Visual Basic [2004-2005]

  8. #8

    Thread Starter
    Addicted Member MethadoneBoy's Avatar
    Join Date
    Oct 2001
    Location
    Preferably somewhere between Keira Knightley and Diane Kruger but I'm not fussy
    Posts
    180

    Smile

    By all means...

  9. #9
    Retired VBF Adm1nistrator plenderj's Avatar
    Join Date
    Jan 2001
    Location
    Dublin, Ireland
    Posts
    10,359
    Right then I'll ****ing do it tonight!
    Not that the above code actually does anything of any use...
    Microsoft MVP : Visual Developer - Visual Basic [2004-2005]

  10. #10

    Thread Starter
    Addicted Member MethadoneBoy's Avatar
    Join Date
    Oct 2001
    Location
    Preferably somewhere between Keira Knightley and Diane Kruger but I'm not fussy
    Posts
    180
    You're too kind. No, really.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  



Click Here to Expand Forum to Full Width