Introduction To 64 Bit Intel Assembly Language Programming For Linux Ray Seyfarth download
Introduction To 64 Bit Intel Assembly Language Programming For Linux Ray Seyfarth download
https://ebookbell.com/product/introduction-to-64-bit-intel-
assembly-language-programming-for-linux-ray-seyfarth-4768836
https://ebookbell.com/product/introduction-to-64-bit-windows-assembly-
programming-fourth-edition-4th-edition-ray-seyfarth-7142452
https://ebookbell.com/product/introduction-to-64-bit-windows-assembly-
programming-ray-seyfarth-10314084
https://ebookbell.com/product/introduction-to-computer-organization-
an-under-the-hood-look-at-hardware-and-x8664-assembly-robert-g-
plantz-38184498
https://ebookbell.com/product/introduction-to-modern-analysis-2nd-
edition-2nd-kantorovitz-44870612
Introduction To The Speechmaking Process 15th Edition Diana K Leonard
Raymond S Ross
https://ebookbell.com/product/introduction-to-the-speechmaking-
process-15th-edition-diana-k-leonard-raymond-s-ross-44874488
https://ebookbell.com/product/introduction-to-construction-
management-2nd-edition-2nd-fred-sherratt-44899008
https://ebookbell.com/product/introduction-to-analysis-with-complex-
numbers-irena-swanson-44912170
https://ebookbell.com/product/introduction-to-quantitative-methods-in-
business-with-applications-using-microsoft-office-excel-1st-edition-
bharat-kolluri-44915766
https://ebookbell.com/product/introduction-to-biostatistical-
applications-in-health-research-with-microsoft-office-excel-and-r-2nd-
edition-robert-p-hirsch-44915830
Introduction to 64
Bit Intel Assembly
Language Programming
for Linux
Introduction to 64 Bit Intel Assembly Language
Programming for Linux
Ray Seyfarth
Seyfarth, Ray
Introduction to 64 Bit Intel Assembly Language Programming
Includes index.
ISBN-13: 978-1466470033
ISBN-10 : 1466470038
The Intel CPU architecture has evolved over 3 decades from a 16 bit
CPU with no memory protection, through a period with 32 bit processors
with sophisticated architectures into the current series of processors which
support all the old modes of operation in addition to a greatly expanded
64 bit mode of operation. Assembly textbooks tend to focus on the history
and generally conclude with a discussion on the 32 bit mode. Students are
introduced to the concepts of 16 bit CPUs with segment registers allowing
access to 1 megabyte of internal memory. This is an unnecessary focus
on the past.
With the x86-64 architecture there is almost a complete departure
from the past. Segment registers are essentially obsolete and more reg
ister usage is completely general purpose, with the glaring exception of
the repeat-string loops which use specific registers and have no operands.
Both these changes contribute to simpler assembly language program
mmg.
There are now 16 general purpose integer registers with a few spe
cialized instructions. The archaic register stack of the 8087 has been
superseded by a well-organized model providing 16 floating point regis
ters with the floating point instructions for the SSE and AVX extensions.
In fact the AVX extensions even allow a three operand syntax which can
simplify coding even more.
Overall the x86-64 assembly language programming is simpler than
its predecessors. The dominant mode of operation will be 64 bits within
a few short years. Together these trends indicate that it is time to teach
64 bit assembly language.
The focus in this textbook is on early hands-on use of 64 bit assembly
prograrnmmg. There is no 16 or 32 bit programming and the discussion
Ill
IV PREFACE
of the history is focused on explaining the origin of the old register names
and the few non-orthogonal features of the instruction set.
The intention is to get students involved with using the yasm assembler
and the gdb debugger from the start. There are assignments using the
computer from the very first chapter. Not every statement will be fully
understood at this time, but the assignments are still possible.
The primary target for this book is beginning assembly language pro
grammers and for a gentle introduction to assembly programming, stu
dents should study chapters 1 , 2, 3, 5, 6, 7, 8, 9, 10 and 1 1 . Chapter 4
on memory mapping is not critical to the rest of the book and can be
skipped if desired.
Chapters 12 through 1 5 are significantly more in depth. Chapter
1 5 is about data structures in assembly and is an excellent adjunct to
studying data structures in C/C++. The subject will be much clearer
after exposure in assembly language.
The final four chapters focus on high performance programming, in
cluding discussion of SSE and AVX programming.
The author provides PDF slides for classroom instruction along with
sample code and errata at http://rayseyfarth.com/asm.
If you find errors in the book or have suggestions for improvement,
please email the author as ray.seyfarth@gmail.com.
Thank you for buying the book and I hope you find something inter
esting and worthwhile inside.
Acknow ledgernents
v
Vl ACKNOWLEDGEMENTS
Preface iii
Acknowledgements v
1 Introduction 1
1.1 Why study assembly language? 2
1 .2 What is a computer? . . . 4
1 .2 . 1 Bytes . . . . . . . 4
1 .2.2 Program execution 4
1 .3 Machine language . . . . 5
1 .4 Assembly language . . . 6
1.5 Assembling and linking 8
2 Numbers 11
2.1 Binary numbers . 11
2.2 Hexadecimal numbers 13
2.3 Integers . . . . . . . . 16
2.3.1 Binary addition . 18
2.3.2 Binary multiplication 19
2.4 Floating point numbers . . . 20
2.4.1 Converting decimal numbers to floats 23
2.4.2 Converting floats to decimal . 24
2.4.3 Floating point addition . .
. 24
2.4.4 Floating point multiplication 25
3 Computer memory 27
3.1 Memory mapping . 27
Vll
Vlll CONTENTS
5 Registers 43
5.1 Moving a constant into a register . . . . . . 45
5.2 Moving values from memory into registers . 46
5.3 Moving values from a register into memory 49
5.4 Moving data from one register to another 49
7 Bit operations 61
7.1 Not operation . 61
7.2 And operation 62
7.3 Or operation 63
7.4 Exclusive or operation 64
7.5 Shift operations . . . . 65
7.6 Bit testing and setting 67
7. 7 Extracting and filling a bit field . 68
CONTENTS IX
9 Functions 89
9.1 The stack 89
9.2 Call instruction . . 90
9.3 Return instruction 91
9.4 Function parameters and return value 91
9.5 Stack frames 92
9.6 Recursion 94
10 Arrays 99
10.1 Array address computation . . . . . . 99
10.2 General pattern for memory references 101
10.3 Allocating arrays . . . . . 103
10.4 Processing arrays . . . . . . . . . . . . 104
10.4. 1 Creating the array . . . . . . . 104
10.4.2 Filling the array with random numbers 105
10.4.3 Printing the array . . . . . . . . . . . 106
10.4.4 Finding the minimum value . . . . . . 107
10.4.5 Main program for the array minimum 107
10.5 Command line parameter array . . . . . . . . 109
13 Structs 137
13.1 Symbolic names for offsets . . . . . . . . 138
1 3.2 Allocating and using an array of structs 140
Introduction
1
2 CHAPTER 1 . INTROD UCTION
and AVX instructions. The coming trend is for the size of SIMD registers
to increase and it generally requires assembly language to take advantage
of the SIMD capabilities.
level languages. A skilled assembly language coder can write code which
uses less CPU time and less memory than that produced by a compiler.
However modern C and C++ compilers do excellent optimization and
beginning assembly programmers are no match for a good compiler. The
compiler writers understand the CPU architecture quite well. On the
other hand an assembly programmer with similar skills can achieve re
markable results. A good example is the Atlas ( Automatically Tuned Lin
ear Algebra Software ) library which can achieve over 95% of the possible
CPU performance. The Atlas matrix multiplication function is probably
at least 4 times as efficient as similar code written well in C. So, while it is
true that assembly language can offer performance benefits, it is unlikely
to outperform C/C++ for most general purpose tasks. Furthermore it
takes intimate knowledge of the CPU to achieve these gains. In this book
we will point out some general strategies for writing efficient assembly
programs.
1.2 . 1 Bytes
Address Value
4000b0 184
4000b1 1
4000b2 0
4000b3 0
4000b4 0
4000b5 187
4000b6 5
4000b7 0
4000b8 0
4000b9 0
4000ba 205
4000bb 128
people soon figured out ways to make the task easier. The first improve
ment is to use words like mov to indicate the selection of a particular in
struction. In addition people started using symbolic names to represent
addresses of instructions and data in a program. Using symbolic names
prevents the need to calculate addresses and insulates the programmer
from changes in the source code.
1 .4 Assembly language
Very early in the history of computing ( 1950s) , programmers developed
symbolic assembly languages. This rapidly replaced the use of machine
language, eliminating a lot of tedious work. Machine languages are con
sidered "first-generation" programming languages, while assembly lan
guages are considered "second-generation" .
Many programs continued to be written in assembly language .after
the invention of Fortran and Cobol ( "third-generation" languages) in the
late 1950s. In particular operating systems were typically nearly 100%
assembly until the creation of C as the primary language for the UNIX
operating system.
The source code for the 12 byte program from earlier is listed below:
Program : exit
No input
segment . t ext
global _start
_start :
mov eax , 1 1 is the exit sys call number
mov ebx , 5 the status value to return
int Ox80 execute a system call
1.4. ASSEMBLY LANGUAGE 7
You will observe the use of ";" to signal the start of comments in this
program. Some of the comments are stand-alone comments and others are
end-of-line comments. It is fairly common to place end-of-line comments
on each assembly instruction.
Lines of assembly code consist of labels and instructions. A label
usually starts in column 1, but this is not required. A label establishes
a symbolic name to the current point in the assembler. A label on a line
by itself must have a colon after it, while the colon is optional if there is
more to the line.
Instructions can be machine instructions, macros or instructions to
the assembler. Instructions usually are placed further right than column
1 . Most people establish a pattern of starting all instructions in the same
column.
The statement "segment . text" is an instruction to the assembler
itself rather than a machine instruction. This statement indicates that the
data or instructions following it are to be placed in the text segment or
.
The yasm assembler is modeled after the nasm assembler. yasm pro
duces object code which works properly with the gdb and ddd debuggers,
while nasm did not produce acceptable code for debugging during testing.
The -f elf64 option selects a 64 bit output format which is compatible
with Linux and gee. The -g dwarf2 option selects the dwarf2 debugging
format, which is essential for use with a debugger. The -1 exit . 1st asks
for a listing file which shows the generated code in hexadecimal.
The yasm command produces an object file named exit . o , which
contains the generated instructions and data in a form ready to link with
other code from other object files or libraries. In the case of an assembly
program with the _start function the linking needs to be done with ld:
ld -o exit exit . o
In this case gee will incorporate its own version of _start and will
call main from _start (or indirectly from _start ) .
You can execute the program using:
. /exit
1 . 5. ASSEMBLING AND LINKING 9
Exercises
1 . Enter the assembly language program from this chapter and assem
ble and link it. Then execute the program and enter echo $?. A
non-zero status indicates an error. Change the program to yield a
0 status.
2. Modify the assembly program to define main rather than _start.
Assemble it and link it using gee. What is the difference in size of
the executables?
3. In C and many other languages, 0 means false and 1 (or non-zero)
means true. In the shell 0 for the status of a process means success
and non-zero means an error. Shell if statements essentially use 0
for true. Why did the writer of the first shell decide to use 0 for
true?
10 CHAPTER 1. INTROD UCTION
Chapter 2
Numbers
10101 1 1 1 = 2 7 + 25 + 2 3 + 22 + 2 + 1
= 128 + 32 + 8 + 4 + 2 + 1
= 175
The bits of an 8 bit number are numbered from 0 to 7 with 0 being the
least significant bit and 7 being the most significant bit. The number
175 has its bits defined below.
The conversion from binary to decimal is straightforward. It takes a
little more ingenuity to convert from decimal to binary. Let 's examine
11
12 .CHAPTER 2. NUMBERS
bit value 1 I 0 I 1 I 0 I 1 1 1 I 1 I
bit position 7 6 5 4 3 2 1 0
the number 741 . The highest power of 2 less than (or equal to) 741 is
29 = 512. So we have
Now we need to work on 229. The highest power of 2 less than 229 is
27 = 1 28 . So we now have
The process continues with 101. The highest power of 2 less than 101
is 26 = 64. So we get
The repeated division algorithm is easier since you don't have to iden
tify (guess? ) powers of 2 less than or equal to the number under question.
It is also easy to program.
Let's consider the value of Oxala. This number uses a which means
10, so we have
Oxal a = 10 * 162 + 1 * 1 6 + 10
= 10 * 256 + 16 + 10
= 2586
40007 = 9 * 1 63 + 3 143
40007 = 9 * 1 63 + 12 * 162 + 71
40007 = 9 * 1 63 + 1 2 * 1 62 + 4 * 16 + 7 = Ox9c47
are binary and hexadecimal. Binary is pretty obvious t o use, but only
for fairly short binary strings. Hexadecimal is more practical for longer
binary strings.
The bottom line is conversion between binary and hexadecimal is
all that one normally needs to do. This task is made easier since each
hexadecimal "digit" represents exactly 4 bits (frequently referred to as
a "nibble" ) . Consult the table below to convert between binary and
hexadecimal.
Hex Binary
0 0000
1 0001
2 0010
3 001 1
4 0100
5 0101
6 0110
7 0111
8 1000
9 1001
a 1010
b 1011
c 1 100
d 1 101
e 1 1 10
f 1111
2.3 Integers
On the x86-64 architecture integers can be 1 byte, 2 bytes, 4 bytes, or 8
bytes in length. Furthermore for each length the numbers can be either
signed or unsigned: Below is a table listing minimum and maximum
values for each type of integer.
The range of 64 bit integers is large enough for most needs. Of course
there are exceptions, like 20! 51090942171 709440000.
=
31 0
sign bit value
Let's consider 8 bit signed integers and what we would get if we used
the existing circuitry to add 2 such integers. Let's add -1 and 1 . Well, if
we store -1 with a sign bit and then the value we would get
-1 = 1000 000 1
1 = 00, 0 0 000 1
Now expressing this as a 15 bit binary number (with spaces to help keep
track of the bits) we get 000 0010 1 1 10 1 1 10. Next we invert the bits to
get 1 1 1 1 1 0 1 000 1 000 1 . Finally we add 1 and prefix the number with
the sign bit to get -750 = 1 1 1 1 1 10 1 0001 0010 = OxFD12.
Next let's convert the hexadecimal value OxFA13 from a 16 bit signed
integer to a decimal value. Start by converting the rightmost 15 bits
to binary: 1 11 1010 0001 001 1. Then invert the bits: 000 0 1 0 1 1 1 10
1 100. Add 1 to get the 2's complement : 000 0101 1 1 10 1 1 0 1 . Convert
this to decimal 1 024 + 256 + 128 + 64 + 32 + 8 + 4 + 1 = 1517, so OxFA13
= -15 17.
Let's add -750 and -1517 in binary:
1 1 1 1 1 1 0 1 0001 0010
1 1 1 1 1010 0001 001 1
1 1 1 1 1 0 1 1 1 0010 0101
We can ignore the leading 1 bit (a result of a carry ) . The 16 bit sum
is 1 1 1 1 0 1 1 1 00 10 0101, which is negative. Inverting the lower-most 1 5
bits: 0000 1 000 1 101 1010. Next adding 1 to get the two's complement:
0000 1000 1 101 1 0 1 1 . So the number is 2048+ 128 + 64 + 1 6 + 8 + 2 + 1 =
2267. So we have -750 + -1 517 = -2267.
Performing binary addition is a lot like decimal addition. Let 's add 2
binary numbers
1 0 10 1 1 1 1
+ 1 10 1 00 1 0
1
The first pair of bits was easy. Adding the second pair of bits gives a
value of 2, but 2 = 10b, so we place a 0 on the bottom and carry a 1
1
1000 1 1 1 1
+ 0101 1010
01
2. 3. INTEGERS 19
1
1000 1 1 1 1
+ 01011010
1001
1
1000 1 1 1 1
+ 0101 1010
01001
1000 1 1 1 1
+ 0101 1 0 1 0
1 1 10 1001
The IEEE format treats these different length numbers in the same
way, but with different lengths for the fields. In each format the highest
order bit is the sign bit. A negative number has its sign bit set to 1 and
the remaining bits are just like the corresponding positive number. Each
number has a binary exponent and a fraction. We will focus on the float
type to reduce the number of bits involved.
31 30 23 22 0
sign bit exponent value
required for a complete description of IEEE 754, but this is sufficient for
our needs.
To illustrate floating point data, consider the following assembly file
segment . data
zero dd 0.0
one dd 1.0
neg! dd -1 . 0
a dd 1 . 75
b dd 1 22 . 5
d dd 1.1
e dd 10000000000 . 0
The zero variable is stored as expected - all 0 bits. The other numbers
might be a little surprising. Look at one - the bytes are backwards!
Reverse them and you get 3F800000. The most significant byte is 3F.
The sign bit is 0. The exponent field consists of the other 7 bits of
the most significant byte and the first bit of the next byte. This means
that the exponent field is 127 and the actual binary exponent is 0. The
remaining bits are the binary fraction field - all O's. Thus the value is
1.0 * 2° 1 .0.
=
22 CHAPTER 2. NUMBERS
There is only 1 negative value shown: -1 .0. It differs in only the sign
bit from 1 .0.
You will notice that 1 .75 and 122.5 have a significant number of O's
in the fraction field. This is because . 75 and .5 are both expressible as
sums of negative powers of 2.
1/11 = 0.090909 . . .
0 and the fraction field in binary is 000 1 1001 1001 1001 1001 10 1 . It looks
like the last bit has been rounded up and that the repeated pattern is
1 100.
1 . 1 10 1 .0001 100 1 10011001 1001100 . . '2
=
Having seen that floating point numbers are backwards, then you
might suspect that integers are backwards also. This is indeed true.
Consider the following code which defines some 32 bit integers
segment data
zero dd 0
one dd 1
neg1 dd -1
a dd 175
b dd 4097
d dd 65536
e dd 100000000
The associated listing file shows the bits generated for each number .
The bytes are backwards. Notice that 4097 is represented as Ox0 1 100000
in memory. The first byte is the least significant byte. We would prefer
to consider this as Ox0000 1001, but the CPU stores least significant byte
first.
Let's work on an example to see how to do the conversion. Let 's convert
-121 .6875 to decimal.
First let's note that the sign bit is 1 . Now we will work on 121 .6875.
It's fairly easy to convert the integer portion of the number: 121 =
0. We have 1 1 1 1001 . 1 0b
Multiplying again: 2 x 0.75 1 . 5, so the next bit is 1 . We now have
=
1 1 1 1001 . 101b .
Multiplying again: 2 x 0 . 5 = 1 , so the last bit is ! leaving 1 1 1 1001 . 1 0 1 1b
So our number -121 .6875 - 1 1 1 1 001 . 1 0 1 1b . We need to get this
=
We now have all the pieces. The sign bit is 1 , the fraction (without
the implied 1 ) is 1 1 100 1 1 0 1 10000000000000 and the exponent field is
127+6 133 10000 101. So our number is
= =
In order to add two floating point numbers, we must first convert the
numbers to binary real numbers. Then we need to align the binary points
and add the numbers. Finally we need to convert back to floating point .
Let's add the numbers 41.275 and 0.315. In hexadecimal these num
bers are Ox4225 199a and Ox3ea147ae . Now let 's convert Ox42251 99a to
a binary number with a binary exponent. The exponent field is com
posed of the first two nibbles and a 0 bit from the next nibble. This is
10000 1 002 132, so the exponent is 132 - 127 5. The fractional part
= =
So we have
1.010000101000111101011102
So we have
2
Ox3ea147ae = 1.010000101000111101011102 * 2-
= 0.01010000101000111101011102
= 1. 0 1 00 1 10 0 1 0 1 1 10000 1 0 1 0 0 1 2 * 25
So the exponent is 5 and the exponent field is again 132. Dropping
the leading 0, we get Ox42265c29 which is 41.59 (approximately) .
You should be able to see that we lost some bits of precision on the
smaller number. In an extreme case we could try to add 1.0 to a number
like 1038 and have no effect.
Exercises
101 100 1 0 1 1
* 1 1 0 1 101
Computer rnernory
27
28 CHAPTER 3. COMPUTER MEMORY
page number and the address within the page. Suppose a reference is
made to logical address Ox4000002220. Since 4096 = 2 12 , the offset
within the page is the right-most 1 2 bits (Ox220) . The page number
is the rest of the bits (Oc=x4000002). A hardware register (or multiple
registers) translates this page number to a physical page address, let's say
Ox780000000. Then the two addresses are combined to get the physical
address Ox780000220.
Amazingly the CPU generally performs the translations without slow
'
ing down and this benefits the users in several ways. The most obvious
benefit is memory protection. User processes are limited to reading and
writing only their own pages. This means that the operating system is
protected from malicious or poorly coded user programs. Also each user
process is protected from other user processes. In addition to protection
from writing, users can't read other users' data.
There are instructions used by the operating system to manage the
hardware mapping registers. These instructions are not discussed in this
book. Our focus is on programming user processes.
So why bother to discuss paging, if we are not discussing the instruc
tions to manage paging? Primarily this improves one's understanding
of the computer. When you write software which accesses data beyond
the end of an array, you sometimes get a segmentation fault . However
you only get a segmentation fault when your logic:al address reaches far
enough past the end of the array to cause the CPU to reference a page
table entry which is not mapped into your process.
store instructions and data. This region is also used for mapping shared
memory regions into a process.
If you wish to examine the memory used by one of your processes,
you can execute "cat /proc/999/maps" where 999 needs to be replaced
by your process id. To see the memory used by your shell process, enter
cat /proc/$$/maps
segment . data
a dd 4
b dd 4.4
c t imes 10 dd 0
d dw 1' 2
e db Oxfb
f db "hello world" , 0
segment . bs s
g resd 1
h resd 10
i resb 100
segment . text
global main l et the linker know about main
main :
push rbp set up a stack frame for main
mov rbp , rsp set rbp to po int to the stack fram·
sub rsp , 1 6 leave some room for local variable�
leave rsp on a 16 byte boundary
xor eax , eax set rax to 0 for return value
leave undo the stack frame manipul ations
ret
The next data item is the array c defined with the times pseudo-op
which has 1 0 double word locations. The relative location for c is 8 and
32 CHAPTER 3. COMPUTER MEMORY
In this section we will focus on using the gdb print (p) and examine ( x)
commands. Print is a simple command which can print some data values
and is versatile enough to print various forms of C expressions. Examine
is strictly for printing data from memory and is quite useful for printing
arrays of various types.
The format for the p command is either p expression or p/FMT expre ssion
where FMT is a single letter defining the format of data to print . The for
mat choices are
3. 4. EXAMINING MEMORY WITH GDB 33
letter format
d decimal (default)
X hexadecimal
t binary
u unsigned
f floating point
1 instruction
c character
s string
a address
Let's see a few commands in action in gdb:
(gdb) p a
$32 = 4
(gdb) p/a &a
$33 = Ox601018 <a>
(gdb) p b
$34 = 1082969293
(gdb) p/f b
$35 = 4 . 400000 1
(gdb) p/a &b
$36 = Ox60101c <b>
(gdb) p/x &b
$37 = Ox60101c
(gdb) p/a &c
$39 = Ox601 020 <c>
(gdb) p/a &d
$40 = Ox601 048 <d>
(gdb) p/a &e
$41 = Ox60 1 04c <e>
(gdb) p/a &f
$42 = Ox601 04d <f>
(gdb) p/a &g
$43 = Ox601070 <g>
(gdb) p/a &h
$45 = Ox601074 <h>
(gdb) p/a &i
34 CHAPTER 3. COMPUTER MEMORY
We see that gdb handles a perfectly. It gets the type right and the
length. It needs the If option to print b correctly. Notice that a is
located at address Ox60 1018 which is 24 bytes after the start of a page
in memory. gdb will prohibit accessing memory before a, though there is
no hardware restriction to the previous 24 bytes. We see that the data
segment variables are placed in memory one after another until f which
starts at Ox60104d and extends to Oc601058. There is a gap until the bss
segment which starts with g at address Ox60 1070. The bss data items
are placed back to back in memory with no gaps.
Notice that there are no length specifiers with p. If you want to print
doubles in memory it could be done with some mental gymnastics with
p. The examine command handles this job readily.
The format for examine is x/NFS address where N is a number of
items to print (default 1 ) , F is a single letter format as used in the print
command and S is the size of each memory location. Unfortunately gdb
picked some size letters which conflict with some of the size options in
yasm. Here are the size options:
“As far as I know; she’ll be ten times better help than Judith; she’s
strong and used to sickness. She can lift Rody, and that’s what you
want. I thought the parsonage folks had spoilt Judith for you by
making her too much of a lady.”
“You will find my sister Sarah ready for any emergency. What do you
think she’s been doing to get into the paper? She sent me the paper
with the thing marked in it. I wish I had brought the paper; I’ll show
it to you some time. You know she lives, when she’s at home, near a
tunnel; well that tunnel caved in one day just after a passenger train
had passed through; she knew there would be another train soon,
and she had her red petticoat ready and ran out as it came
thundering on, and swung it in the air until she stopped the train—
and just within a few feet of the tunnel, too. Wasn’t that pluck?”
“Where’s Judith?” called Joe’s voice. “I have a letter for her; one of
the foreign letters she used to be so raving glad to get.”
In the half light Judith sprang toward the letter. There was no light
in the sitting-room; on the kitchen table a lamp was burning; she
was glad to read it unquestioned. Snatching at its meaning she ran
through the three thin sheets; then she read it deliberately,
understandingly.
He had written to tell her of his marriage, and two weeks afterward,
on his wedding tour, found the unmailed letter in his pocket. That
letter he had destroyed, and, after a week to plan and decide what
to propose to her, had written again—was writing again now, in fact.
The shortest way to her forgiveness he believed to be to ask her to
come to England, not to be his housekeeper, but to be his wife’s
dear little friend and cousin, as well as his own. But, if she decided
not to do that, and the plan did have its disadvantages (he had not
yet asked his wife’s advice or consent), would she be happy to stay
on at the parsonage, or at Aunt Affy’s just as usual? He would never
forget her, she would always be his dearest little cousin in the world,
and he knew she and Florence would be the best of friends if they
could know each other. Florence had a prejudice against America,
but that would wear off. He very much regretted he had never
written about Florence, but she was something of a flirt and had
never allowed him to be sure of her until she knew he had taken
passage for America. He hoped she would write to Florence and
then they would understand each other better. She must be sure to
write to him by return mail. He hoped the delayed letter had not
made her uncomfortable. He was always her devoted Cousin Don.
Mrs. Evans went home, passing through the kitchen; Aunt Affy had
told her of the unexpected marriage of Judith’s cousin; she was
curious to catch a glimpse of the girl’s face over his letter. It would
be something to tell Nettie. With her usual thoughtfulness Aunt Affy
asked no question concerning the letter. That night Judith could not
bring herself to show the letter; the next morning she gave it to her
to read, and then asked if she might be spared to go to the
parsonage.
“Yes, dear child. And stay all day if you like. I’ll do for Rody. She will
not ask for you. She called me Becky in the night. It’s the first time
she has not recognized me. And when Mrs. Evans’s sister, Mrs.
Treadwell comes, you may go and have a long rest and study again.”
“No matter, you’ll get it just the same,” said Aunt Affy, patting her
shoulder with a loving touch. “And, after this, you are to come to me
for money—you are to be my own child; my little girl, and Cephas’
little girl.”
With her head on Aunt Affy’s shoulder Judith laughed and cried; she
even began to feel glad of something—not that Don was married, or
that she was not to be his housekeeper, or that she was not to be
Aunt Rody’s nurse; it was almost wrong to be glad when she should
be disappointed; then she knew she was glad because no one in all
the world had the right to take her away from the parsonage.
The way of obedience had been easier than she thought. She stayed
that day with Aunt Rody, doing little last things for her, and telling
Aunt Affy ways of nursing that pleased Aunt Rody that she had
discovered for herself.
“She will miss you,” Aunt Affy said that evening, as Judith came into
the sitting-room dressed for her walk. Doodles was snoring upon his
cushion on the lounge; Uncle Cephas, at the round table, was lost in
the day’s paper; Joe, at another table, was reading a book he had
found under rubbish in the storeroom: this last year he had
developed a taste for books.
The girl lingered, with her satchel in her hand; the dear old home
was a hard place to leave; without the cloud of Aunt Rody’s
presence it was peace and sunshine.
Aunt Affy, with her pretty, gray head, her light step, her words of
comfort and courage, moved about like a benediction; Uncle Cephas,
rough and kindly, with strength in reserve for every emergency,
gave, to the house the headship it had always lacked; Joe, to-night,
was fine and sturdy, and growing into somebody; would they miss
her?
Was the girl going away any real part of the strength and beauty of
the old Sparrow place?
Joe had asked her if she were “going for good.” Was to-night
another turning-point?
If she stayed would her life to come be any different?
No one was taking her away, she was going of her own free will.
—Luke xi. 1.
“O Thou, by whom we come to God,
The Life, the Truth, the Way!
The path of prayer Thyself hast trod;
Lord, teach me to pray.”
“Our old Meadow Brook physician prays with his patients very often;
I tell him he leaves nothing for the parson to do.”
“Roger says sometimes the doctor has a way of getting nearer our
Bensalem people than he has.”
“Yes, and here’s another one,” Roger replied, as Judith walked softly
in. “Judith, must I put on my coat? I’ve been potting plants for
Marion and I couldn’t afford to soil my coat.”
“Yes,” said Judith, who was always on Marion’s side in influencing
the Bensalem minister to remember the claims of society.
“I wish you had stayed at home. What are you looking so full of
news about?”
“I have come back—to stay. No one else in the world wants me.”
She wished the tall girl with the serious eyes and braided hair were a
little girl with long curls.
“Yes.”
“I—think I like it. It will not make any difference to me—only the
difference that it hasn’t made.”
“Surely—your room has been waiting for you as the Holy Land
waited for the Israelites to return from their captivity; nobody
spoiled either, or occupied either.”
It had been so long since she had heard Roger talk; that “talk” was
one of the delights of her parsonage life. She had heard him preach
but once during her stay at Aunt Affy’s.
“That point about praying came up,” Mr. King was saying, “and I am
not satisfied with the answer I gave. The man gave his experience—
it was an experience of years—and then he asked me what was the
matter with his prayer, and I decidedly did not know. I know he has
fulfilled the conditions, praying in faith, and in the name of Christ,
and the thing prayed for was innocent in itself. He said, ‘What is the
matter with me?’ and I could not tell. He went away unsatisfied. I
went down on my knees, you may be sure, thinking something was
the matter with me because I had no illumination for him.”
Roger’s strong, brown hand was stretched along the arm of his
chair; he looked down at his fingers in deep thought.
“He said he had been praying months to learn if the petition in itself
were not acceptable to God, and had, he thought, studied a hundred
prayers in the Bible, comparing his prayer with the acceptable and
unacceptable prayers of the old saints.”
Marion dropped her silks; Judith was listening with all the eagerness
of her childhood. She felt sure Aunt Affy could explain the difficulty.
“The thing that strikes me,” began Roger, “is that he may be like
those men sent to the house of God to inquire about fasting.”
“These men went to pray before the Lord and to ask a question.
Their question was about fasting; but fasting has to do with praying
—your friend has certainly been in a weeping and fasting spirit. They
asked: Should I weep in the fifth month separating myself, as I have
done these so many years?
“Tell your old man praying and fasting are good, but sometimes God
has enough of them. He prefers obedience. The conditions of the
covenant had been violated by disobedience in both instances.
Praying in faith, and in the name of Christ, are but two conditions;
hearing and obeying is a third condition. Your man may be in the
midst of a very interesting experience, but I would advise him to
stop questioning the Lord, and try what a little obedience would do.”
“But, he’s a good man, Roger,” urged Judith, “only a good man could
bear a trial like that.”
“I wish we could know all about it—the rest of the story, and, if he
ever has his prayer,” said Marion, to whom “people” were becoming
a real and live interest.
“Joshua had his prayer. The story of Ai is the story of how God
answers prayer when he has made way for it; it shows his
disciplinary government; it places obedience before all things;
obedience makes God’s answers to prayer a natural proceeding.”
“Oh, no,” Mr. King reassured her, “only you have not depended
enough on obedience. I will call upon my old man to-morrow and
tell him these two stories of disciplinary government.”
“You are not going home, to-night, old fellow,” urged Roger, “the
girls will give us some music. We four will make a fine quartette.”
“Miss Judith, did you know I have a housekeeper?” he asked, turning
brightly to Judith.
“I am very glad.”
“A man and his wife I have taken in. She’s a good cook; the house is
a different affair; I wish you would come and see. The man gets
work among the farmers and takes care of my horse, which I used
to do myself. They are both grateful for a home and I am very happy
to be set in a family.”
The next day the gentlemen went fishing and Marion and Judith kept
the long day to themselves. In the afternoon Marion and Nettie had
their weekly history talk, and, Judith shut herself up in the study and
wrote a story about a girl who learned a new lesson in the way of
obedience. The story was from a child’s standpoint; in writing for
children she was keeping her heart as fresh as the heart of a little
child.
“I would like it,” was the unhesitating reply, “if I can do it.”
“You can do it. You can do anything you like.”
“But the books?” said Richard King, ready to place his own
bookshelves at her service.
“Oh, the books are easily found. There’s our school library, and the
Public Library in Dunellen, and everybody’s house to ransack in
Bensalem. Besides, my own library is no mean affair. Books and
fishing are my laziness and luxury. No hurried work, Judith,
remember. You shall not read the first one of the series to me until a
month from to-day.”
“But you do other writing and studying in the mean time,” said
Judith.
—Keble.
It was chilly that evening in the old rooms of the house with three
windows in the roof; Roger Kenney’s father and mother sat near the
grate in the front parlor; curtains and portieres were dropped, the
piano lamp with its crimson silk shade threw a glow over the two
faces sitting in cosy content opposite each other. The house was
still; the girls, Martha and Lou, and the two boys, Maurice and John,
had gone down town to an illustrated lecture on India; the maid had
her evening out; even Nip, the house-dog, had gone out for an
evening ramble; the two “old people,” as in their early sixties they
loved to call each other, were alone with each other and a new
anxiety.
Mr. Kenney told his wife that nothing in the world made her quite so
happy as a new worry, and he wished he could get one for her
oftener.
“This will do for awhile,” she remarked; “but this isn’t as bad as that
old trouble of Marion’s; a man can work himself out; and Roger has
work enough on hand for two worries.”
“Now, what are you going to do about this?” inquired her husband,
folding the evening’s paper and laying it upon his knee. “You sent
Marion to Bensalem for her charm; will you get Roger away for his?”
“It’s the best of it, I think. You wouldn’t have your boys and girls
carried away by somebody not worth having.”
“But, then, being disappointed in somebody might help them bear it,
and turn them around to look at somebody else.”
“Something like it. Marion has carried herself well about this
marriage.”
“But this is not helping us out about Roger,” she remarked, ignoring
his words and laugh.
“Roger will help himself out; he isn’t his father’s son for nothing.”
“As Marion was not her mother’s girl for nothing,” was the demure
reply.
“She is the very light of his eyes. She has been for years. A mother
can see. The thought of her is always about him.”
“No; that’s the queer part of it. I think Roger is guarded with her. He
never had a secret from his mother.”
“Young men never have,” the young man’s father threw in.
“If I could send her anywhere else he would think it his duty to go
and see her, he would have to know how she was doing—pay her
bills, and so forth. There’s no one else to be a father to her. Mrs.
Brush leaves everything with him. She has no knowledge of any
world outside of that village.”
“Such a worldly thought would never enter her dear, pretty, simple,
shrewd head. She has her catch, and she didn’t catch him with guile.
She would rather keep Judith than set her on the throne of England.
That’s out of the question.”
“Well, I do see that point about bringing her here. He can see her
naturally here; nothing to thwart him; she’s such a girl, no older
than Martha—you never have any scares about Martha.”
“Martha has never been thrown so with anybody, I wouldn’t allow it.
I try to be always on the safe side?”
“And I thought it such a good outlet for Marion—it was one of the
first things that roused her—that and her Outing Society. My only
fear was that she was taking Judith up for the sake of her Cousin
Don. His influence somehow seems to run through everything. But I
know better now. Judith won her own way. But I didn’t know I was
sacrificing Roger to Marion.”
“And it’s rather dangerous for our fingers to get into the tangle,” he
suggested, with mild reproof.
“I don’t see anything the matter with Roger. He can walk ten miles
on a stretch, he rides horseback, he cuts his own kindling wood and
makes his own garden, he gives his people two strong sermons a
week, beside the prayer meeting and weekly lectures; he goes
hunting with one of his deacons and talks farming with another; he
neglects nobody, and works like a drum-major. He isn’t hurt.”
“I grant that. Why should she? But she will think of it when he
suggests it.”
“He isn’t twice her age now,” observed Mr. Kenney, comically.
Exactly a month from the day Roger planned the Girl Papers for her,
Judith knocked at the study door with her manuscript in her hand.
She had written three papers; if he took sufficient interest in the first
she would read the others.
Beside the education for herself she had another thought in writing
them; she would send them to some child’s paper and earn money.
She knew that Marion had never depended upon the parsonage for
money; every month her father sent her a check; she had no father
to send her a check. No money had come to her from her Cousin
Don since his hurried marriage. Probably he considered her old
enough to earn money for herself. It would be hard to tell Aunt Affy
when she needed a dress, or shoes, or money, when she was not
doing anything for Aunt Affy’s comfort.
Her last story had been refused, and how she had cried over the
refusal. It was even hard to laugh when Roger told her that Queen
Victoria had sent an article to a paper under a “pen-name” and it
had been “returned with thanks.” She wished she were a dressmaker
like Agnes Trembly, or that she could go into a farmer’s kitchen, like
Jean Draper’s sister Lottie, and earn money and not be ashamed.
Her eyes were suspiciously red, she was relieved that his back was
toward her; he wheeled around in his chair as she seated herself,
and looked as though he had nothing in the world to do but listen to
her.
“Have you leisure to hear my Girl Papers?” she asked, with some
embarrassment. “They are horrid. I tried an essay, and failed. It was
stilted and stupid. I can make girls talk, so I threw my garnered
information into a conversation. But you may not care for this style.”
After the first was read, with an inward quaking, she was delighted
with his word of encouragement:
“Read the others; I cannot know how bad they are until you read
them all.”
More hopefully she began the second paper, which she read in a
clear, conversational tone:—
“Do you know,” began grandmother, “who said that she could be
happy anywhere with good health and a bit of marble?”
“And now she’s older than you are, grandmother,” said Bess. “I like
to know about when grandmothers were little girls.”
“But she and Rosa Bonheur are not grandmothers. They have had
canvas and marble instead of a home with children and
grandchildren in it. As soon as little Harriet was old enough a pet
dog was given to her, and she ornamented it with ribbons and bells.
Instead of tin cup and iron spoon, which Rosa had, she revelled in all
the pretty things that children love. The River Charles ran past her
home; her father gave her a boat and told her to take her air and
sunshine on the water and learn to develop her muscles by the oars.
And then he had built for her a Venetian gondola with velvet
cushions and silver prow.
“‘She will be spoiled,’ the neighbors foreboded, but her wise father
was not afraid; he knew how much happiness his child could bear
and not be rendered selfish. The next thing to help her become
strong was a gun; she soon became what your brothers would call a
good shot. By and by you will know how strong her hands and arms
became and what she could do with them. All this time, just as you
are, girls, these common days, she was being made ready for her
own special work.”
“Her room was a museum. Gathered and prepared by her own eager
and wise hands she had beetles, snakes, bats, birds, stuffed or
preserved in spirits. From the egg of a sea gull and the body of a
kingfisher she made an ink-stand; she climbed to the top of a tree
for a crow’s nest. Miles and miles she learned to walk without being
wearied. In her work and habits and strength she was like a boy.
She was fond of books, but just as fond of the clay-pit in her garden
where, to her father’s delight as well as her own, she molded dogs
and horses.
“When Harriet Hosmer was taken to a famous school (at home they
called her ‘happy Hatty’) the teacher said: ‘I have a reputation for
training wild colts; I will try this one.’ She stayed three years. On her
return home she began to take lessons in drawing, modeling, and in
anatomical studies, often walking fourteen miles to Boston and back,
with hours of work and study. Was not that a day’s work? She went
to the Medical College of St. Louis to take a thorough course in
anatomy.”
“Grandmother, how hard girls can work!” exclaimed Nan, who did
not love work.
“After she had finished her studies she traveled alone to New
Orleans, and then north to the Falls of St. Anthony, smoking the pipe
of peace with the chief of the Dakota Indians, explored lead mines in
Dubuque, and scaled a high mountain to which her name was
afterward given.”
“That was fun,” said Nan. “I’m glad she had some fun with her hard
work.”
“After work in her studio at home her father sent her to Rome. Girl
as she was, in her studio at home she wielded for eight or ten hours
a day a leaden mallet weighing four pounds and a half. And it was
then she told a friend that she would not be homesick, for she could
be happy anywhere with good health and a bit of marble. For seven
years she worked on her ‘bit of marble’ in Rome. She made beautiful
and wonderful things with her good health and her marble, with
hard work, and the insight into beauty that God, who makes all
beautiful things, gave to this ready and obedient child.
“The first work she copied for her teacher was the Venus of Milo;
when almost completed the iron, which held the clay firm, snapped,
and all her work was spoiled.”
“But she did not shriek nor cry herself to sleep (that anybody knew),
but bravely went to work again. Her works were exhibited in Boston
and much admired. Her teacher said he had never seen surpassed
her genius of imitating the roundness and softness of flesh. Look at
other marble statues and see if the flesh looks soft and round like
Harriet’s. One of her works, a girl lying asleep, was exhibited in
London and in several American cities. She said once she would
work as though she had to earn her daily bread, and, strange to tell,
very soon after that her father wrote that he had lost his property
and could send her no more money. And then she hired a cheap
room, sold her handsome saddle-horse, and went to work in reality
to earn her daily bread. Her first work, in her time of sorrow, was a
fun-loving, four-year-old child. With the several copies she made
from it she earned for her daily bread thirty thousand dollars.”
With a shy glance into his satisfied face she opened her third paper:
—
“It is not a wonder that Maria Mitchell has great respect for girls who
do something, and for idle girls none at all. As Juliet was at
Nantucket last summer she will be interested to know that Maria
Mitchell was born in that quiet, delightful place. She was in a home
of ten children. Her mother was a Quaker girl, a descendant of
Benjamin Franklin. Her father was a school teacher. Little Maria went
to school to her father. At school she studied, and with ten little
people at home, what do you think she did? She herself calls her
work, ‘endless washing of dishes.’ The dishwashing never hindered. I
think it helped. I believe in dishwashing. I wonder what this little girl
would have thought of the dishwasher that some people have in
their kitchens, and is warranted to wash sixty-five dishes (in the
smaller affair) at once, in the soap-sudsy, steamy, crank-turning
space of three blessed minutes. And all dried, too. But in her
observatory she had no need to think of dishwashing. Like Rosa
Bonheur, and Harriet Hosmer, she had a good father and a wise
father. When he was eight years old his father called him to the door
to look at the planet Saturn, and from that time the boy calculated
his age from the position of the planet, year by year.”
“Then it began with her grandfather,” said Juliet, who liked to find
the beginnings of things.
“Her father had a little observatory of his own, on his own land, that
he might study the stars. So it is no marvel that his daughter is
ending her useful days in a big observatory. When Maria went to her
observatory, her father was seventy years of age; he needed her as
nurse and companion, but he said, ‘Go, and I will go with you.’”
“This is the loveliest story of all,” exclaimed Grace, who loves her
own old father dearly.
“For four years her father lived to be proud of her, and enjoyed her
work and her pupils at Vassar College. When Maria was a girl her
father could see no reason why she should not become as well
educated as his boys, so he gave her, as to them, a special drill in
navigation.”
“Grandmother,” asked Ethel, “did you know all these little girls when
they were little?”
“Yes, the women worked pretty things for the Tabernacle,” I said.
(For I love to make pretty things.)
“But she did know how to knit, and she knit stockings a yard long for
her father as long as he lived. She studied while she knit, as I used
to do when I was a little girl. When she was a little girl how she did
read! Before she was ten years old she read through Rollin’s Ancient
History.
“One night in October, 1847, she was gazing through her telescope,
and what do you think she saw? An unknown comet. She was afraid
it was an old story. Frederick VI., King of Denmark, sixteen years
before, had offered a gold medal to the person who should discover
a telescopic comet. And the little Nantucket girl, who had knitted
stockings a yard long, and washed endless dishes, discovered the
telescopic comet, and to her was awarded the gold medal. And now
the scientific journals announced Miss Mitchell’s comet. In England
she was eagerly welcomed by Sir John and Lady Herschel, and
Alexander Von Humboldt took her beside him on a sofa and talked to
her about everybody he knew and everything he knew. And, oh! the
other great people who were glad to see her. She saw in Rome
Frederika Bremer, of whose comical, interesting, sad girlhood I must
tell you some day. But I musn’t forget the little house Maria bought
for her father before she went to the observatory of Vassar College.
It cost sixteen hundred and fifty dollars, and she saved the money
out of her yearly salary of one hundred dollars, and what she could
earn in government work.”
“Good,” exclaimed Judith’s listener. “Keep on with the dozen, and salt
them down. When I Was a Boy series will be a good thing for you.
Judith, honest, now, would you rather go away to school this winter,
or read and write with Marion and me?”
“Study with you,” was the quick decision; “I can think of nothing in
the world I would like so well.”
“Upon whom are you dependent now? Are you not earning your
board by being co-operative housekeeper?”
“Ask Marion.”
“Roger, don’t be a goose,” she said, indignantly, “that was all very
well when I was a child. You forget that I am grown up.”
“Only just proud enough. You are exactly that. Let us live in peace
this winter, and then your nineteenth birthday may do its worst for
us all.”
“You will not be serious,” she answered, with vexed tears; “my life is
a great deal to me.”
“It is a great deal to us all, dear. Work and be patient, and you will
have as happy an ending as any story you write.”
“There is One who does know what to do with his children when
they grow up,” said Roger, bending as he stood beside her and
touching her lips with his own. It was the first time he had ever
kissed her. She took the kiss as gravely and simply as it was given.
Something was sealed between them. She would never be proud
with him again.
“I will not kiss you again,” said Roger to himself, “until you promise
to be my wife.”
“I am glad you did not ask Judith,” replied Marion, with something in
her voice.
“My point was not driving with you, but driving to Meadow Centre.”
“Haven’t you seen that Mr. King is interested in Judith?” she asked,
somewhat impatiently.
“Yes, I do mean—”
“What about her?” he asked with the color hot in his face. But
Marion was a “blind creature” then and did not see.
“I don’t know about her. She isn’t grown up enough to think. But I
know he is wonderfully attractive to her.”
“For pity’s sake, Roger, don’t think you must do anything,” cried
Marion, dismayed; “let her alone. He will take care of himself.”
“I hope you don’t call Meadow Centre one of the best things,”
retorted Marion.
This day, in which God’s daily bread and his daily will were given to
Judith as upon all the other days, was one of the very happiest days
of her happy life.
Roger’s kiss gave her an undefined sense of safety and protection; if
she were not wise enough to decide when the time came she would
take refuge in that safety and protection, and—another kiss.
That evening Joe came for her, saying Aunt Rody was worse. She
went home with him, and “watched” with Aunt Affy, until poor Aunt
Rody passed away from the home she had toiled so unceasingly for
and taken so little comfort in. One week she stayed with Aunt Affy:
“I miss her so,” wept Aunt Affy broken-heartedly; “I never was in the
world without her before.”
“Then we will have to adopt Joe; we must have some young thing
about the house.”
“How young must two people begin to grow old together?” inquired
Roger, comically.
“Oh, poor Don. Roger, I am afraid Don isn’t happy,” she said, with
slow emphasis.
What Roger thought he did not say.
Don’s letters were brief, constrained; Judith’s letter to her “new, dear
Cousin Florence” had met with no response—that Judith knew.
XXX. A TALK AND WHAT CAME OF IT.
“There is nothing which faith does not overcome; nothing
which it will not accept.”
—Bishop Huntington.
Marion and her mother had not returned from their drive to Meadow
Centre, where Mrs. Kenney had a school friend. They intended to
“spend an old-fashioned day,” Mrs. Kenney remarked at the
breakfast table; it was five o’clock in the November afternoon and
the old-fashioned day was not yet ended.
Judith and her fancy work, covers for Nettie’s bureau, had taken
possession of the light in the bay window; as the light faded, she sat
thinking with her work in her lap. Roger entered and threw himself
upon the lounge, clasping his hands above his head; his thinking
was weaving itself in and out of a suggestion of his mother’s that
she should take Judith home for the winter.
“Can you tell me exactly what you mean? Are you in the dark about
anything?”
“About everything,” she exclaimed with such energy that his only
reply was a laugh.
“Just now I mean one special thing that I cannot tell you about.”
“Growing into a new thing is the best way to outgrow an old thing.”
“I wish I could tell you. But I don’t know why I shouldn’t. I’m afraid
Marion doesn’t care for Mr. King, and I want her to so much.”
In the twilight she could not see the illumination in the face across
the room on the lounge.
ebookbell.com