initial commit: a mess of assembly code
[fmap.git] / x86_64_sse2_x87 / fasm / examples / x86 / include / p5.inc
blobf6fff0eef812cfe63049141d385937c620aef4fe
1 \r
2 calminstruction element? definition\r
3         local   name, meta\r
4         match   =tr? any, definition\r
5         jyes    skip\r
6         arrange definition, =element? definition\r
7         assemble definition\r
8     skip:\r
9 end calminstruction\r
11 include '80486.inc'\r
13 purge element?\r
15 iterate <instr,opcode>, wrmsr,<0Fh,30h>, rdtsc,<0Fh,31h>, rdmsr,<0Fh,32h>, rdpmc,<0Fh,33h>, cpuid,<0Fh,0A2h>, rsm,<0Fh,0AAh>\r
17         define x86.instr? db opcode\r
19         calminstruction instr?\r
20                 assemble x86.instr?\r
21         end calminstruction\r
23 end iterate\r
25 calminstruction cmpxchg8b? dest*\r
26         asmcmd  =x86.=parse_operand =@dest,dest\r
27         check   @dest.type = 'mem'\r
28         jyes    operand_ok\r
29         asmcmd  =err 'invalid operand'\r
30         exit\r
31     operand_ok:\r
32         check   @dest.size and not 8\r
33         jno     size_ok\r
34         asmcmd  =err 'invalid operand size'\r
35     size_ok:\r
36         asmcmd  =x86.=store_instruction <0Fh,0C7h>,=@dest,1\r
37 end calminstruction\r
39 include '80387.inc'\r