- •1)Features of the Assembler. The main programs for work with the Assembler.
- •2) Data presentation in the computer. Binary and hexadecimal notations. Bits, bytes and words.
- •3)Main unprivileged commands. Data transfer.
- •4) Ways of addressing.
- •5) Dynamic libraries. Principles of using dynamic libraries.
- •6) Dynamic library structure.
- •7) File systems. Characteristics of files.
- •8) Numbers with a floating comma. Data types of fpu.
- •9) Work with the keyboard. The data buffer bios. Using ms dos function.
- •10) Base arithmetic fpu.
- •11)Comparison commands of fpu
- •12)Transcendental operations of fpu
- •Constants of fpu
- •16. Object modules.
- •17. Directive extern.
- •18) Directives call and invoke.
- •19) Use of libraries. Directive includelib.
- •20) Placement of data in external modules. Translation by tasm means.
- •21) Translation by masm means.
- •22) Directives of memory distribution. Pseudocommands of variable definitions.
- •23. Structures in the assembler
- •24. Program organization. Segments
- •25. Models of memory and the simplified directives of segment definition. Order of loading segments.
- •26. Procedures in the assembler
- •27. Programming bases in the Windows operating system
- •28. Call of the api functions from the program written on the assembler
- •29. Structure of the program written for Windows.
- •30. The general principles of creation of window applications in the Assembler
- •31. Directives of management of the program counter.
- •32. Global declarations.
- •33. Conditional assembling. Expressions
- •34. Attributes of the file. Temporary characteristics. File length.
- •35. File fat32 system. Catalogue structure. Fat table.
- •36. File ntfs system. Principles of construction.
- •37. Attributes of the records mft. Catalogues in ntfs.
- •38. Macrodefinitions. Blocks of repetitions. Macrooperators.
- •39. Management of files. Management of listing. Comments.
- •40) Virtual drivers and virtual Windows engines.
- •41) Modes of the user and kernel.
- •42) Types of Windows drivers.
- •44) Graphic video modes.
- •45) Work with a mouse.
- •46. System timer.
- •47. Services. Dispatcher of management of services.
- •49. Structure of the program which is writing down the driver in the system register.
- •50. Structure of the driver of the kernel mode.
- •1.Features of the Assembler. The main programs for work with the Assembler.
33. Conditional assembling. Expressions
At the majority of programming languages there are the commands, allowing to
ignore this or that site of the program depending on performance of conditions,
for example: in language C it is carried out by preprocessor commands #if, #ifdef,
#ifndef, etc. The assembler too gives such opportunity.
if expression
… … …
endif
If value of expression — zero (lie), all site of the program between IF and ENDIF
is ignored. The directive IF can be combined with ELSE and ELSEIF also:
if expression
… … …
else
… … …
endif
If value of expression — zero, is assembled a program site from ELSE to ENDIF,
otherwise — from IF to ELSE.
if expression1
… … …
elseif expression2
… … …
elseif expression3
… … …
else
… … ...
endif
So, if, for example, expression 2 isn't equal to zero, the program site between the
first and second directive ELSEIF will be assembled. If all three expressions are
equal to zero, the fragment from ELSE to ENDIF is assembled. This structure of
directives can be used in that specific case similar to operators of switch/case of
languages of high level, if expressions — checks of some constant on equality.
Except the general directives IF and ELSEIF assemblers support a set of special
commands, each of which checks a special condition:
IF1/ELSEIF1 — if the assembler carries out the first pass of assembling;
IF2/ELSEIF2 — if the assembler carries out the second pass of assembling (often doesn't
work at modern assemblers);
IFE expression/ELSEIFE expression — if expression is equal to zero (in a false manner);
IFDEF label/ELSEIFDEF label— if a label is defined;
IFNDEF label/ELSEIFNDEF label— if a label isn't defined;
IFB <argument>/ELSEIFB <argument> — if value of argument — a gap (these and all
following directives are used in macrodefinitions for check of parameters);
IFNB <argument>/ELSEIFNB <argument> — if value of argument — not a gap (it is used in macrodefinitions for check of the given parameters);
IFDIF <arg1>, <arg2>/ELSEIFDIF <arg1>, <arg2> — if arguments differ (with distinction of capital and small letters);
IFDIFI <arg1>, <arg2>/ELSEIFDIFI <arg1>, <arg2> — if arguments differ (without distinction of capital and small letters);
IFIDN <arg1>, <arg2>/ELSEIFIDN <arg1>, <arg2> — if arguments are identical (with distinction of capital and small letters);
IFIDNI <arg1>, <arg2>/ELSEIFIDNI <arg1>, <arg2> — if arguments are identical (without distinction of capital and small letters).
Expression — is a set of numbers, labels or the strings connected with each
other by operators.
Operator <> (angular brackets). The part of expression concluded in angular
brackets, isn't calculated, and applied as a string of symbols, for example:
message1 equ <foobar>
Operator () (parentheses). The part of expression concluded in parentheses, is
calculated first of all.
mov al, 2*(3+4); mov al, 14
Arithmetic operators: + (plus), – (minus), * (multiplication), / (integer division),
MOD (remainder of division). They carry out the corresponding arithmetic
actions.
mov al, 90 mod 7; mov al, 6
Besides, the unary minus concerns to arithmetic operators - a minus which put
before a negative number.
Logical operators: AND, NOT, OR, XOR (excluding OR), SHL (shift to the left),
SHR (shift to the right). These operators carry out the corresponding logical
actions.
mov ax, 1234h AND 4321h; mov ax, 0220h
Operators of comparison: EQ (equally), GE (it is more or equally), is (more) than
GT, LE (it is less or equally), is (less) than LT, NE (not equally). The result of
action of each of these operators — unit if the condition is satisfied, and zero — if
isn't carried out.
.errnz $ gt 65535 ;If the address more than 64 KB – a
mistake
Operators of addressing:
SEG expression — the segment address;
OFFSET expression — shift;
THIS type — the current address (MASM and TASM);
The PTR type expression — type redefinition;
LARGE expression — 32-bit shift (TASM and WASM);
SMALL expression — 16-bit shift (TASM and WASM);
SHORT expression — 8-bit shift.
