0

I understand this may sounds like an googleable answer. However, I have looked around on internet and still cant get an satisfied answer

I know both are Intermediate language and it is the code between source code and machine code.

bytecode is generated by compiler and it is more often used in Java context before getting into machine code.

assembly code is also the code before machine code.

My question is that before getting into machine code, both are the last step to go into machine code. So what is the difference between them?

Wai Ha Lee
  • 8,598
  • 83
  • 57
  • 92
jason
  • 133
  • 2
  • 8

2 Answers2

0

I think difference is only in the platform-specific terminology. We use Assembly code for .NET and byte code for Java.

Jeremy Caney
  • 7,102
  • 69
  • 48
  • 77
  • 1
    This is incorrect. See, e.g. [What is the difference between assembly code and bytecode?](https://stackoverflow.com/q/1782415/1364007) – Wai Ha Lee Dec 07 '20 at 08:57
  • 1
    Also, .NET uses bytecode too (it's called CIL) - see, e.g. [Common Intermediate Language](https://en.wikipedia.org/wiki/Common_Intermediate_Language). – Wai Ha Lee Dec 07 '20 at 08:59
0

Assembly is a programming language. It's a human readable form of machine code.

Byte code is machine code for a virtual machine. It needs to be translated from that virtual machine to the actual machine it's running on. Byte code could also be represented in an assembly syntax for that virtual machine.

Andrei Tătar
  • 7,872
  • 19
  • 37
  • Yes, that's why I felt confused. When I look up some example of byte code, some are in the representation of B3 01 A7 03 .... things like that, it seems content of .class is nothing like human readable language However, when i look up with example of assembly code, it give me things like jum mov add (things like that). Do you mean byte code could also be represented in this way? – jason Dec 07 '20 at 09:24
  • 1
    Byte code can be represented as human readable assembly language but I guess you wouldn't call it byte code anymore. – Andrei Tătar Dec 07 '20 at 10:28
  • 2
    @jason any way you print it is a representation. B3 01 A7 03 is a hexadecimal representation. Assembly language is a different representation. 10110011000000011010011100000011 is a binary representation. There is no natural representation for bytecode as byte code is just a sequence of bytes, in RAM, on hard drive, or on SSD. – Holger Dec 07 '20 at 13:56