1 ;;;;------------------------------------------------------------------
3 ;;;; Copyright (C) 20012000,
4 ;;;; Department of Computer Science, University of Tromso, Norway
6 ;;;; Filename: ia-x86-instr-push-pop.lisp
7 ;;;; Description: Stack instructions.
8 ;;;; Author: Frode Vatvedt Fjeld <frodef@acm.org>
9 ;;;; Created at: Mon Jan 31 20:28:50 2000
10 ;;;; Distribution: See the accompanying file COPYING.
12 ;;;; $Id: instr-push-pop.lisp,v 1.2 2004/01/16 11:54:14 ffjeld Exp $
14 ;;;;------------------------------------------------------------------
16 (in-package "IA-X86-INSTR")
18 ;;; ----------------------------------------------------------------
19 ;;; PUSH [IISR page 11-317]
20 ;;; ----------------------------------------------------------------
22 (def-instr push
(instruction))
24 (def-instr pushw
(push)
25 (:digit
(#xff
6) 0 (r/m16
) :operand-mode
:16-bit
)
26 (:+ #x50
0 (+r16
) :operand-mode
:16-bit
)
27 (:plain
#x6a
(0 1) (simm8) :operand-mode
:16-bit
)
28 (:plain
#x68
(0 2) (imm16) :operand-mode
:16-bit
)
29 (:plain
#x0e
(0 0) (cs) :operand-mode
:16-bit
)
30 (:plain
#x16
(0 0) (ss) :operand-mode
:16-bit
)
31 (:plain
#x1e
(0 0) (ds) :operand-mode
:16-bit
)
32 (:plain
#x06
(0 0) (es) :operand-mode
:16-bit
)
33 (:plain
#c
(#x0fa0
2) (0 0) (fs) :operand-mode
:16-bit
)
34 (:plain
#c
(#x0fa8
2) (0 0) (gs) :operand-mode
:16-bit
))
36 (def-instr pushl
(push)
37 (:digit
(#xff
6) 0 (r/m32
) :operand-mode
:32-bit
)
38 (:+ #x50
0 (+r32
) :operand-mode
:32-bit
)
39 (:plain
#x6a
(0 1) (simm8) :operand-mode
:32-bit
)
40 (:plain
#x68
(0 4) (imm32) :operand-mode
:32-bit
)
42 (:plain
#x0e
(0 0) (cs) :operand-mode
:32-bit
)
43 (:plain
#x16
(0 0) (ss) :operand-mode
:32-bit
)
44 (:plain
#x1e
(0 0) (ds) :operand-mode
:32-bit
)
45 (:plain
#x06
(0 0) (es) :operand-mode
:32-bit
)
46 (:plain
#c
(#x0fa0
2) (0 0) (fs) :operand-mode
:32-bit
)
47 (:plain
#c
(#x0fa8
2) (0 0) (gs) :operand-mode
:32-bit
))
51 (def-instr pusha
(instruction))
52 (def-instr pushaw
(pusha) (:simple
#x60
:operand-mode
:16-bit
))
53 (def-instr pushal
(pusha) (:simple
#x60
:operand-mode
:32-bit
))
57 (def-instr pushf
(instruction))
58 (def-instr pushfw
(pushf) (:simple
#x9C
:operand-mode
:16-bit
))
59 (def-instr pushfl
(pushf) (:simple
#x9C
:operand-mode
:32-bit
))
61 ;;; ----------------------------------------------------------------
62 ;;; POP [IISR page 11-308]
63 ;;; ----------------------------------------------------------------
65 ;;; These top two are described as format /digit in IISR, but in
66 ;;; practice it seems that the reg/opcode field is simply
67 ;;; ignored/redundant.
69 (def-instr pop
(instruction))
72 (:r
#x8f
(r/m16
) :operand-mode
:16-bit
)
73 (:+ #x58
0 (+r16
) :operand-mode
:16-bit
)
74 (:plain
#x1f
(0 0) (ds) :operand-mode
:16-bit
)
75 (:plain
#x07
(0 0) (es) :operand-mode
:16-bit
)
76 (:plain
#x17
(0 0) (ss) :operand-mode
:16-bit
)
77 (:plain
#c
(#x0fa1
2) (0 0) (fs) :operand-mode
:16-bit
)
78 (:plain
#c
(#x0fa9
2) (0 0) (gs) :operand-mode
:16-bit
))
81 (:r
#x8f
(r/m32
) :operand-mode
:32-bit
)
82 (:+ #x58
0 (+r32
) :operand-mode
:32-bit
)
83 (:plain
#x1f
(0 0) (ds) :operand-mode
:32-bit
)
84 (:plain
#x07
(0 0) (es) :operand-mode
:32-bit
)
85 (:plain
#x17
(0 0) (ss) :operand-mode
:32-bit
)
86 (:plain
#c
(#x0fa1
2) (0 0) (fs) :operand-mode
:32-bit
)
87 (:plain
#c
(#x0fa9
2) (0 0) (gs) :operand-mode
:32-bit
))
89 ;;; ----------------------------------------------------------------
90 ;;; POPA [IISR page 11-312]
91 ;;; ----------------------------------------------------------------
93 (def-instr popa
(instruction))
94 (def-instr popaw
(popa) (:plain
#x61
(0 0) () :operand-mode
:16-bit
))
95 (def-instr popal
(popa) (:plain
#x61
(0 0) () :operand-mode
:32-bit
))
97 ;;; ----------------------------------------------------------------
98 ;;; POPF [IISR page 11-314]
99 ;;; ----------------------------------------------------------------
101 (def-instr popf
(instruction))
102 (def-instr popfw
(popf) (:plain
#x9d
(0 0) () :operand-mode
:16-bit
))
103 (def-instr popfl
(popf) (:plain
#x9d
(0 0) () :operand-mode
:32-bit
))