This chapter describes the Watcom Assembler. It includes the following sections:
This chapter describes the Watcom Assembler. It takes as input an assembler source file (a file with extension .a) and produces, as output, an object file.
The Watcom Assembler command-line syntax is as follows:
wasm [options] asm_file [options] [@env_var]
The square brackets [ ] denote items that are optional.
The options supported by the Watcom Assembler are as follows:
For example,
-2 -3p -4pr -5p
Each of the model directives also defines __model__ (for example, .model small defines __SMALL__). They also affect whether something like foo proc is considered a far or near procedure.
It isn't the intention of this chapter to describe assembly-language programming in any detail. You should consult a book that deals with this topic. However, we present an alphabetically ordered list of the directives, opcodes and register names that are recognized by the assembler.
The following directives and opcodes are supported by the Watcom Assembler:
.186aaa
aad
aam
aas
abs
adc
add
ah
al
alias
align
and
arpl
assume
at
ax
basic
bh
bl
bound
bp
bsf
bsr
bswap
bt
btc
btr
bts
bx
byte
c
call
callf
cbw
cdq
ch
cl
clc
cld
cli
clts
cmc
cmp
cmps
cmpsb
cmpsd
cmpsw
cmpxchg
cmpxchg8b
.code
comm
comment
common
compact
.const
cpuid
cr0
cr2
cr3
cr4
cs
cwd
cwde
cx
daa
das
.data
.data?
db
dd
dec
df
dh
di
div
dl
.dosseg
dp
dq
dr0
dr1
dr2
dr3
dr6
dr7
ds
dt
dup
dw
dword
dx
eax
ebp
ebx
ecx
edi
edx
else
elseif
end
endif
endp
ends
enter
eq
equ
equ2
.err
.errb
.errdef
.errdif
.errdifi
.erre
.erridn
.erridnni
.errnb
.errndef
.errnz
error
es
esi
esp
even
export
extern
externdef
f2xm1
fabs
fadd
faddp
far
.fardata
.fardata2
farstack
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
flat
fld
fld1
fldcw
fldenv
fldenvd
fldenvw
fldl2e
fldl2t
fldlg2
fldln2
fldpi
fldz
fmul
fmulp
fnclex
fndisi
fneni
fninit
fnop
fnrstor
fnrstord
fnrstorw
fnsave
fnsaved
fnsavew
fnstcw
fnstenv
fnstenvd
fnstenvw
fnstsw
for
forc
fortran
fpatan
fprem
fprem1
fptan
frndint
frstor
frstord
frstorw
fs
fsave
fsaved
fsavew
fscale
fsetpm
fsin
fsincos
fsqrt
fst
fstcw
fstenv
fstenvd
fstenvw
fstp
fstsw
fsub
fsubp
fsubr
fsubrp
ftst
fucom
fucomp
fucompp
fwait
fword
fxam
fxch
fxtract
fyl2x
fyl2xp1
ge
global
group
gs
gt
hlt
huge
idiv
if
if1
if2
ifb
ifdef
ifdif
ifdifi
ife
ifidn
ifidni
ifnb
ifndef
ignore
imul
in
inc
include
includelib
ins
insb
insd
insw
int
into
invd
invlpg
iret
iretd
irp
ja
jae
jb
jbe
jc
jcxz
je
jecxz
jg
jge
jl
jle
jmp
jmpf
jna
jnae
jnb
jnbe
jnc
jne
jng
jnge
jnl
jnle
jno
jnp
jns
jnz
jo
jp
jpe
jpo
js
jz
label
lahf
lar
large
lds
le
lea
leave
length
lengthof
les
lfs
lgdt
lgs
lidt
lldt
lmsw
local
lock
lods
lodsb
lodsd
lodsw
loop
loope
loopne
loopnz
loopz
lsl
lss
lt
ltr
macro
medium
memory
mod
.model
mov
movs
movsb
movsd
movsw
movsx
movzx
mul
name
ne
near
nearstack
neg
no87
nop
not
nothing
offset
or
org
os_dos
os_os2
out
outs
outsb
outsd
outsw
para
pascal
pop
popa
popad
popf
popfd
private
proc
ptr
public
push
pusha
pushad
pushf
pushfd
pword
qword
rcl
rcr
rdmsr
rdtsc
readonly
rep
repe
repne
repnz
repz
ret
retf
retn
rol
ror
rsm
sahf
sal
sar
sbb
sbyte
scas
scasb
scasd
scasw
sdword
seg
segment
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
short
shr
shrd
si
sidt
size
sizeof
sldt
small
smsw
sp
ss
st
.stack
stc
std
stdcall
sti
stos
stosb
stosd
stosw
str
struc
struct
sub
sword
syscall
tbyte
test
textequ
tiny
tr3
tr4
tr5
tr6
tr7
use16
use32
uses
vararg
verr
verw
wait
watcom_c
wbinvd
word
wrmsr
xadd
xchg
xlat
xlatb
xor
Other assemblers support directives that this assembler doesn't. The following is a list of directives that are ignored by the Watcom Assembler (use of these directives results in a warning message):
.alphaThe following is a list of directives that are flagged by the Watcom Assembler (use of these directives results in an error message):
addr