# Syntax for the 8086 emulator This shows the syntax for the 8086 emulator. The main reference for this was 8086 family user manual : i8086 manual : https://edge.edx.org/c4x/BITSPilani/EEE231/asset/8086_family_Users_Manual_1_.pdf
In some places the reference has also been taken from https://css.csail.mit.edu/6.858/2014/readings/i386/c17.htm, which is for 80386 instruction set, but as most of it is backward compatible, it applies to 8086. The opcodes and directives are case independent, but labels are case sensitive. In general this used little endian format. Lower byte first, then higher byte #### Structure of Program Note that all data directives must come before code directives and opcodes ```bash Data directives Code directives and opcodes ``` #### Commonly used terms :
Data Directives

Data directives supported by emulator

Code Directives

Code directives supported by emulator

Print Statements

This shows print commands syntax, which can be used in the code as well as in interactive user prompt.


For opcodes, detail explanation of what they do is given in 8086 family manual, this explains only the syntax.
Control Instructions
These are single opcode instructions.
STC,CLC,CMC,STD,CLD,STI,CLI,HLT,NOP are supported.
WAIT, ESC, and LOCK are not supported
Syntax : opcode
Control Transfer Instructions
int : Following interrupts are supported
  • int 3 : Can be used for debugging, displays user prompt
  • int 0x10 : value of AH allowed are : 0AH,13H
    0AH ignores BH & BL (page number and page attribute)
    13H ignores AL (write mode), BH & BL (page number and attributes), DH (row to print the string on), supports DL (column to print string on)
  • int 0x21 : value of AH allowed are : 1H,2H,0AH

into and iret are not supported

  • call : used for calling a procedure.

    syntax : call proc_name

  • ret : used for returning from a procedure.

    syntax : call

Bit Manipulation Instructions
Arithmetic Instructions
String Instructions
Instructions are : movs, lods,stos,cmps,scas
movsb, movsw are not supported
Syntax :
opcode byte
opcode word
The word and byte specifies if the string is byte string or word string
repeat instructions
rep supports movs,lods,stos
repe,repz,repne,repnz supports cmps, scas
Data Transfer Instructions
in,out,lds,les are not supported