VirtualBox

source: vbox/trunk/src/VBox/ValidationKit/bootsectors/bs3-cpu-basic-2-template.mac@ 93115

Last change on this file since 93115 was 93115, checked in by vboxsync, 3 years ago

scm --update-copyright-year

  • Property svn:eol-style set to native
  • Property svn:keywords set to Author Date Id Revision
File size: 16.2 KB
Line 
1; $Id: bs3-cpu-basic-2-template.mac 93115 2022-01-01 11:31:46Z vboxsync $
2;; @file
3; BS3Kit - bs3-cpu-basic-2 assembly template.
4;
5
6;
7; Copyright (C) 2007-2022 Oracle Corporation
8;
9; This file is part of VirtualBox Open Source Edition (OSE), as
10; available from http://www.virtualbox.org. This file is free software;
11; you can redistribute it and/or modify it under the terms of the GNU
12; General Public License (GPL) as published by the Free Software
13; Foundation, in version 2 as it comes in the "COPYING" file of the
14; VirtualBox OSE distribution. VirtualBox OSE is distributed in the
15; hope that it will be useful, but WITHOUT ANY WARRANTY of any kind.
16;
17; The contents of this file may alternatively be used under the terms
18; of the Common Development and Distribution License Version 1.0
19; (CDDL) only, as it comes in the "COPYING.CDDL" file of the
20; VirtualBox OSE distribution, in which case the provisions of the
21; CDDL are applicable instead of those of the GPL.
22;
23; You may elect to license modified versions of this file under the
24; terms and conditions of either the GPL or the CDDL or both.
25;
26
27
28;*********************************************************************************************************************************
29;* Header Files *
30;*********************************************************************************************************************************
31%include "bs3kit-template-header.mac" ; setup environment
32
33
34;*********************************************************************************************************************************
35;* Defined Constants And Macros *
36;*********************************************************************************************************************************
37%ifndef BS3_CPUBAS2_UD_OFF_DEFINED
38%define BS3_CPUBAS2_UD_OFF_DEFINED
39%macro BS3_CPUBAS2_UD_OFF 1
40BS3_GLOBAL_NAME_EX BS3_CMN_NM(%1) %+ _offUD, , 1
41 db BS3_CMN_NM(%1).again - BS3_CMN_NM(%1)
42%endmacro
43%endif
44
45
46;*********************************************************************************************************************************
47;* External Symbols *
48;*********************************************************************************************************************************
49TMPL_BEGIN_TEXT
50
51
52
53;
54; Test code snippets containing code which differs between 16-bit, 32-bit
55; and 64-bit CPUs modes.
56;
57%ifdef BS3_INSTANTIATING_CMN
58
59;
60; SIDT
61;
62BS3_CPUBAS2_UD_OFF bs3CpuBasic2_sidt_bx_ud2
63BS3_PROC_BEGIN_CMN bs3CpuBasic2_sidt_bx_ud2, BS3_PBC_NEAR
64 sidt [xBX]
65.again: ud2
66 jmp .again
67AssertCompile(.again - BS3_CMN_NM(bs3CpuBasic2_sidt_bx_ud2) == 3)
68BS3_PROC_END_CMN bs3CpuBasic2_sidt_bx_ud2
69
70BS3_CPUBAS2_UD_OFF bs3CpuBasic2_sidt_opsize_bx_ud2
71BS3_PROC_BEGIN_CMN bs3CpuBasic2_sidt_opsize_bx_ud2, BS3_PBC_NEAR
72 db X86_OP_PRF_SIZE_OP
73 sidt [xBX]
74.again: ud2
75 jmp .again
76AssertCompile(.again - BS3_CMN_NM(bs3CpuBasic2_sidt_opsize_bx_ud2) == 4)
77BS3_PROC_END_CMN bs3CpuBasic2_sidt_opsize_bx_ud2
78
79 %if TMPL_BITS == 64
80BS3_CPUBAS2_UD_OFF bs3CpuBasic2_sidt_rexw_bx_ud2
81BS3_PROC_BEGIN_CMN bs3CpuBasic2_sidt_rexw_bx_ud2, BS3_PBC_NEAR
82 db X86_OP_REX_W
83 sidt [xBX]
84.again: ud2
85 jmp .again
86AssertCompile(.again - BS3_CMN_NM(bs3CpuBasic2_sidt_rexw_bx_ud2) == 4)
87BS3_PROC_END_CMN bs3CpuBasic2_sidt_rexw_bx_ud2
88
89BS3_CPUBAS2_UD_OFF bs3CpuBasic2_sidt_opsize_rexw_bx_ud2
90BS3_PROC_BEGIN_CMN bs3CpuBasic2_sidt_opsize_rexw_bx_ud2, BS3_PBC_NEAR
91 db X86_OP_PRF_SIZE_OP
92 db X86_OP_REX_W
93 sidt [xBX]
94.again: ud2
95 jmp .again
96AssertCompile(.again - BS3_CMN_NM(bs3CpuBasic2_sidt_opsize_rexw_bx_ud2) == 5)
97BS3_PROC_END_CMN bs3CpuBasic2_sidt_opsize_rexw_bx_ud2
98 %endif
99
100 %if TMPL_BITS != 64
101BS3_CPUBAS2_UD_OFF bs3CpuBasic2_sidt_ss_bx_ud2
102BS3_PROC_BEGIN_CMN bs3CpuBasic2_sidt_ss_bx_ud2, BS3_PBC_NEAR
103 sidt [ss:xBX]
104.again: ud2
105 jmp .again
106AssertCompile(.again - BS3_CMN_NM(bs3CpuBasic2_sidt_ss_bx_ud2) == 4)
107BS3_PROC_END_CMN bs3CpuBasic2_sidt_ss_bx_ud2
108
109BS3_CPUBAS2_UD_OFF bs3CpuBasic2_sidt_opsize_ss_bx_ud2
110BS3_PROC_BEGIN_CMN bs3CpuBasic2_sidt_opsize_ss_bx_ud2, BS3_PBC_NEAR
111 db X86_OP_PRF_SIZE_OP
112 sidt [ss:xBX]
113.again: ud2
114 jmp .again
115AssertCompile(.again - BS3_CMN_NM(bs3CpuBasic2_sidt_opsize_ss_bx_ud2) == 5)
116BS3_PROC_END_CMN bs3CpuBasic2_sidt_opsize_ss_bx_ud2
117 %endif
118
119
120;
121; SGDT
122;
123BS3_CPUBAS2_UD_OFF bs3CpuBasic2_sgdt_bx_ud2
124BS3_PROC_BEGIN_CMN bs3CpuBasic2_sgdt_bx_ud2, BS3_PBC_NEAR
125 sgdt [xBX]
126.again: ud2
127 jmp .again
128AssertCompile(.again - BS3_CMN_NM(bs3CpuBasic2_sgdt_bx_ud2) == 3)
129BS3_PROC_END_CMN bs3CpuBasic2_sgdt_bx_ud2
130
131BS3_CPUBAS2_UD_OFF bs3CpuBasic2_sgdt_opsize_bx_ud2
132BS3_PROC_BEGIN_CMN bs3CpuBasic2_sgdt_opsize_bx_ud2, BS3_PBC_NEAR
133 db X86_OP_PRF_SIZE_OP
134 sgdt [xBX]
135.again: ud2
136 jmp .again
137AssertCompile(.again - BS3_CMN_NM(bs3CpuBasic2_sgdt_opsize_bx_ud2) == 4)
138BS3_PROC_END_CMN bs3CpuBasic2_sgdt_opsize_bx_ud2
139
140 %if TMPL_BITS == 64
141BS3_CPUBAS2_UD_OFF bs3CpuBasic2_sgdt_rexw_bx_ud2
142BS3_PROC_BEGIN_CMN bs3CpuBasic2_sgdt_rexw_bx_ud2, BS3_PBC_NEAR
143 db X86_OP_REX_W
144 sgdt [xBX]
145.again: ud2
146 jmp .again
147AssertCompile(.again - BS3_CMN_NM(bs3CpuBasic2_sgdt_rexw_bx_ud2) == 4)
148BS3_PROC_END_CMN bs3CpuBasic2_sgdt_rexw_bx_ud2
149
150BS3_CPUBAS2_UD_OFF bs3CpuBasic2_sgdt_opsize_rexw_bx_ud2
151BS3_PROC_BEGIN_CMN bs3CpuBasic2_sgdt_opsize_rexw_bx_ud2, BS3_PBC_NEAR
152 db X86_OP_PRF_SIZE_OP
153 db X86_OP_REX_W
154 sgdt [xBX]
155.again: ud2
156 jmp .again
157AssertCompile(.again - BS3_CMN_NM(bs3CpuBasic2_sgdt_opsize_rexw_bx_ud2) == 5)
158BS3_PROC_END_CMN bs3CpuBasic2_sgdt_opsize_rexw_bx_ud2
159 %endif
160
161 %if TMPL_BITS != 64
162BS3_CPUBAS2_UD_OFF bs3CpuBasic2_sgdt_ss_bx_ud2
163BS3_PROC_BEGIN_CMN bs3CpuBasic2_sgdt_ss_bx_ud2, BS3_PBC_NEAR
164 sgdt [ss:xBX]
165.again: ud2
166 jmp .again
167AssertCompile(.again - BS3_CMN_NM(bs3CpuBasic2_sgdt_ss_bx_ud2) == 4)
168BS3_PROC_END_CMN bs3CpuBasic2_sgdt_ss_bx_ud2
169
170BS3_CPUBAS2_UD_OFF bs3CpuBasic2_sgdt_opsize_ss_bx_ud2
171BS3_PROC_BEGIN_CMN bs3CpuBasic2_sgdt_opsize_ss_bx_ud2, BS3_PBC_NEAR
172 db X86_OP_PRF_SIZE_OP
173 sgdt [ss:xBX]
174.again: ud2
175 jmp .again
176AssertCompile(.again - BS3_CMN_NM(bs3CpuBasic2_sgdt_opsize_ss_bx_ud2) == 5)
177BS3_PROC_END_CMN bs3CpuBasic2_sgdt_opsize_ss_bx_ud2
178 %endif
179
180
181;
182; LIDT
183;
184BS3_CPUBAS2_UD_OFF bs3CpuBasic2_lidt_bx__sidt_es_di__lidt_es_si__ud2
185BS3_PROC_BEGIN_CMN bs3CpuBasic2_lidt_bx__sidt_es_di__lidt_es_si__ud2, BS3_PBC_NEAR
186 lidt [xBX]
187 sidt [BS3_NOT_64BIT(es:) xDI]
188 lidt [BS3_NOT_64BIT(es:) xSI]
189.again:
190 ud2
191 jmp .again
192AssertCompile(.again - BS3_CMN_NM(bs3CpuBasic2_lidt_bx__sidt_es_di__lidt_es_si__ud2) == BS3_IF_64BIT_OTHERWISE(9,11))
193BS3_PROC_END_CMN bs3CpuBasic2_lidt_bx__sidt_es_di__lidt_es_si__ud2
194
195BS3_CPUBAS2_UD_OFF bs3CpuBasic2_lidt_opsize_bx__sidt_es_di__lidt_es_si__ud2
196BS3_PROC_BEGIN_CMN bs3CpuBasic2_lidt_opsize_bx__sidt_es_di__lidt_es_si__ud2, BS3_PBC_NEAR
197 db X86_OP_PRF_SIZE_OP
198 lidt [xBX]
199 sidt [BS3_NOT_64BIT(es:) xDI]
200 lidt [BS3_NOT_64BIT(es:) xSI]
201.again:
202 ud2
203 jmp .again
204AssertCompile(.again - BS3_CMN_NM(bs3CpuBasic2_lidt_opsize_bx__sidt_es_di__lidt_es_si__ud2) == BS3_IF_64BIT_OTHERWISE(10,12))
205BS3_PROC_END_CMN bs3CpuBasic2_lidt_opsize_bx__sidt_es_di__lidt_es_si__ud2
206
207%if TMPL_BITS == 16
208BS3_CPUBAS2_UD_OFF bs3CpuBasic2_lidt_opsize_bx__sidt32_es_di__lidt_es_si__ud2
209BS3_PROC_BEGIN_CMN bs3CpuBasic2_lidt_opsize_bx__sidt32_es_di__lidt_es_si__ud2, BS3_PBC_NEAR
210 db X86_OP_PRF_SIZE_OP
211 lidt [xBX]
212 jmp dword BS3_SEL_R0_CS32:.in_32bit wrt FLAT
213 BS3_SET_BITS 32
214.in_32bit:
215 sidt [es:edi]
216 lidt [es:esi]
217 jmp dword BS3_SEL_R0_CS16:.again wrt CGROUP16
218 BS3_SET_BITS 16
219.again:
220 ud2
221 jmp .again
222AssertCompile(.again - BS3_CMN_NM(bs3CpuBasic2_lidt_opsize_bx__sidt32_es_di__lidt_es_si__ud2) == 27)
223BS3_PROC_END_CMN bs3CpuBasic2_lidt_opsize_bx__sidt32_es_di__lidt_es_si__ud2
224%endif
225
226 %if TMPL_BITS == 64
227BS3_CPUBAS2_UD_OFF bs3CpuBasic2_lidt_rexw_bx__sidt_es_di__lidt_es_si__ud2
228BS3_PROC_BEGIN_CMN bs3CpuBasic2_lidt_rexw_bx__sidt_es_di__lidt_es_si__ud2, BS3_PBC_NEAR
229 db X86_OP_REX_W
230 lidt [xBX]
231 sidt [xDI]
232 lidt [xSI]
233.again:
234 ud2
235 jmp .again
236AssertCompile(.again - BS3_CMN_NM(bs3CpuBasic2_lidt_rexw_bx__sidt_es_di__lidt_es_si__ud2) == 10)
237BS3_PROC_END_CMN bs3CpuBasic2_lidt_rexw_bx__sidt_es_di__lidt_es_si__ud2
238
239BS3_CPUBAS2_UD_OFF bs3CpuBasic2_lidt_opsize_rexw_bx__sidt_es_di__lidt_es_si__ud2
240BS3_PROC_BEGIN_CMN bs3CpuBasic2_lidt_opsize_rexw_bx__sidt_es_di__lidt_es_si__ud2, BS3_PBC_NEAR
241 db X86_OP_PRF_SIZE_OP
242 db X86_OP_REX_W
243 lidt [xBX]
244 sidt [xDI]
245 lidt [xSI]
246.again:
247 ud2
248 jmp .again
249AssertCompile(.again - BS3_CMN_NM(bs3CpuBasic2_lidt_opsize_rexw_bx__sidt_es_di__lidt_es_si__ud2) == 11)
250BS3_PROC_END_CMN bs3CpuBasic2_lidt_opsize_rexw_bx__sidt_es_di__lidt_es_si__ud2
251 %endif
252
253 %if TMPL_BITS != 64
254BS3_CPUBAS2_UD_OFF bs3CpuBasic2_lidt_ss_bx__sidt_es_di__lidt_es_si__ud2
255BS3_PROC_BEGIN_CMN bs3CpuBasic2_lidt_ss_bx__sidt_es_di__lidt_es_si__ud2, BS3_PBC_NEAR
256 lidt [ss:xBX]
257 sidt [BS3_NOT_64BIT(es:) xDI]
258 lidt [BS3_NOT_64BIT(es:) xSI]
259.again:
260 ud2
261 jmp .again
262AssertCompile(.again - BS3_CMN_NM(bs3CpuBasic2_lidt_ss_bx__sidt_es_di__lidt_es_si__ud2) == 12)
263BS3_PROC_END_CMN bs3CpuBasic2_lidt_ss_bx__sidt_es_di__lidt_es_si__ud2
264
265BS3_CPUBAS2_UD_OFF bs3CpuBasic2_lidt_opsize_ss_bx__sidt_es_di__lidt_es_si__ud2
266BS3_PROC_BEGIN_CMN bs3CpuBasic2_lidt_opsize_ss_bx__sidt_es_di__lidt_es_si__ud2, BS3_PBC_NEAR
267 db X86_OP_PRF_SIZE_OP
268 lidt [ss:xBX]
269 sidt [BS3_NOT_64BIT(es:) xDI]
270 lidt [BS3_NOT_64BIT(es:) xSI]
271.again:
272 ud2
273 jmp .again
274AssertCompile(.again - BS3_CMN_NM(bs3CpuBasic2_lidt_opsize_ss_bx__sidt_es_di__lidt_es_si__ud2) == 13)
275BS3_PROC_END_CMN bs3CpuBasic2_lidt_opsize_ss_bx__sidt_es_di__lidt_es_si__ud2
276 %endif
277
278
279;
280; LGDT
281;
282BS3_CPUBAS2_UD_OFF bs3CpuBasic2_lgdt_bx__sgdt_es_di__lgdt_es_si__ud2
283BS3_PROC_BEGIN_CMN bs3CpuBasic2_lgdt_bx__sgdt_es_di__lgdt_es_si__ud2, BS3_PBC_NEAR
284 lgdt [xBX]
285 sgdt [BS3_NOT_64BIT(es:) xDI]
286 lgdt [BS3_NOT_64BIT(es:) xSI]
287.again:
288 ud2
289 jmp .again
290AssertCompile(.again - BS3_CMN_NM(bs3CpuBasic2_lgdt_bx__sgdt_es_di__lgdt_es_si__ud2) == BS3_IF_64BIT_OTHERWISE(9,11))
291BS3_PROC_END_CMN bs3CpuBasic2_lgdt_bx__sgdt_es_di__lgdt_es_si__ud2
292
293BS3_CPUBAS2_UD_OFF bs3CpuBasic2_lgdt_opsize_bx__sgdt_es_di__lgdt_es_si__ud2
294BS3_PROC_BEGIN_CMN bs3CpuBasic2_lgdt_opsize_bx__sgdt_es_di__lgdt_es_si__ud2, BS3_PBC_NEAR
295 db X86_OP_PRF_SIZE_OP
296 lgdt [xBX]
297 sgdt [BS3_NOT_64BIT(es:) xDI]
298 lgdt [BS3_NOT_64BIT(es:) xSI]
299.again:
300 ud2
301 jmp .again
302AssertCompile(.again - BS3_CMN_NM(bs3CpuBasic2_lgdt_opsize_bx__sgdt_es_di__lgdt_es_si__ud2) == BS3_IF_64BIT_OTHERWISE(10,12))
303BS3_PROC_END_CMN bs3CpuBasic2_lgdt_opsize_bx__sgdt_es_di__lgdt_es_si__ud2
304
305 %if TMPL_BITS == 64
306BS3_CPUBAS2_UD_OFF bs3CpuBasic2_lgdt_rexw_bx__sgdt_es_di__lgdt_es_si__ud2
307BS3_PROC_BEGIN_CMN bs3CpuBasic2_lgdt_rexw_bx__sgdt_es_di__lgdt_es_si__ud2, BS3_PBC_NEAR
308 db X86_OP_REX_W
309 lgdt [xBX]
310 sgdt [xDI]
311 lgdt [xSI]
312.again:
313 ud2
314 jmp .again
315AssertCompile(.again - BS3_CMN_NM(bs3CpuBasic2_lgdt_rexw_bx__sgdt_es_di__lgdt_es_si__ud2) == 10)
316BS3_PROC_END_CMN bs3CpuBasic2_lgdt_rexw_bx__sgdt_es_di__lgdt_es_si__ud2
317
318BS3_CPUBAS2_UD_OFF bs3CpuBasic2_lgdt_opsize_rexw_bx__sgdt_es_di__lgdt_es_si__ud2
319BS3_PROC_BEGIN_CMN bs3CpuBasic2_lgdt_opsize_rexw_bx__sgdt_es_di__lgdt_es_si__ud2, BS3_PBC_NEAR
320 db X86_OP_PRF_SIZE_OP
321 db X86_OP_REX_W
322 lgdt [xBX]
323 sgdt [xDI]
324 lgdt [xSI]
325.again:
326 ud2
327 jmp .again
328AssertCompile(.again - BS3_CMN_NM(bs3CpuBasic2_lgdt_opsize_rexw_bx__sgdt_es_di__lgdt_es_si__ud2) == 11)
329BS3_PROC_END_CMN bs3CpuBasic2_lgdt_opsize_rexw_bx__sgdt_es_di__lgdt_es_si__ud2
330 %endif
331
332 %if TMPL_BITS != 64
333BS3_CPUBAS2_UD_OFF bs3CpuBasic2_lgdt_ss_bx__sgdt_es_di__lgdt_es_si__ud2
334BS3_PROC_BEGIN_CMN bs3CpuBasic2_lgdt_ss_bx__sgdt_es_di__lgdt_es_si__ud2, BS3_PBC_NEAR
335 lgdt [ss:xBX]
336 sgdt [BS3_NOT_64BIT(es:) xDI]
337 lgdt [BS3_NOT_64BIT(es:) xSI]
338.again:
339 ud2
340 jmp .again
341AssertCompile(.again - BS3_CMN_NM(bs3CpuBasic2_lgdt_ss_bx__sgdt_es_di__lgdt_es_si__ud2) == 12)
342BS3_PROC_END_CMN bs3CpuBasic2_lgdt_ss_bx__sgdt_es_di__lgdt_es_si__ud2
343
344BS3_CPUBAS2_UD_OFF bs3CpuBasic2_lgdt_opsize_ss_bx__sgdt_es_di__lgdt_es_si__ud2
345BS3_PROC_BEGIN_CMN bs3CpuBasic2_lgdt_opsize_ss_bx__sgdt_es_di__lgdt_es_si__ud2, BS3_PBC_NEAR
346 db X86_OP_PRF_SIZE_OP
347 lgdt [ss:xBX]
348 sgdt [BS3_NOT_64BIT(es:) xDI]
349 lgdt [BS3_NOT_64BIT(es:) xSI]
350.again:
351 ud2
352 jmp .again
353AssertCompile(.again - BS3_CMN_NM(bs3CpuBasic2_lgdt_opsize_ss_bx__sgdt_es_di__lgdt_es_si__ud2) == 13)
354BS3_PROC_END_CMN bs3CpuBasic2_lgdt_opsize_ss_bx__sgdt_es_di__lgdt_es_si__ud2
355 %endif
356
357;
358; #PF
359;
360
361; For testing read access.
362BS3_CPUBAS2_UD_OFF bs3CpuBasic2_mov_ax_ds_bx__ud2
363BS3_PROC_BEGIN_CMN bs3CpuBasic2_mov_ax_ds_bx__ud2, BS3_PBC_NEAR
364 mov xAX, [xBX]
365.again: ud2
366 jmp .again
367AssertCompile(.again - BS3_LAST_LABEL == 2 + (TMPL_BITS == 64))
368BS3_PROC_END_CMN bs3CpuBasic2_mov_ax_ds_bx__ud2
369
370
371; For testing write access.
372BS3_CPUBAS2_UD_OFF bs3CpuBasic2_mov_ds_bx_ax__ud2
373BS3_PROC_BEGIN_CMN bs3CpuBasic2_mov_ds_bx_ax__ud2, BS3_PBC_NEAR
374 mov [xBX], xAX
375.again: ud2
376 jmp .again
377AssertCompile(.again - BS3_LAST_LABEL == 2 + (TMPL_BITS == 64))
378BS3_PROC_END_CMN bs3CpuBasic2_mov_ds_bx_ax__ud2
379
380
381; For testing read+write access.
382BS3_CPUBAS2_UD_OFF bs3CpuBasic2_xchg_ds_bx_ax__ud2
383BS3_PROC_BEGIN_CMN bs3CpuBasic2_xchg_ds_bx_ax__ud2, BS3_PBC_NEAR
384 xchg [xBX], xAX
385.again: ud2
386 jmp .again
387AssertCompile(.again - BS3_LAST_LABEL == 2 + (TMPL_BITS == 64))
388BS3_PROC_END_CMN bs3CpuBasic2_xchg_ds_bx_ax__ud2
389
390
391; Another read+write access test.
392BS3_CPUBAS2_UD_OFF bs3CpuBasic2_cmpxchg_ds_bx_cx__ud2
393BS3_PROC_BEGIN_CMN bs3CpuBasic2_cmpxchg_ds_bx_cx__ud2, BS3_PBC_NEAR
394 cmpxchg [xBX], xCX
395.again: ud2
396 jmp .again
397AssertCompile(.again - BS3_LAST_LABEL == 3 + (TMPL_BITS == 64))
398BS3_PROC_END_CMN bs3CpuBasic2_cmpxchg_ds_bx_cx__ud2
399
400
401; For testing read access from an aborted instruction: DIV by zero
402BS3_CPUBAS2_UD_OFF bs3CpuBasic2_div_ds_bx__ud2
403BS3_PROC_BEGIN_CMN bs3CpuBasic2_div_ds_bx__ud2, BS3_PBC_NEAR
404 div xPRE [xBX]
405.again: ud2
406 jmp .again
407AssertCompile(.again - BS3_LAST_LABEL == 2 + (TMPL_BITS == 64))
408BS3_PROC_END_CMN bs3CpuBasic2_div_ds_bx__ud2
409
410
411; Two memory operands: push [mem]
412BS3_CPUBAS2_UD_OFF bs3CpuBasic2_push_ds_bx__ud2
413BS3_PROC_BEGIN_CMN bs3CpuBasic2_push_ds_bx__ud2, BS3_PBC_NEAR
414 push xPRE [xBX]
415.again: ud2
416 jmp .again
417AssertCompile(.again - BS3_LAST_LABEL == 2)
418BS3_PROC_END_CMN bs3CpuBasic2_push_ds_bx__ud2
419
420; Two memory operands: pop [mem]
421BS3_CPUBAS2_UD_OFF bs3CpuBasic2_push_ax__pop_ds_bx__ud2
422BS3_PROC_BEGIN_CMN bs3CpuBasic2_push_ax__pop_ds_bx__ud2, BS3_PBC_NEAR
423 push xAX
424 pop xPRE [xBX]
425.again: ud2
426 jmp .again
427AssertCompile(.again - BS3_LAST_LABEL == 3)
428BS3_PROC_END_CMN bs3CpuBasic2_push_ax__pop_ds_bx__ud2
429
430; Two memory operands: call [mem]
431BS3_CPUBAS2_UD_OFF bs3CpuBasic2_call_ds_bx__ud2
432BS3_PROC_BEGIN_CMN bs3CpuBasic2_call_ds_bx__ud2, BS3_PBC_NEAR
433 call xPRE [xBX]
434.again: ud2
435 jmp .again
436AssertCompile(.again - BS3_LAST_LABEL == 2)
437BS3_PROC_END_CMN bs3CpuBasic2_call_ds_bx__ud2
438
439; For testing #GP vs #PF write
440BS3_CPUBAS2_UD_OFF bs3CpuBasic2_insb__ud2
441BS3_PROC_BEGIN_CMN bs3CpuBasic2_insb__ud2, BS3_PBC_NEAR
442 insb
443.again: ud2
444 jmp .again
445AssertCompile(.again - BS3_LAST_LABEL == 1)
446BS3_PROC_END_CMN bs3CpuBasic2_insb__ud2
447
448
449%endif ; BS3_INSTANTIATING_CMN
450
451%include "bs3kit-template-footer.mac" ; reset environment
452
Note: See TracBrowser for help on using the repository browser.

© 2024 Oracle Support Privacy / Do Not Sell My Info Terms of Use Trademark Policy Automated Access Etiquette