flat assembler
Message board for the users of flat assembler.
Index
> Macroinstructions > Macros to choose target CPU Goto page Previous 1, 2, 3 Next |
Author |
|
LocoDelAssembly 10 Apr 2007, 11:38
Another idea is forgetting ".cpu" at all:
Code: i8086 equ 16bit_real i80286 equ i8086 16bit_prot . . . ; User code .enable Pentium4 EM64T LahfSahf |
|||
10 Apr 2007, 11:38 |
|
Hayden 10 Apr 2007, 15:37
A #UD exemption handler would be nice. One that emulates invalid intructions. Although you would have to be totaly insane to dedicate enough time to code it.
|
|||
10 Apr 2007, 15:37 |
|
revolution 10 Apr 2007, 23:15
Hayden wrote: A #UD exemption handler would be nice. One that emulates invalid intructions. Although you would have to be totaly insane to dedicate enough time to code it. However, that is not what these macros are intended to do, they are meant to stop the programmer accidentally using an instruction that is non-existent on the target CPU. Much different from using exception handlers and emulation code. Another problem with exception handling is that it is OS specific. |
|||
10 Apr 2007, 23:15 |
|
asmfan 21 Jul 2007, 07:54
whoa!!! revolution, thank you very much! nice macroses, didn't know they are developed so far... VERY handy and useful.
_________________ Any offers? |
|||
21 Jul 2007, 07:54 |
|
revolution 21 Jul 2007, 09:45
asmfan, You are very welcome, it is nice to get feedback like that, makes me (and all of us, right?) want to contribute more.
|
|||
21 Jul 2007, 09:45 |
|
MCD 29 Oct 2007, 12:08
LocoDelAssembly wrote: http://board.flatassembler.net/topic.php?t=4267 This is bad, because most users (including companies) that need good price/quality CPUs prefer AMD CPUs. This is especially the case here where I live. Also, for most AMD CPUs up to quiet recently, MMX, 3DNow! and 3DNow extended instructions are more optimized than the SSE instructions, thus simple MMX/3DNow! code may actually run faster than SSE code! This is especially true for the K6, K6-2, K6-3, Athlon, Athlon XP and some older Athlon64. _________________ MCD - the inevitable return of the Mad Computer Doggy -||__/ .|+-~ .|| || |
|||
29 Oct 2007, 12:08 |
|
revolution 08 Nov 2007, 04:17
MCD wrote: This is bad ... <snip other irrelevant text> |
|||
08 Nov 2007, 04:17 |
|
windwakr 01 Aug 2008, 17:05
Where are the macros???
|
|||
01 Aug 2008, 17:05 |
|
Madis731 01 Aug 2008, 17:19
|
|||
01 Aug 2008, 17:19 |
|
revolution 14 Aug 2008, 21:24
windwakr wrote: Where are the macros??? I think the file was deleted due to the hacker incident or the forum upgrade vulnerabilities, not sure which. But if you spot any more missing file from my posts please let me know and I'll upload them again. |
|||
14 Aug 2008, 21:24 |
|
revolution 05 Mar 2009, 05:46
LocoDelAssembly wrote:
I also intend to upgrade fasmarm for similar functionality, but I will do it in the core assembly code in fasmarm (not with macros as I do for x86). Some things that still need ironing out is the progressive instruction layers like SSE then SSE2 etc. It wouldn't make sense to enable SSE2 but disable SSE. So a feature list like the above will need some way of distinguishing that and force certain lower layers enabled if higher layers are selected. |
|||
05 Mar 2009, 05:46 |
|
Tomasz Grysztar 05 Mar 2009, 08:14
Note, that with TASM (and the macros for 8086 I once used, which were made to simulate TASM's behavior) the .8086 setting didn't disallow instructions like "shl reg,count" with count>1, it was just converting them into multiple "shl reg,1" copies. Well, I think that was a nice idea, as it allowed to re-assemble the same code for lower CPU - however it's up to you.
|
|||
05 Mar 2009, 08:14 |
|
revolution 05 Mar 2009, 08:36
Code: .8086 irp instr,sar,sal,rcl,rcr,shr,shl,ror,rol { macro instr val,cnt \{ times cnt: instr val,1\} } |
|||
05 Mar 2009, 08:36 |
|
revolution 05 Mar 2009, 08:56
Hmm:
Code: ror ax,-1 |
|||
05 Mar 2009, 08:56 |
|
asmfan 05 Mar 2009, 15:24
intel's pseudo code for this:
Quote:
does eqtype can handle different sizes of register? |
|||
05 Mar 2009, 15:24 |
|
revolution 05 Mar 2009, 15:35
Intel's pseudo code doesn't apply to the 8086.
|
|||
05 Mar 2009, 15:35 |
|
rugxulo 09 Mar 2009, 00:58
Quote:
Wait, what about 80186 and 80188?? (I read today that no IBM PC ever used one, but they were still used in various machines, e.g. HPLX200 ??) EDIT: Wait, your old COMPATIBILITY.INC (April 8, 2007) has .186 and .186f, I suspected you didn't overlook it. P.S. Just to reply to this ... Quote:
It wasn't until the Athlon XP that SSE1 was even fully supported. All Athlon64s support SSE2, though. Original 3dnow! seems to have debuted on K6-2 and Extended 3dnow! debuted in Athlon. No MMXext on either K6-2+ or K6-III+, apparently. (Corrections welcome if that's somehow incorrect.) |
|||
09 Mar 2009, 00:58 |
|
revolution 09 Mar 2009, 01:13
The 186 is still active in many embedded products.
Anyone who is involved with embedded programming will know how tempting it is to write instructions that don't exist in their CPU. |
|||
09 Mar 2009, 01:13 |
|
revolution 12 Mar 2009, 03:14
Sorry to keep resurrecting this old thread.
I think a nice way to handle it without too much complication is to use a keyword "features" Code: features SSE, SSE2, SSE3, SSSE3, SSE4, FPU, FPU287, VMX, SVM, ... The reason I chose the "features" keyword is that many manuals and discussions talk about having certain features available, also it is short (8 chars) so can be put into the code tables (for the ARM version) easily. The last part with predefined CPU names (.8086, .80186, etc.) I think should be done with macros (thinking about the ARM version here, obviously the x86 version is all macros). There are just so many different combinations around. Between Intel, AMD, VIA, NEC, HARRIS and others there are a myriad of options. And it seems to me to be unnecessary to define them all. It just adds bloat for no good reason. Once the most common CPUs are defined with the macros then anything special can be added by the user later if needed. Plus it makes a nice demarcation line between the two sets. Easier to upgrade for new chips in the future. Last edited by revolution on 13 Mar 2009, 00:05; edited 1 time in total |
|||
12 Mar 2009, 03:14 |
|
Goto page Previous 1, 2, 3 Next < Last Thread | Next Thread > |
Forum Rules:
|
Copyright © 1999-2024, Tomasz Grysztar. Also on GitHub, YouTube.
Website powered by rwasa.