flat assembler
Message board for the users of flat assembler.
Index
> Non-x86 architectures > x86 RCL 8 Bit command in ARM (Thumb) |
Author |
|
revolution 01 Sep 2020, 08:04
You are correct. There are no native 8-bit ARM rotates with carry (RCL equivalent, which makes it a 9-bit shift actually).
If you need an exact equivalent then you have to manually construct it. You can rotate left by rotating right the inverse amount with ROR. The most troubling part will be to reduce the shift modulo 9 (not 8) unless you know your shift value is already <9. |
|||
01 Sep 2020, 08:04 |
|
Kuemmel 01 Sep 2020, 08:14
Ok! Meanwhile I got the idea to check the source of DOSBox...that acutally looks troublesome in the sense of sizecoding I wonder what the compiler output is when assembling to ARM or Thumb.
Code: #define RCLB(op1,op2,load,save) if (op2%9) { LoadZF;LoadSF;LoadAF; Bit8u cf=get_CF(); flags.var1.b=load(op1); flags.var2.b=op2%9; flags.type=t_RCLb; flags.result.b=(flags.var1.b << flags.var2.b) | (cf << (flags.var2.b-1)) | (flags.var1.b >> (9-flags.var2.b)); SETFLAGBIT(CF,((flags.var1.b >> (8-flags.var2.b)) & 1)); SETFLAGBIT(OF,(flags.var1.b ^ flags.result.b) & 0x80); save(op1,flags.result.b); } |
|||
01 Sep 2020, 08:14 |
|
< Last Thread | Next Thread > |
Forum Rules:
|
Copyright © 1999-2024, Tomasz Grysztar. Also on GitHub, YouTube.
Website powered by rwasa.