ArticleslgStudy

science

Open Watcom Assembler

Open Watcom Assembler is a science topic covered in the lgStudy science library. This page brings together a partial reference excerpt, illustrations, worked examples, real-world applications and a short study plan, so you can understand Open Watcom Assembler rather than just read about it. In short: Open Watcom Assembler (WASM) is an x86 assembler produced by Watcom, based on the Watcom Assembler found in Watcom C/C++ compiler and Watcom FORTRAN 77. Further development is being done on the 32- and 64-bit JWASM project, which more closely matches the syntax of Microsoft's assembler.

Key takeaways

  • Open Watcom Assembler belongs to science; place it in that map before memorising details.
  • Learn the definition first, then one example that makes the definition concrete.
  • Connect Open Watcom Assembler to a quantity you can measure, compute or draw — that is where exam questions come from.
  • Reproduce the core statement of Open Watcom Assembler from memory before moving on to harder problems.

Reference excerpt

Open Watcom Assembler (WASM) is an x86 assembler produced by Watcom, based on the Watcom Assembler found in Watcom C/C++ compiler and Watcom FORTRAN 77. Further development is being done on the 32- and 64-bit JWASM project, which more closely matches the syntax of Microsoft's assembler. There are experimental assemblers for PowerPC, Alpha AXP, and MIPS.

Technical details

Assembler Native support for output formats Intel OMF output formats. Supports Intel x86 (Pentium MMX, Pentium III-4, 3DNow!, SSE and SSE2) instruction sets. Supports Microsoft macro assembler (MASM) 5 and 6 syntax (incomplete).

Disassembler There is an associated Watcom disassembler, wdis. The assembler does not have listing facilities; instead the use of wdis for generating listings is recommended. wdis can read OMF, COFF and ELF object files and PE and ELF executables. It supports 16-bit and 32-bit x86 instruction set including MMX, 3DNow!, SSE, SSE2, and SSE3. Support for PowerPC, Alpha AXP, MIPS, and SPARC V8 instruction sets is also built in.

WASM forks

JWasm JWasm is a fork of Wasm originated by Japheth with following features:

Native support for output formats Intel OMF (16/32-bit), MS COFF (32-bit and 64-bit), ELF (32-bit and 64-bit), Bin and DOS MZ. Precompiled JWasm binaries are available for DOS, Windows and Linux. For OS/2 and FreeBSD, makefiles are supplied. Supports Intel x86 (8086, 80186, 80286, 80386, 80486, Pentium, Pentium Pro), x86-64 instruction sets with SIMD (MMX, 3DNow!, SSE, SSE2, SSE3 and SSSE3, SSE4.1/2 (since Jwasm), AVX (since JWasm 2.06), VMX (Intel VT-x; AMD SVM, the latter though already implemented, currently still inactive) extensions (since JWasm 2.09)). JWasm is written in C. The source is portable and has successfully been tested with Open Watcom, MS VC, GCC and more. On Windows, JWasm can be used with both Win32Inc and Masm32. Since v2.01, it will also work with Sven B. Schreiber's SBS WALK32 Win32 Assembly Language Kit C header files can be converted to include files for JWasm with Japheth's own dedicated h2incX. JWasm's source code is released under the Sybase Open Watcom Public License, which allows free commercial and non-commercial use. Fully supports Microsoft macro assembler 6 syntax, all MASM 8 instructions sets. Japheth paused development (or rather, was out of contact) of JWASM in January 2014 with version 2.12pre, but currently continues work on project on GitHub, current (June 2024) version is 2.18. Also, others on the Masm32 forum picked up where Japheth once left off.

HJWasm HJWasm, adding the prefix H in reference to Masm32 forum member Habran who started off this second WASM development continuation. Version 2.13pre was originally announced in 2016. New features include:

Instructions: SIMD: MMX: MOVQ added in 2.13, to supplement MOVD. AVX2: VGATHERDPD, VGATHERQPD, VGATHERDPS, VGATHERQPS, VPGATHERDD, VPGATHERQD, VPGATHERDQ, VPGATHERQQ, VEX-encoded general purpose instructions added in 2.13. Remaining instructions added in 2.16. AVX-512: VCMPxxPD, VCMPxxPS, VCMPxxSD, VCMPxxPD, VCMPxxSS, AVX-512F set, EVEX-encoded instructions added in 2.13; VMOVQ added 2.13, to supplement MOVD. Remaining instructions added in 2.16. Random Number Generator: RDRAND, RDSEED added in 2.13. half-precision conversions: F16C (VCVTPH2PS, VCVTPS2PH) added in 2.13. Intel MPX: Added in 2.31. Registers: RIP, ZMM registers added in 2.13. OO language extension added in 2.25.

HASM HASM is a renamed version of HJWASM, starting in version 2.33. The name was used following a MASM Forum discussion thread that originally proposed a replacement name. The name HASM was proposed by forum member habran in Reply #6, and was finalized at the end of discussion thread at Reply #33. No known features are added in HASM's release cycle.

UASM The name was actually used in version 2.33 (dated 2017-05-20) at Terraspace ltd's product page, but it was only announced in version 2.34. Changes to HJWASM includes:

Instruction sets: RDPID added in 2.38. AVX-512: VAESDEC added in 2.38 Data transfer: MOVBE added in 2.47. MOVABS added in 2.48. Intel ADX: ADCX, ADOX added in 2.38 Intel MPX: Support of BND prefix added in 2.34. BND prefix removed from JCXZ instruction group in 2.40. CLMUL instruction set: Added in 2.46.8, including pseudo-op forms of CLMUL. Hashing: SHA instruction set added in 2.46.8. Supervisor Mode Access Prevention: CLAC added in 2.38. Persistent Memory Extensions: CLFLUSHOPT added in 2.38. Addressing modes: 64-bit absolute immediate (2.37) Identified types Record types: fully supports registers and up to 32bit record fields in 2.41. Support for 128-bit SIMD: Added in 2.42, inline declaration with the type added in 2.43.1 / .2. Support of typedef chain on return types added in 2.46.8. m512 built-in types added in 2.47. Console color coding: Added for Windows, OSX and Linux in 2.43.1 / .2. Function calling: C-style function calling added in 2.46.

References

External links WASM assembler wiki JWasm Terraspace ltd pages: HJWASM, Hasm, UASM

Worked examples

Example 1 — a first encounter with Open Watcom Assembler

Start with the simplest possible case. Write down what Open Watcom Assembler claims or describes in one sentence, then invent the smallest concrete situation in which that sentence is true. In science, the smallest case is usually a single object, a single equation or a single measurement. Check that every symbol or term in your sentence has a meaning in that case.

Example 2 — changing one variable

Take the situation from Example 1 and change exactly one quantity: double it, halve it, or set it to zero. Predict what should happen to Open Watcom Assembler before you calculate. Comparing your prediction with the result is the fastest way to find out whether you understand the idea or only the words.

Example 3 — an exam-style question

Typical questions about Open Watcom Assembler ask you to (a) state it precisely, (b) apply it to given data, and (c) explain a limitation. Practise writing all three answers in under five minutes; the third part is what separates a full-mark answer from an average one.

Applications of Open Watcom Assembler

In research
Open Watcom Assembler appears in science research whenever the underlying quantities have to be modelled precisely. Papers usually cite it as a starting assumption and then explore where it breaks down.
In technology and industry
Engineering practice reuses Open Watcom Assembler in design rules, simulations and safety margins. Knowing the idea lets you read a specification sheet and understand why the numbers look the way they do.
In the classroom
Open Watcom Assembler is common in secondary-school and first-year university syllabi. It links to neighbouring topics Assemblers, so understanding it makes those chapters shorter.
In everyday life
Look for Open Watcom Assembler outside the textbook — in sport, cooking, traffic, electronics or the sky above you. An example you found yourself is remembered far longer than one you were given.
Ask Teacher Smith questions about this articleOpens your AI tutor with a question about “Open Watcom Assembler” →

How to study Open Watcom Assembler in 20 minutes

  1. Read the reference excerpt below once, without taking notes.
  2. Close the page and write down what Open Watcom Assembler means in your own words.
  3. Compare your version with the excerpt and mark what you missed.
  4. Work through the three examples above with pen and paper.
  5. Explain Open Watcom Assembler out loud to somebody else — or to Teacher Smith in the lgStudy chat.

Frequently asked questions

What is Open Watcom Assembler in simple terms?

Open Watcom Assembler (WASM) is an x86 assembler produced by Watcom, based on the Watcom Assembler found in Watcom C/C++ compiler and Watcom FORTRAN 77. Further development is being done on the 32- and 64-bit JWASM project, which more closely matches the syntax of Microsoft's assembler.

Why does Open Watcom Assembler matter?

Because it connects several science ideas at once: it gives you a definition you can apply, a quantity you can calculate, and a way to check whether a result is plausible.

How should I study Open Watcom Assembler?

Read the excerpt, restate it from memory, then work through the examples and applications listed on this page. The five-step study plan above takes about twenty minutes.

What does this page cover?

It gives you a compact reference excerpt plus original lgStudy explanations, examples, applications and study material on Open Watcom Assembler.

Tags

  • Assemblers

Keep exploring