ROM- .Web view8086/8088 Mnemonic _____ mnemonic ภอเต ภmnemonic ภอเต à¸

  • View
    223

  • Download
    0

Embed Size (px)

Text of ROM- .Web view8086/8088 Mnemonic _____ mnemonic à¸...

ROM-BIOS

1

1

CS344-321 Assembly Language Programming Appendix page

_______________________________________________________________________

Appendix A

Assembler and Linker

This course you can use any of the following software:

MicroSoft version 3.0

ASSEMBLER : MASM.EXE

LINKER : LINK.EXE

LIBRARY MANAGEMENT : LIB.EXE

UTILITY : EXE2BIN.COM

Borland version 4.1

ASSEMBLER : TASM.EXE

LINKER : TLINK.EXE

Public Domain (Arrow Soft) arrowsof.zip

ASSEMBLER : ASM.EXE

LINKER : VAL.EXE

UTILITY : X2B.COM

Assembling A Program

Method 1: assembling without a command line, just enter the assembler name:

MASM ASM

Source filename [.ASM]:

Input filename [.asm]:

Object filename [filename.OBJ]:

Object filename [filename.obj]:

Source listing [NUL.LST]:

Source listing [NUL.lst]:

Cross reference [NUL.CRF]:

Cross reference [NUL.crf]:

Press Enter if you dont want to output cross reference file, otherwise enter

[drive:]name [.extension]

Press Enter if you dont want to output listing file, otherwise enter

[drive:]name [.extension]

Press Enter if you want object file name as shown, otherwise enter

[drive:]name [.extension]

Enter only name of source or input filename if the extension is .asm, otherwise enter

[drive:] name [.extension]

Method 2: assembling with a command line:

The general format for using a command line to assemble is

masm/tasm/asm [options] source [, [object] ][, [listing] ][, [crossref] ] [;]

There are many options (see manual for more information), we will discuss some of them:

/MX Make public and external names case sensitive.

/ML Make all names case sensitive.

/MU Convert all names to uppercase.

Assume source file name is test.asm.

Example 1.

masm test,test,test,test or masm test, , , ; or masm test,,,,

will produce test.obj, test.lst, test.crf.

Example 2.

masm test,test,test; or masm test, ,test;

will produce test.obj, test.lst.

Example 3.

masm test;

will produce only test.obj.

Example 4.

masm /MX test;

Linking a Program

Method 1: liking without a command line, just enter the linker name:

LINK VAL

Object Modules [.OBJ]:

OBJ file(s):

RUN File [filename.EXE]:

EXE file [filename.exe]:

List File [NUL.MAP]:

LST file:

Libraries [.LIB]:

LIB files:

Note! If there are more than one object modules use + e.g. test1.obj+test2.obj. It is the same for libraries.

Method 2: linking with a command line:

The general format for using a command line to link is

link/tlink/val [options] objfile, exefile [, [mapfile] ][, [libraryfile] ] [;]

There are many options (see manual for more information).

Example 1. no library

link test,test,test; or link test, , ;

will produce test.exe, test.map

Example 2. There are two object files, test1.obj, test2.obj and no library.

link test1+test2,test;

will produce test.exe.

Example 3. There are two object files, test1.obj, test2.obj and one library, mylib.lib.

link test1+test2,test,,mylib

will produce test.exe, test.map.

Example 4. There are two object files, test1.obj, test2.obj and two libraries, mylib1.lib, mylib2.lib.

link test1+test2,test,,mylib1+mylib2

will produce test.exe, test.map.

Convert .EXE to .COM

exe2bin/x2b test.exe test.com

or

use option /t of tlink at linking time, e.g. tlink /t test;

Make a library

Example 1. To create a new library name mylib and insert test.obj,

lib

Library name: mylib

Library does not exist. Create? y

operations: test

List file:

Example 2. To insert test1.obj and delete test.obj in mylib.lib and make as a new library nmylib.lib.

lib

Library name: mylib

operations: test1-test

List file:

Output Library: nmylib

Note! you may use +objfile to add and objfile to delete

Appendix B

Reserve Words

Register Names

AH CH DL EDI GS

AL CL DS EDX IP

AX CS DX EIP SI

BH CX EAX ES SP

BL DH EBP ES SS

BP DI EBX ESI

BX DI ECX FS

Symbolic Instructions

AAA ARPL CDQ CMPSn ESC

AAD BOUND CLC CWDn HLT

AAM BSF CLD DAA IDIV

AAS BSR CLI DAS IMUL

ADC BTn CLTS DEC IN

ADD CALL CMC DIV INC

AND CBW CMP ENTER INSw

INT JNLE LOCK POPAD SCASn

INTO JNO LODSn POPF SETnn

IRET JNP LOOP POPFD SGDT

JA JNS LOOPE PUSH SHL

JAE JNZ LOOPNE PUSHAD SHLD

JB JO LOOPNZ PUSHF SHR

JBE JP LOOPZ PUSHFD SHRD

JCXZ JPE LSL RCL SIDT

JE JPO LSS RCR SLDT

JECXZ JS LSS REN SMSW

JG JZ LTR REP STC

JGE LAHF MOV REPE STD

JL LAR MOVSn REPNE STI

JLE LDS MOVSX REPNZ STOSn

JMP LEA MOVZX REPZ STR

JNA LEAVE MUL RET SUB

JNAE LES NEG RETF TEST

JNB LFS NOP ROL VERR

JNBE LGDT NOT ROR VERRW

JNE LGS OR SAHF WAIT

JNG LIDT OUTn SAL XCHG

JNGE LLDT POP SAR XLAT

JNL LMSW POPA SBB XOR

Directives

ALIGN ENDIF IFIDN PUBLIC

.ALPHA ENDM IFNB PURGE

ASSUME ENDP IFNDEF .RADIX

.CODE ENDS INCLUDE RECORD

COMM EQU INCLUDELIB REPT

COMMENT .ERRnn IRP .SALL

.CONST EVEN IRPC SEGMENT

.CREF EXITM LABEL .SEQ

.DATA EXTRN .LALL .SFCOND

.DATA? .FARDATA .LFCOND .STACK

DB .FARDATA? .LIST STRUC

DD GROUP LOCAL SUBTTL

DF IF MACRO .TFCOND

DOSSEG IFI .MODEL TITLE

DQ IF2 NAME .XALL

DT IFB ORG .XCREF

DW IFDEF OUT .XLIST

ELSE IFDIF PAGE

END IFE PROC

Operators

AND HIGH NEAR SHR

BYTE LE NOT SIZE

COMMENT LENGTH NOTHING STACK

CON LINE OFFSET THIS

DUP LOW OR TYPE

EQ LT PTR WIDTH

FAR MASK SEG WORD

GE MOD SHL XOR

GT NE SHORT

Appendix C

8086/8088 Mnemonic

___________________________________________________________________________________________

mnemonic

mnemonic

___________________________________________________________________________________________

AAAASCII adjust for addition

JNAEJump on not above or equal

AADASCII adjust for division

JNBJump on not below

AAMASCII adjust for multiplication

JNBEJump on not below or equal

AASASCII adjust for subtraction

JNCJump on not carry

ADCAdd with carry

JNEJump on not equal

ADDAdd

JNGJump on not greater

ANDAND

JNGEJump on not greater or equal

CALLCALL

JNLJump on not less than

CBWConvert byte to word

JNLEJump on not less than or equal

CLCClear carry flag

JNOJump on not overflow

CLDClear direction flag

JNPJump on not parity

CLIClear interrupt flag

JNSJon not sign

CMCComplement carry flag

JNZJump on not zero

CMPCompare

JOJump on overflow

CMPSCompare byte or word (of string)

JPJump on parity

CMPSBCompare byte string

JPEJump on parity even

CMPSWCompare word string

JPOJump on parity odd

CWDConvert word to double word

JSJump on sign

DAADecimal adjust for addition

JZJump

Recommended

View more >