3 ms·
ARM has actually a lot more modularity in its opcodes, in particular it has a whole bunch of different addressing modes for its ALU operands (register and regis
by simias 10y ago
ARM has actually a lot more modularity in its opcodes, in particular it has a whole bunch of different addressing modes for its ALU operands (register and register, register and immediate, register shifted by a register, register shifted by an immediate, register rotated by a register, etc...).
There's also the "flag set" bit which says if the instruction is supposed to update the CPSR status flags or not. And then there's the conditional execution flags I talked in my previous post.
So with all these combinations you can easily end up with hundreds of possible encodings for an "add" mnemonic.
And you have similar shenanigans for memory access instructions (load word, load word and increment after, load word and increment before, load word and increment before, load byte and sign extend...)
So you'll probably end up using a combination of multiple LUTs and a bit of code to put it all together.
- bogomipz 10y agoSo its sound like the addressing modes on the ARM are as varied at x86 then?
- simias 10y agoThat's very much possible, but I'll admit that I never really looked very closely at the x86 instruction encoding, mainly because I value my sanity. Good thing I mostly work with ARM environments these days...
- bogomipz 10y agoCan I ask what you develop? I'm also curious how long it took you to be comfortable developing on ARM?
- simias 10y agoEmbedded development, which nowadays is synonymous with ARM. But my knowledge of the instruction encoding comes mainly from writing this pocketstation emulator: https://github.com/simias/pockystation/ https://github.com/simias/pockystation/ It's not complete yet unfortunately, I'll have to get back to that.