Welcome to Linux Knowledge Base and Tutorial
"The place where you learn linux"
Cactus

 Create an AccountHome | Submit News | Your Account  

Tutorial Menu
Linux Tutorial Home
Table of Contents

· Introduction to Operating Systems
· Linux Basics
· Working with the System
· Shells and Utilities
· Editing Files
· Basic Administration
· The Operating System
· The X Windowing System
· The Computer Itself
· Networking
· System Monitoring
· Solving Problems
· Security
· Installing and Upgrading
· Linux and Windows

Glossary
MoreInfo
Man Pages
Linux Topics
Test Your Knowledge

Site Menu
Site Map
FAQ
Copyright Info
Terms of Use
Privacy Info
Disclaimer
WorkBoard
Thanks
Donations
Advertising
Masthead / Impressum
Your Account

Communication
Feedback
Forums
Private Messages
Surveys

Features
HOWTOs
News Archive
Submit News
Topics
User Articles
Web Links

Google
Google


The Web
linux-tutorial.info

Who's Online
There are currently, 213 guest(s) and 0 member(s) that are online.

You are an Anonymous user. You can register for free by clicking here

  

as86_encap



SYNOPSIS

       as86 [-0123agjuw] [-lm[list]] [-n name] [-o obj] [-b[bin]]
       [-s sym] [-t textseg] src

       as86_encap prog.s prog.v [prefix_] [as86 options]


DESCRIPTION

       as86 is an assembler for the 8086..80386 processors,  it's
       syntax  is  closer to the intel/microsoft form rather than
       the more normal generic form of the unix system assembler.

       The src file can be '-' to assemble the standard input.

       This assembler can be compiled to support the 6809 cpu and
       may even work.

       as86_encap is a shell script to call as86 and convert  the
       created  binary  into a C file prog.v to be included in or
       linked with programs  like  boot  block  installers.   The
       prefix_  argument is a prefix to be added to all variables
       defined by the source, it defaults  to  the  name  of  the
       source  file.  The  variables defined include prefix_start
       prefix_size and prefix_data  to  define  and  contain  the
       code,  plus integers containing the values of all exported
       labels.  Either or both the prog.s  and  prog.v  arguments
       can be '-' for standard in/out.


OPTIONS

       -0     start  with  16-bit  code  segment,  warn  for  all
              instructions > 8086

       -1     start  with  16-bit  code  segment,  warn  for  all
              instructions > 80186

       -2     start  with  16-bit  code  segment,  warn  for  all
              instructions > 80286

       -3     start with 32-bit code segment, don't warn for  any
              instructions. (not even 486 or 586)

       -a     enable  partial compatibility with Minix asld. This
              swaps the  interpretation  of  round  brackets  and
              square  brackets  as  well as making alterations to
              the code generation and syntax for 16bit jumps  and
              calls. ("jmp @(bx)" is then a valid instruction)

       -g     only put global symbols in object or symbol file

       -j     replace  all  short jumps with similar 16 or 32 bit
              are used.

       -l     produce list file, filename may follow

       -m     print macro expansions in listing

       -n     name of module follows (goes in object  instead  of
              source name)

       -o     produce object file, filename follows

       -b     produce  a  raw  binary  file, filename may follow.
              This is a 'raw' binary  file  with  no  header,  if
              there's no -s option the file starts at location 0.

       -s     produce an ASCII  symbol  file,  filename  follows.
              The  format of this table is designed to be easy to
              parse for encapsulation and related  activities  in
              relation  to  binary  files  created  with  the  -b
              option.  If a binary file doesn't start at location
              zero the first two items in the table are the start
              and end addresses of the binary file.

       -u     assume   undefined   symbols   are   imported-with-
              unspecified segment.

       -w-    allow the assembler to print warning messages.

       -t n   move all text segment data in segment n+3.


AS86 SOURCE

       Special characters

       *      Address of the start of the current line.

       ; !    Either  of  these  marks the start of a comment. In
              addition any 'unexpected' character at the start of
              a  line  is  assumed to be a comment (but it's also
              displayed to the terminal).

       $      Prefix for hexadecimal  numbers,  the  'C'  syntax,
              eg 0x1234, is also accepted.

       %      Prefix for binary numbers.

       #      Prefix for immediate operands.

       [ ]    Specifies an indirect operand.
              Unlike  MASM  the assembler has no type information
              on labels just a segment  and  offset.  This  means
              that the way this operator and the immediate prefix
                   mov ax,#1234
              Immediate value, ax becomes 1234.

                   mov ax,1234
                   mov ax,_hello
                   mov ax,[_hello]
              Absolute  addressing,  ax  is  set  to  contents of
              location  1234.  Note  the  third  option  is   not
              strictly consistant but is in place mainly for asld
              compatibility.

                   mov ax,_table[bx]
                   mov ax,_table[bx+si]
                   mov eax,_table[ebx*4]

                   mov ax,[bx+_table]
                   mov ax,[bx+si+_table]
                   mov eax,[ebx*4+_table]
              Indexed addressing, both formats are  ok,  I  think
              the  first  is  more correct but I tend to used the
              second. :-)

       Conditionals

       IF, ELSE, ELSEIF, ENDIF
              Numeric condition

       IFC, ELSEIFC
              String compare (str1,str2)

       FAIL .FAIL
              Generate user error.

       Segment related

       .TEXT .ROM .DATA .BSS
              Set current segment. These can be preceded  by  the
              keyword .SECT

       LOC    Set numeric segment 0=TEXT, 3=DATA,ROM,BSS, 14=MAX.
              The  segment  order  set  by  the  linker  is   now
              0,4,5,6,7,8,9,A,B,C,D,E,1,2,3.   Segment  0 and all
              segments above 3 are assumed to  be  text  segment.
              Note  the 64k size restrictions are not imposed for
              segments 3-14.

       Label type definition

       EXPORT PUBLIC .DEFINE
              Export label defined in this object

       Data definition

       DB .DATA1 .BYTE FCB
              List of 1 byte objects.

       DW .DATA2 .SHORT FDB .WORD
              List of 2 byte objects.

       DD .DATA4 .LONG
              List of 4 byte objects.

       .ASCII FCC
              Ascii string copied to output.

       .ASCIZ Ascii  string  copied  to  output with trailing nul
              byte.

       Space definition

       .BLKB RMB .SPACE
              Space is counted in bytes.

       .BLKW .ZEROW
              Space is counted in words. (2 bytes each)

       COMM .COMM LCOMM .LCOMM
              Common area data definition

       Other useful pseudo operations.

       .ALIGN .EVEN
              Alignment

       EQU    Define label

       SET    Define re-definable label

       ORG .ORG
              Set assemble location

       BLOCK  Set assemble location and stack old one

       ENDB   Return to stacked assemble location

       GET INCLUDE
              Insert new file (no quotes on name)

       USE16 [cpu]
              Define default operand size as 16 bit, argument  is
              cpu  type  the code is expected to run on (86, 186,
              286, 386, 486, 586)  instructions  for  cpus  later
              than specified give a warning.

       .MACLIST
              Macro listings on/off (1,-1)

       Macros, now working, the general form is like this.

           MACRO sax
              mov ax,#?1
           MEND
           sax(1)

       Unimplemented/unused.

       IDENT  Define object identity string.

       SETDP  Set DP value on 6809

       MAP    Set binary symbol table map number.

       Registers
              BP BX DI SI
              EAX EBP EBX ECX EDI EDX ESI ESP
              AX CX DX SP
              AH AL BH BL CH CL DH DL
              CS DS ES FS GS SS
              CR0 CR2 CR3 DR0 DR1 DR2 DR3 DR6 DR7
              TR3 TR4 TR5 TR6 TR7 ST

       Operand type specifiers
              BYTE  DWORD  FWORD  FAR  PTR PWORD QWORD TBYTE WORD
              NEAR

              The 'near and  'far'  do  not  allow  multi-segment
              programming,  all  'far'  operations  are specified
              explicitly through the  use  of  the  instructions:
              jmpi,  jmpf,  callf, retf, etc. The 'Near' operator
              can be  used  to  force  the  use  of  80386  16bit
              conditional   branches.   The  'Dword'  and  'word'
              operators can control the size of operands  on  far
              jumps and calls.

       General instructions.
              These  are  in general the same as the instructions
              found in any 8086 assembler,  the  main  exceptions
              being a few 'Bcc' (BCC, BNE, BGE, etc) instructions
              which are shorthands for a short branch plus a long
              jump  and  'BR'  which is the longest unconditional
              jump (16 or 32 bit).

       Long branches
              BCC BCS BEQ BGE BGT BHI BHIS BLE BLO BLOS  BLT  BMI
              BNE BPC BPL BPS BVC BVS BR
              BSWAP BT BTC BTR BTS CALL CBW CDQ CLC CLD CLI  CLTS
              CMC  CMP  CMPS  CMPSB CMPSD CMPSW CMPW CMPXCHG CSEG
              CWD CWDE DAA DAS DEC DIV DSEG ENTER HLT  IDIV  IMUL
              IN  INC INS INSB INSD INSW INT INTO INVD INVLPG INW
              IRET IRETD J JA JAE JB JBE JC JCXE  JCXZ  JE  JECXE
              JECXZ  JG  JGE JL JLE JMP JNA JNAE JNB JNBE JNC JNE
              JNG JNGE JNL JNLE JNO JNP JNS JNZ JO JP JPE JPO  JS
              JZ  LAHF  LAR  LDS  LEA LEAVE LES LFS LGDT LGS LIDT
              LLDT LMSW LOCK LODB LODS  LODSB  LODSD  LODSW  LODW
              LOOP LOOPE LOOPNE LOOPNZ LOOPZ LSL LSS LTR MOV MOVS
              MOVSB MOVSD MOVSW MOVSX MOVW MOVZX MUL NEG NOP  NOT
              OR  OUT  OUTS OUTSB OUTSD OUTSW OUTW POP POPA POPAD
              POPF POPFD PUSH PUSHA PUSHAD PUSHF PUSHFD  RCL  RCR
              REP  REPE  REPNE  REPNZ  REPZ RET RETF RETI ROL ROR
              SAHF SAL SAR SBB SCAB SCAS SCASB SCASD  SCASW  SCAW
              SEG SETA SETAE SETB SETBE SETC SETE SETG SETGE SETL
              SETLE SETNA SETNAE SETNB SETNBE SETNC  SETNE  SETNG
              SETNGE  SETNL  SETNLE  SETNO SETNP SETNS SETNZ SETO
              SETP SETPE SETPO SETS SETZ SGDT SHL SHLD  SHR  SHRD
              SIDT  SLDT  SMSW  STC STD STI STOB STOS STOSB STOSD
              STOSW STOW STR SUB TEST VERR VERW WAIT WBINVD  XADD
              XCHG XLAT XLATB XOR

       Floating point
              F2XM1  FABS  FADD  FADDP FBLD FBSTP FCHS FCLEX FCOM
              FCOMP FCOMPP FCOS FDECSTP FDISI  FDIV  FDIVP  FDIVR
              FDIVRP  FENI  FFREE FIADD FICOM FICOMP FIDIV FIDIVR
              FILD FIMUL FINCSTP FINIT FIST  FISTP  FISUB  FISUBR
              FLD  FLD1  FLDL2E FLDL2T FLDCW FLDENV FLDLG2 FLDLN2
              FLDPI FLDZ FMUL FMULP FNCLEX  FNDISI  FNENI  FNINIT
              FNOP  FNSAVE  FNSTCW  FNSTENV  FNSTSW  FPATAN FPREM
              FPREM1 FPTAN FRNDINT  FRSTOR  FSAVE  FSCALE  FSETPM
              FSIN FSINCOS FSQRT FST FSTCW FSTENV FSTP FSTSW FSUB
              FSUBP FSUBR FSUBRP FTST FUCOM FUCOMP FUCOMPP  FWAIT
              FXAM FXCH FXTRACT FYL2X FYL2XP1


Using GASP

       The  Gnu  assembler  preprocessor provides some reasonable
       implementations of user biased pseudo opcodes.

       It can be invoked in a form similar to:

       gasp   [-a...]  file.s [file2.s] |
              as86 [...]  - [-o obj] [-b bin]

       Be aware though that Gasp  generates  an  error  for  .org
       commands, if you're not using alternate syntax you can use
       org instead, otherwise use block and endb.  The  directive
       export is translated into .global, which forces an import,
       if you are making a file using -b use  public  or  .define
       instead.
       The checking for instructions that work on  specific  cpus
       is  probably  not  complete, the distinction between 80186
       and 80286 is especially problematic.

       The .text and .data pseudo operators are  not  useful  for
       raw binary files.

       When  using  the  org directive the assembler can generate
       object files that may break ld86(1).

                            Mar, 1999                     as86(1)

An undefined database error occurred. SELECT distinct pages.pagepath,pages.pageid FROM pages, page2command WHERE pages.pageid = page2command.pageid AND commandid =


  
Show your Support for the Linux Tutorial

Purchase one of the products from our new online shop. For each product you purchase, the Linux Tutorial gets a portion of the proceeds to help keep us going.


Login
Nickname

Password

Security Code
Security Code
Type Security Code


Don't have an account yet? You can create one. As a registered user you have some advantages like theme manager, comments configuration and post comments with your name.

Help if you can!


Amazon Wish List

Did You Know?
The Linux Tutorial can use your help.


Friends



Tell a Friend About Us

Bookmark and Share



Web site powered by PHP-Nuke

Is this information useful? At the very least you can help by spreading the word to your favorite newsgroups, mailing lists and forums.
All logos and trademarks in this site are property of their respective owner. The comments are property of their posters. Articles are the property of their respective owners. Unless otherwise stated in the body of the article, article content (C) 1994-2013 by James Mohr. All rights reserved. The stylized page/paper, as well as the terms "The Linux Tutorial", "The Linux Server Tutorial", "The Linux Knowledge Base and Tutorial" and "The place where you learn Linux" are service marks of James Mohr. All rights reserved.
The Linux Knowledge Base and Tutorial may contain links to sites on the Internet, which are owned and operated by third parties. The Linux Tutorial is not responsible for the content of any such third-party site. By viewing/utilizing this web site, you have agreed to our disclaimer, terms of use and privacy policy. Use of automated download software ("harvesters") such as wget, httrack, etc. causes the site to quickly exceed its bandwidth limitation and are therefore expressly prohibited. For more details on this, take a look here

PHP-Nuke Copyright © 2004 by Francisco Burzi. This is free software, and you may redistribute it under the GPL. PHP-Nuke comes with absolutely no warranty, for details, see the license.
Page Generation: 0.14 Seconds