what are the other types of variables in tasm

ex: bh,bl,cx


what else is there that i can use?

Dani AI

Generated

As correctly pointed out, bh/bl/cx are CPU registers — not assembler "variables." In TASM the usual way to create named storage is with data declarations (labels in a data segment) rather than trying to treat registers as long-term storage. Registers are limited and transient; data labels live in memory and are declared with assembler directives.

Common data directives you'll use in TASM include DB, DW, DD, DQ and DT (byte, word, doubleword, quadword, ten-byte real). Use DUP to create arrays and ? to reserve uninitialized space; EQU sets constants. A minimal example of declarations:

data segment
  myByte   db 0
  myWord   dw 0
  myDword  dd 0
  buffer   db 64 dup(?)
data ends

Practical notes and pitfalls: the assembler needs to know the operand size when memory references are ambiguous — use size qualifiers (for example BYTE PTR / WORD PTR) when required. Mixing sizes (accessing a 16-bit variable with an 8-bit instruction) will either be rejected or produce incorrect results. For local temporaries, reserve stack space or use the assembler's LOCAL/PROC features if available. Also be aware of assembler mode: TASM defaults to 16-bit code unless you enable 32-bit/386 support, so the set of available directives and register sizes depends on that mode.

For authoritative reference on instruction sizes and operand rules consult the Intel manuals (Intel SDM) and a practical x86 assembly guide such as the Wikibooks x86 pages (X86 Assembly).

Recommended Answers

All 2 Replies

Those are registers. Please see this page as some of those registers have special purposes:
http://en.wikipedia.org/wiki/X86

AX (ah, al)
BX (bh, bl)
CX (ch, cl)
DX (dh, dl)

--------------
Also investigate:
SI,DI,SP,BP,IP

...and the "flags"

If you still have DEBUG, you can run it and see those registers, pointers and flags (see attached picture):

thx

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.