• Post Reply Bookmark Topic Watch Topic
  • New Topic

Bytecode into my code?  RSS feed

 
blingo james
Greenhorn
Posts: 25
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hello,
Can I write ByteCode directly inside my code?
(like I can write assembly into C...)
 
Henry Wong
author
Sheriff
Posts: 23295
125
C++ Chrome Eclipse IDE Firefox Browser Java jQuery Linux VI Editor Windows
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Well, there is a Java assembler, if you want to code directly in bytecodes. This is probably the closest that you can get. There isn't anything equivalent to the ASM PRAGMA in C, which allows you to embed assembly directly into C code.

Henry
 
Henry Wong
author
Sheriff
Posts: 23295
125
C++ Chrome Eclipse IDE Firefox Browser Java jQuery Linux VI Editor Windows
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Oh, I forgot to mention... if you are considering programming directly in bytecodes, you will have to contend with the bytecode verifier.

The bytecode verifier checks all bytecodes to make sure that it doesn't break security, or cause the JVM to eventually crash. This means that many tricks used by assembly developers, such as self modifying code, stack tricks, etc. etc. can't be done.

Henry
 
blingo james
Greenhorn
Posts: 25
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Cool, thanks.
 
Martijn Verburg
author
Bartender
Posts: 3275
5
Eclipse IDE Java Mac OS X
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I'm not sure if I'd get 100% agreement from the Ranch community, but I think this is a pretty Advanced concept
 
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!