2 ms·
I remember learning in school that it's a relatively simple stack machine, but when I look at the instruction set online it's actually ~200 opcodes.. Not what
by geokon 2y ago
I remember learning in school that it's a relatively simple stack machine, but when I look at the instruction set online it's actually ~200 opcodes..
Not what I'd describe as "simple, straightforward"
- renewedrebecca 2y agoThat's fewer opcodes than a 6502 or Z80 microprocessor.
- DonHopkins 2y agoIn the 6502 and Z80, "opcode" refers to the actual machine instruction executed by the CPU, represented by mnemonics (e.g., LDA, STA). Each mnemonic can map to multiple opcode values due to different addressing modes. The 6502 has 56 mnemonics, mapping to about 151 unique opcodes. The Z80 has about 80 distinct mnemonics, mapping to about 158 base opcodes, with extended opcodes (via CB, ED, DD, FD prefixes) pushing the total to around 500. Java bytecode opcodes are symbolic instructions for a virtual stack machine, about 200 in total with a 1:1 mapping from mnemonic to opcode, and just an "wide" extended prefix to extend operand sizes, designed for portability rather than direct hardware execution.