flat assembler
Message board for the users of flat assembler.
Index
> Compiler Internals > ror in FASM? |
Author |
|
LocoDelAssembly 03 Mar 2009, 00:08
Quote:
But it is not, fasm doesn't support such operation on expressions, it is only allowed as a CPU instruction. |
|||
03 Mar 2009, 00:08 |
|
Azu 03 Mar 2009, 00:10
LocoDelAssembly wrote:
So is it a bug that it works for shr.. or is it a bug that it doesn't work for ror? Either way is bug. |
|||
03 Mar 2009, 00:10 |
|
LocoDelAssembly 03 Mar 2009, 00:38
The shr and shl, apart of being CPU instructions are also operations allowed on expressions.
TFM brilliantly says wrote: 1.2.4 Numerical expressions http://flatassembler.net/docs.php?article=manual#1.2.4 |
|||
03 Mar 2009, 00:38 |
|
Azu 03 Mar 2009, 00:52
LocoDelAssembly wrote: The shr and shl, apart of being CPU instructions are also operations allowed on expressions. Thanks. Can you please tell me where shl and shr are handled (like what file and line number? I can't find them)? I will just add ror/rol support myself. It shouldn't take more then a simple copy/paste and then replacing sh with ro. Edit: nevermind found it myself. Was easier then I thought. |
|||
03 Mar 2009, 00:52 |
|
LocoDelAssembly 03 Mar 2009, 01:14
I'm not an expert on the matter but I'll try to give you some pointers.
First, you will probably have to add the new ops in TABLES.INC below "operators:". Then change on PARSER.INC the proc get_operator. Finally do the appropriate changes on calculate_expression at EXPRESSI.INC. However, note that ROR and ROL can be build as a series of SHR/SHL, AND and OR, so before going so far consider if it really worth it considering you can replicate functionality with existing features. |
|||
03 Mar 2009, 01:14 |
|
revolution 03 Mar 2009, 02:40
|
|||
03 Mar 2009, 02:40 |
|
DOS386 08 Feb 2013, 10:09
BUMP (4 years later)
Would it be possible to add ROL and ROR into FASM? I miss them. (10 years old patches are no longer that useful) Code: mov ax, $CD SHL 3 ; mov ax, $CD ROL 3 ; !!! BUGGED !!! mov ax, $CD MOD 3 > However, note that ROR and ROL can be build > as a series of SHR/SHL, AND and OR True, but with same "right" you could delete many other operators too. #undef MOD |
|||
08 Feb 2013, 10:09 |
|
Tomasz Grysztar 08 Feb 2013, 11:50
DOS386 wrote: Would it be possible to add ROL and ROR into FASM? I miss them. MCD brought up what the problem is. I never got an idea for a nice solution (though I must confess that I did not put much effort into trying), but maybe you would propose something. |
|||
08 Feb 2013, 11:50 |
|
DOS386 08 Feb 2013, 12:46
Tomasz Grysztar wrote: revive the discussion, I suggest to continue from this point Thanks ... it's the size problem and the infamous "infinite precision". I'd be happy with ROL8 ROR8 ROL32 ROR32 as I don't have any better idea for now, and so far dealt with 8-bit and 32-bit ROL'ling stuff only. Same for B.S.WAP: either make it 32-bit only, or make BSWAP32 and BSWAP64. BSWAP16 could be replaced by ROL16 (considering that CPU's don't support BSWAP16 at all ) |
|||
08 Feb 2013, 12:46 |
|
revolution 08 Feb 2013, 12:52
DOS386 wrote: (considering that CPU's don't support BSWAP16 at all ) Code: xchg ah,al ;bswap16 ax |
|||
08 Feb 2013, 12:52 |
|
< Last Thread | Next Thread > |
Forum Rules:
|
Copyright © 1999-2024, Tomasz Grysztar. Also on GitHub, YouTube.
Website powered by rwasa.