aboutsummaryrefslogtreecommitdiff
path: root/gas/doc
diff options
context:
space:
mode:
authorAlan Modra <amodra@gmail.com>1999-08-04 10:07:41 +0000
committerAlan Modra <amodra@gmail.com>1999-08-04 10:07:41 +0000
commiteecb386cd7d2df28baf22c22ba3b0a3a4e94fcd5 (patch)
tree28e4c1e3026c3aeb104d923bea3bc2f4781c60df /gas/doc
parent23b255aaddaf15fd568d27128f5c00d62a6486a6 (diff)
downloadgdb-eecb386cd7d2df28baf22c22ba3b0a3a4e94fcd5.zip
gdb-eecb386cd7d2df28baf22c22ba3b0a3a4e94fcd5.tar.gz
gdb-eecb386cd7d2df28baf22c22ba3b0a3a4e94fcd5.tar.bz2
Support for gcc to generate 16-bit i386 code. (.code16gcc)
Diffstat (limited to 'gas/doc')
-rw-r--r--gas/doc/c-i386.texi19
1 files changed, 15 insertions, 4 deletions
diff --git a/gas/doc/c-i386.texi b/gas/doc/c-i386.texi
index e27893b..8a9c85a 100644
--- a/gas/doc/c-i386.texi
+++ b/gas/doc/c-i386.texi
@@ -443,14 +443,25 @@ instructions is reversed from the Intel syntax.
@cindex i386 16-bit code
@cindex 16-bit code, i386
@cindex real-mode code, i386
+@cindex @code{code16gcc} directive, i386
@cindex @code{code16} directive, i386
@cindex @code{code32} directive, i386
While @code{@value{AS}} normally writes only ``pure'' 32-bit i386 code,
it also supports writing code to run in real mode or in 16-bit protected
-mode code segments. To do this, put a @samp{.code16} directive before
-the assembly language instructions to be run in 16-bit mode. You can
-switch @code{@value{AS}} back to writing normal 32-bit code with the
-@samp{.code32} directive.
+mode code segments. To do this, put a @samp{.code16} or
+@samp{.code16gcc} directive before the assembly language instructions to
+be run in 16-bit mode. You can switch @code{@value{AS}} back to writing
+normal 32-bit code with the @samp{.code32} directive.
+
+@samp{.code16gcc} provides experimental support for generating 16-bit
+code from gcc, and differs from @samp{.code16} in that @samp{call},
+@samp{ret}, @samp{enter}, @samp{leave}, @samp{push}, @samp{pop},
+@samp{pusha}, @samp{popa}, @samp{pushf}, and @samp{popf} instructions
+default to 32-bit size. This is so that the stack pointer is
+manipulated in the same way over function calls, allowing access to
+function parameters at the same stack offsets as in 32-bit mode.
+@samp{.code16gcc} also automatically adds address size prefixes where
+necessary to use the 32-bit addressing modes that gcc generates.
The code which @code{@value{AS}} generates in 16-bit mode will not
necessarily run on a 16-bit pre-80386 processor. To write code that