about summary refs log tree commit diff stats
path: root/linux/201register-names.subx
blob: 3c18a803fbee0a74d4ff72ccfcae85aa6f455850 (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
== data
Registers:  # (addr stream {(handle array byte), int})
  # a table is a stream
  0x120/imm32/write
  0/imm32/read
  0x120/imm32/length
  # data
  # it is perfectly ok to use fake alloc-ids -- as long as you never try to reclaim them
  0x11/imm32/alloc-id $Register-eax/imm32 0/imm32
  0x11/imm32/alloc-id $Register-ecx/imm32 1/imm32
  0x11/imm32/alloc-id $Register-edx/imm32 2/imm32
  0x11/imm32/alloc-id $Register-ebx/imm32 3/imm32
  0x11/imm32/alloc-id $Register-esp/imm32 4/imm32
  0x11/imm32/alloc-id $Register-ebp/imm32 5/imm32
  0x11/imm32/alloc-id $Register-esi/imm32 6/imm32
  0x11/imm32/alloc-id $Register-edi/imm32 7/imm32
  # for 8-byte registers
  # we don't actually check if these are used when they should be; be careful
  0x11/imm32/alloc-id $Register-al/imm32 0/imm32
  0x11/imm32/alloc-id $Register-cl/imm32 1/imm32
  0x11/imm32/alloc-id $Register-dl/imm32 2/imm32
  0x11/imm32/alloc-id $Register-bl/imm32 3/imm32
  0x11/imm32/alloc-id $Register-ah/imm32 4/imm32
  0x11/imm32/alloc-id $Register-ch/imm32 5/imm32
  0x11/imm32/alloc-id $Register-dh/imm32 6/imm32
  0x11/imm32/alloc-id $Register-bh/imm32 7/imm32
  # for floating-point registers
  # we don't actually check if these are used when they should be; be careful
  0x11/imm32/alloc-id $Register-xmm0/imm32 0/imm32
  0x11/imm32/alloc-id $Register-xmm1/imm32 1/imm32
  0x11/imm32/alloc-id $Register-xmm2/imm32 2/imm32
  0x11/imm32/alloc-id $Register-xmm3/imm32 3/imm32
  0x11/imm32/alloc-id $Register-xmm4/imm32 4/imm32
  0x11/imm32/alloc-id $Register-xmm5/imm32 5/imm32
  0x11/imm32/alloc-id $Register-xmm6/imm32 6/imm32
  0x11/imm32/alloc-id $Register-xmm7/imm32 7/imm32

$Register-eax:
  0x11/imm32/alloc-id
  3/imm32/size
  0x65/e 0x61/a 0x78/x

$Register-ecx:
  0x11/imm32/alloc-id
  3/imm32/size
  0x65/e 0x63/c 0x78/x

$Register-edx:
  0x11/imm32/alloc-id
  3/imm32/size
  0x65/e 0x64/d 0x78/x

$Register-ebx:
  0x11/imm32/alloc-id
  3/imm32/size
  0x65/e 0x62/b 0x78/x

$Register-esp:
  0x11/imm32/alloc-id
  3/imm32/size
  0x65/e 0x73/s 0x70/p

$Register-ebp:
  0x11/imm32/alloc-id
  3/imm32/size
  0x65/e 0x62/b 0x70/p

$Register-esi:
  0x11/imm32/alloc-id
  3/imm32/size
  0x65/e 0x73/s 0x69/i

$Register-edi:
  0x11/imm32/alloc-id
  3/imm32/size
  0x65/e 0x64/d 0x69/i

$Register-al:
  0x11/imm32/alloc-id
  2/imm32/size
  0x61/a 0x6c/l

$Register-cl:
  0x11/imm32/alloc-id
  2/imm32/size
  0x63/c 0x6c/l

$Register-dl:
  0x11/imm32/alloc-id
  2/imm32/size
  0x64/d 0x6c/l

$Register-bl:
  0x11/imm32/alloc-id
  2/imm32/size
  0x62/b 0x6c/l

$Register-ah:
  0x11/imm32/alloc-id
  2/imm32/size
  0x61/a 0x68/h

$Register-ch:
  0x11/imm32/alloc-id
  2/imm32/size
  0x63/c 0x68/h

$Register-dh:
  0x11/imm32/alloc-id
  2/imm32/size
  0x64/d 0x68/h

$Register-bh:
  0x11/imm32/alloc-id
  2/imm32/size
  0x62/b 0x68/h

$Register-xmm0:
  0x11/imm32/alloc-id:fake:payload
  # "xmm0"
  0x4/imm32/size
  0x78/x 0x6d/m 0x6d/m 0x30/0

$Register-xmm1:
  0x11/imm32/alloc-id:fake:payload
  # "xmm1"
  0x4/imm32/size
  0x78/x 0x6d/m 0x6d/m 0x31/1

$Register-xmm2:
  0x11/imm32/alloc-id:fake:payload
  # "xmm2"
  0x4/imm32/size
  0x78/x 0x6d/m 0x6d/m 0x32/2

$Register-xmm3:
  0x11/imm32/alloc-id:fake:payload
  # "xmm3"
  0x4/imm32/size
  0x78/x 0x6d/m 0x6d/m 0x33/3

$Register-xmm4:
  0x11/imm32/alloc-id:fake:payload
  # "xmm4"
  0x4/imm32/size
  0x78/x 0x6d/m 0x6d/m 0x34/4

$Register-xmm5:
  0x11/imm32/alloc-id:fake:payload
  # "xmm5"
  0x4/imm32/size
  0x78/x 0x6d/m 0x6d/m 0x35/5

$Register-xmm6:
  0x11/imm32/alloc-id:fake:payload
  # "xmm6"
  0x4/imm32/size
  0x78/x 0x6d/m 0x6d/m 0x36/6

$Register-xmm7:
  0x11/imm32/alloc-id:fake:payload
  # "xmm7"
  0x4/imm32/size
  0x78/x 0x6d/m 0x6d/m 0x37/7
38
39
40
41
42
43
44
45
46
47
48
         
                                            
 

                                                                               

                                                                             

                                                                               
 
                                                                  
 












                                                                                

                         
 
            




                                     

              
                                                                
                                                     

 
                        
                                                              

                        
                                            
    
                           
  
#!/bin/sh
# Compatible with ranger 1.6.0 through 1.7.*
#
# This script searches image files in a directory, opens them all with sxiv and
# sets the first argument to the first image displayed by sxiv.
#
# This is supposed to be used in rifle.conf as a workaround for the fact that
# sxiv takes no file name arguments for the first image, just the number.  Copy
# this file somewhere into your $PATH and add this at the top of rifle.conf:
#
#   mime ^image, has sxiv, X, flag f = path/to/this/script -- "$@"
#
# Implementation notes: this script is quite slow because of POSIX limitations
# and portability concerns. First calling the shell function 'abspath' is
# quicker than calling 'realpath' because it would fork a whole process, which
# is slow. Second, we need to append a file list to sxiv, which can only be done
# properly in two ways: arrays (which are not POSIX) or \0 sperated
# strings. Unfortunately, assigning \0 to a variable is not POSIX either (will
# not work in dash and others), so we cannot store the result of listfiles to a
# variable.

if [ $# -eq 0 ]; then
    echo "Usage: ${0##*/} PICTURES"
    exit
fi

[ "$1" == '--' ] && shift

abspath () {
    case "$1" in
        /*) printf "%s\n" "$1";;
        *)  printf "%s\n" "$PWD/$1";;
    esac
}

listfiles () {
    find -L "$(dirname "$target")" -maxdepth 1 -type f -iregex \
      '.*\(jpe?g\|bmp\|png\|gif\)$' -print0 | sort -z
}

target="$(abspath "$1")"
count="$(listfiles | grep -m 1 -ZznF "$target" | cut -d: -f1)"

if [ -n "$count" ]; then
    listfiles | xargs -0 sxiv -n "$count" --
else
    sxiv -- "$@" # fallback
fi