{\rtf1\windows\deff0\deflang1024
{\fonttbl
{\f0\froman Times New Roman;}
{\f1\froman Symbol;}
{\f2\fswiss Arial;}
{\f3\froman MS Serif;}
{\f4\fswiss MS Sans Serif;}
}
{\colortbl;
\red0\green0\blue0;
\red0\green0\blue255;
\red0\green255\blue255;
\red0\green255\blue0;
\red255\green0\blue255;
\red255\green0\blue0;
\red255\green255\blue0;
\red255\green255\blue255;
\red0\green0\blue127;
\red0\green127\blue127;
\red0\green127\blue0;
\red127\green0\blue127;
\red127\green0\blue0;
\red127\green127\blue0;
\red127\green127\blue127;
\red192\green192\blue192;

#{\footnote IDH_ParentTopic}

#{\footnote IDH_Main}
\keepn
{\f2\b\cf7  LOCAL ASSEMBLER FOR VB6}
\par\pard
\par
{\f4 {\uldb Learning}{\v IDH_WhatASM}\par
{\uldb Compile/Assemble}{\v IDH_Compile}\par
{\uldb Execute}{\v IDH_Exec}\par
{\uldb Data types}{\v IDH_Types}\par
{\uldb Type-declaration character}{\v IDH_TypeID}\par
{\uldb Constants}{\v IDH_Constants}\par
{\uldb Comments}{\v IDH_Comments}\par
{\uldb Number systems}{\v IDH_NS}\par
{\ul Abbreviations}{\v IDH_Abbreviations}\par
{\uldb List of supported commands}{\v IDH_Commands}\par
{\uldb Features}{\v IDH_Features}\par
{\uldb Keeping code in program}{\v IDH_Keeping}\par
\par
{\uldb About LASM}{\v IDH_About}\par
}\page
#{\footnote IDH_Abbreviations}
{\f2\b\cf6 r8} - {\cf2 AL,CL,DL,BL,AH,CH,DH,BH}\par
{\f2\b\cf6 r16} - {\cf2 AX,CX,DX,BX,SP,BP,SI,DI}\par
{\f2\b\cf6 r32} - {\cf2 EAX,ECX,EDX,EBX,ESP,EBP,ESI,EDI}\par
\par
{\f2\b\cf6 m8} - {\cf2\b BYTE PTR} {\cf2[}{\cf6 r32}{\cf2]}\par
{\f2\b\cf6 m16} - {\cf2\b WORD PTR} {\cf2[}{\cf6 r32}{\cf2]}\par
{\f2\b\cf6 m32} - {\cf2\b DWORD PTR} {\cf2[}{\cf6 r32}{\cf2]}\par
\par
{\f2\b\cf6 imm8} - {\cf2 BYTE} (0 to 2^8-1)\par
{\f2\b\cf6 imm16} - {\cf2 WORD} (0 to 2^16-1)\par
{\f2\b\cf6 imm32} - {\cf2 DWORD} (0 to 2^32-1)\par
\par
{\f2\b\cf6 sr} - {\cf2 CS,SS,DS,ES,FS,GS}\par
{\f2\b\cf6 r/m} - {\cf6 r} or {\cf6 m}\par
{\f2\b\cf6 Rel} - Signed offset for jumps or calls\page
#{\footnote IDH_Commands}
\keepn
{\b\cf2\f2 Mnemonic} | {\ul \b Operands;\b}{\v IDH_Abbreviations} | ({\f2\cf8 Variants}/)
\par\pard
\b{\cf2 AAA}\b0\par
\b {\cf2 AAD} \b0\par
\b {\cf2 AAM} \b0\par
\b {\cf2 AAS} \b0\par
\b {\cf2 ADC} \b0 {\cf13 r/m8,r; r8,m8; r/m8,imm8; r/m16,r; r16,m16; r/m16,imm16; r/m32,r32; r32,m32; r/m32,imm32}\par
\b {\cf2 ADD} \b0 {\cf13 r/m8,r; r8,m8; r/m8,imm8; r/m16,r; r16,m16; r/m16,imm16; r/m32,r32; r32,m32; r/m32,imm32}\par
\b {\cf2 AND} \b0 {\cf13 r/m8,r; r8,m8; r/m8,imm8; r/m16,r; r16,m16; r/m16,imm16; r/m32,r32; r32,m32; r/m32,imm32}\par
\b {\cf2 BOUND} \b0 {\cf13 r16,r/m16; r32,r/m32}\par
\b {\cf2 BSF} \b0 {\cf13 r16,r/m16; r32,r/m32}\par
\b {\cf2 BSR}\b0  {\cf13 r16,r/m16; r32,r/m32}\par
\b{\cf2 BSWAP}\b0  {\cf13 r32}\par
\b {\cf2 BT}\b0  {\cf13  r/m16,r16; r/m16,imm8; r/m32,r32; r/m32,imm8}\par
\b {\cf2 BTS}\b0  {\cf13 r/m16,r16; r/m16,imm8; r/m32,r32; r/m32,imm8}\par
\b {\cf2 BTR}\b0  {\cf13 r/m16,r16; r/m16,imm8; r/m32,r32; r/m32,imm8}\par
\b {\cf2 BTC}\b0  {\cf13 r/m16,r16; r/m16,imm8; r/m32,r32; r/m32,imm8}\par
\b {\cf2 CALL}\b0  {\cf13 r/m8; r/m16; r/m32; rel8; rel16; rel32}\par
\b {\cf2 CBW}\b0\par
\b {\cf2 CDQ}\b0\par
\b {\cf2 CMPS}\b0  {\cf13 N/A} (CMPSB/ CMPSW/ CMPSD)\par
\b {\cf2 CMPXCHG}\b0 {\cf13  r/m8,r8; r/m16,r16; r/m32,r32}\par
\b {\cf2 CONST}\b0 {\cf13  EQU Expression; = Expression}\par
\b {\cf2 CMP}\b0 {\cf13  r/m8,r; r8,m8; r/m8,imm8; r/m16,r; r16,m16; r/m16,imm16; r/m32,r32; r32,m32; r/m32,imm32}\par
\b {\cf2 CWD}\b0\par
\b {\cf2 CWDE}\b0\par
\b {\cf2 DAA}\b0\par
\b {\cf2 DAS}\b0\par
\b {\cf2 DB}\b0 {\cf13  imm8; "String"}\par
\b {\cf2 DD}\b0 {\cf13  imm32; "String"}\par
\b {\cf2 DEC}\b0 {\cf13  r/m8; r/m16; r/m32}\par
\b {\cf2 DIV}\b0 {\cf13  r/m8; r/m16; r/m32}\par
\b {\cf2 DW}\b0 {\cf13  imm16; "String"}\par
\b {\cf15 EXIT FUNCTION}\b0 {\cf13  N/A} (END)\par
\b {\cf2 END}\b0 {\cf13  None/imm16} (EXIT FUNCTION)\par
\b {\cf2 ENTER}\b0 {\cf13  imm16,imm8}\par
\b {\cf2 FLAGS}\b0 {\cf13  N/A} (CLC/ STC/ CMC/ CLD/ STD/ CLI/ STI/ LAHF/ SAHF/ PUSHF/ PUSHFD/ POPF/ POPFD)\par
\b {\cf2 FWAIT}\b0\par
\b {\cf2 HLT}\b0\par
\b {\cf2 IMUL}\b0 {\cf13  r/m8; r/m16; r/m32}\par
\b {\cf2 IDIV}\b0 {\cf13  r/m8; r/m16; r/m32}\par
\b {\cf2 IN} \b0 {\cf13  AL/AX/EAX,imm8; AL/AX/EAX,DX}\par
\b {\cf2 INC}\b0 {\cf13  r/m8; r/m16; r/m32}\par
\b {\cf2 INS}\b0 {\cf13  N/A} (INSB / INSW / INSD)\par
\b {\cf2 INT}\b0 {\cf13  imm8}\par
\b {\cf2 INTO}\b0\par
\b {\cf2 IRET}\b0\par
\b {\cf2 IRETD}\b0\par
\b {\cf2 JMP}\b0 {\cf13  r/m8; r/m16; r/m32; rel8; rel16; rel32/Label}\par
\b {\cf2 J...}\b0 {\cf13  Label} (JO/ JNO/ JB/ JC/ JNAE/ JAE/ JNB/ JNC/ JE/ JZ/ JNE/ JNZ/ JBE/ JNA/ JA/ JNBE/ JS/ JNS/ JP/ JPE/ JPO/ JNP/ JL/ JNGE/ JGE/ JNL/ JLE/ JNG/ JG/ JNLE)\par
\b {\cf2 JCXZ}\b0 {\cf13  Label}\par
\b {\cf2 JECXZ}\b0 {\cf13  Label}\par
\b {\cf2 LAR}\b0 {\cf13  r16,r/m16; r32,r/m32}\par
\b {\cf2 LEA}\b0 {\cf13  r16,r/m16; r32,r/m32}\par
\b {\cf2 LEAVE}\b0\par
\b {\cf2 LOCK}\b0\par
\b {\cf2 LODS}\b0 {\cf13  N/A} (LODSB / LODSW / LODSD)\par
\b {\cf2 LOOP}\b0 {\cf13  Label}\par
\b {\cf2 LOOPNE,LOOPNZ}\b0 {\cf13  Label}\par
\b {\cf2 LOOPE,LOOPZ}\b0 {\cf13  Label}\par
\b {\cf2 MOV}\b0 {\cf13  r/m8,r8; r,m8; r/m8,imm8; r/m16,r16; r,m16; r/m16,imm16; r/m32,r32; r,m32; r/m32,imm32/Label}\par
\b {\cf2 MOVS}\b0 {\cf13}  N/A (MOVSB / MOVSW / MOVSD)\par
\b {\cf2 MOVSX}\b0 {\cf13  r16,r/m8; r32,r/m8; r32,r/m16}\par
\b {\cf2 MOVZX}\b0 {\cf13  r16,r/m8; r32,r/m8; r32,r/m16}\par
\b {\cf2 MUL}\b0 {\cf13  r/m8; r/m16; r/m32}\par
\b {\cf2 NEG}\b0 {\cf13  r/m8; r/m16; r/m32}\par
\b {\cf2 NOP}\b0\par
\b {\cf2 NOT}\b0 {\cf13  r/m8; r/m16; r/m32}\par
\b {\cf2 OR}\b0 {\cf13  r/m8,r; r8,m8; r/m8,imm8; r/m16,r; r16,m16; r/m16,imm16; r/m32,r32; r32,m32; r/m32,imm32}\par
\b {\cf2 OUT}\b0 {\cf13  imm8,AL/AX/EAX; DX,AL/AX/EAX}\par
\b {\cf2 OUTS}\b0 {\cf13  N/A} (OUTSB / OUTSW / OUTSD)\par
\b {\cf2 POP}\b0 {\cf13  r/m8; r/m16; r/m32; imm8; imm16; imm32; sr}\par
\b {\cf2 POPAD}\b0\par
\b {\cf2 PUSH}\b0 {\cf13  r/m8; r/m16; r/m32; imm8; imm16; imm32; sr}\par
\b {\cf2 PUSHAD}\b0\par
\b {\cf2 RCL}\b0 {\cf13  r/m8,1; r/m8,CL; r/m8,imm8; r/m16,1; r/m16,CL; r/m16,imm8; r/m32,1; r/m32,CL; r/m32,imm8}\par
\b {\cf2 RCR}\b0 {\cf13  r/m8,1; r/m8,CL; r/m8,imm8; r/m16,1; r/m16,CL; r/m16,imm8; r/m32,1; r/m32,CL; r/m32,imm8}\par
\b {\cf2 REP}\b0 {\cf13  INS; MOVS; OUTS; LODS; STOS}\par
\b {\cf2 REPE/REPZ}\b0 {\cf13  CMPS; SCAS}\par
\b {\cf2 REPNE/REPNZ}\b0 {\cf13  CMPS; SCAS}\par
\b {\cf2 RET}\b0 {\cf13  imm8; imm16; imm32}\par
\b {\cf2 RETF}\b0\par
\b {\cf2 RETN}\b0\par
\b {\cf2 ROL}\b0 {\cf13  r/m8,1; r/m8,CL; r/m8,imm8; r/m16,1; r/m16,CL; r/m16,imm8; r/m32,1; r/m32,CL; r/m32,imm8}\par
\b {\cf2 ROR}\b0 {\cf13  r/m8,1; r/m8,CL; r/m8,imm8; r/m16,1; r/m16,CL; r/m16,imm8; r/m32,1; r/m32,CL; r/m32,imm8}\par
\b {\cf2 SAL}\b0 {\cf13  r/m8,1; r/m8,CL; r/m8,imm8; r/m16,1; r/m16,CL; r/m16,imm8; r/m32,1; r/m32,CL; r/m32,imm8}\par
\b {\cf2 SAR}\b0 {\cf13  r/m8,1; r/m8,CL; r/m8,imm8; r/m16,1; r/m16,CL; r/m16,imm8; r/m32,1; r/m32,CL; r/m32,imm8}\par
\b {\cf2 SBB}\b0 {\cf13  r/m8,r; r8,m8; r/m8,imm8; r/m16,r; r16,m16; r/m16,imm16; r/m32,r32; r32,m32; r/m32,imm32}\par
\b {\cf2 SCAS}\b0 {\cf13  N/A} (SCASB / SCASW / SCASD)\par
\b {\cf2 SET}\b0 {\cf13  N/A} (SETO/ SETNO/ SETB/ SETNAE/ SETC/ SETNC/ SETNB/ SETAE/ SETE/ SETZ/ SETNE/ SETNZ/ SETBE/ SETNA/ SETA/  SETS/ SETNS/ SETP/ SETPE/ SETNP/ SETPO/ SETL/ SETNGE/ SETGE/ SETNL/ SETLE/ SETNG/ SETG/ SETNLE)\par
\b {\cf2 SHL}\b0 {\cf13  r/m8,1; r/m8,CL; r/m8,imm8; r/m16,1; r/m16,CL; r/m16,imm8; r/m32,1; r/m32,CL; r/m32,imm8}\par
\b {\cf2 SHR}\b0 {\cf13  r/m8,1; r/m8,CL; r/m8,imm8; r/m16,1; r/m16,CL; r/m16,imm8; r/m32,1; r/m32,CL; r/m32,imm8}\par
\b {\cf2 STOS}\b0 {\cf13  N/A} (STOSB / STOSW / STOSD)\par
\b {\cf2 SUB}\b0 {\cf13  r/m8,r; r8,m8; r/m8,imm8; r/m16,r; r16,m16; r/m16,imm16; r/m32,r32; r32,m32; r/m32,imm32}\par
\b {\cf2 TEST}\b0 {\cf13  r/m8,r8; r/m8,imm8; r/m16,imm16; r/m16,r16; r/m32,r32; r/m32,imm32}\par
\b {\cf2 VERR}\b0 {\cf13  r/m16; r/m32}\par
\b {\cf2 VERW}\b0 {\cf13  r/m16; r/m32}\par
\b {\cf2 WAIT}\b0\par
\b {\cf2 XCHG}\b0 {\cf13  r/m8,r8; r8,r/m8; r/m16,r16; r16,r/m16; r/m32,r32; r32,r/m32}\par
\b {\cf2 XLAT}\b0\par
\b {\cf2 XLATB}\b0\par
\b {\cf2 XOR}\b0 {\cf13  r/m8,r; r8,m8; r/m8,imm8; r/m16,r; r16,m16; r/m16,imm16; r/m32,r32; r32,m32; r/m32,imm32}\par
\brdrb 
  \par\pard
See also: {\uldb Intel Hex Opcodes And Mnemonics}{\v !{\footnote ExecFile('Opcodes.hlp',,1,)}} \par
\page
#{\footnote IDH_WhatASM}
\keepn
{\f2\b\cf7  LEARNING ASSEMBLER}
\par\pard
 {\cf11\b What is assembler (assembly language) ?}\par
 - Assembler is a language that allows full control of the processor (CPU).\par
\par
 {\cf11\b What is the differrence between Assembler and a high level programming language?}\par
- High level programming language can't fully control the processor. \par
- In HLPL the CPU instructions are picked by the compiler. \par
\par
 {\cf11\b What languages are related to assembler? }\par
 - Machine language, assembler is translated into machine language.\par
\par
 {\cf11\b What is the difference between Assembler and machine language? }\par
 - In machine language similar operations can have a different operation codes. \par
  \i The code is stored as a file of bytes\i0 . \par
   Assembler language groups operations (instructions) under one mnemonic name. \par
  \i The code is text\i0 . \par
\par
 {\cf11\b How can I create a program in assembler? }\par
 Assembler source can contains one operation per line. It can be one of the following:\par
  {\cf2 Operation}\par
  {\cf2 Operation} {\cf6 Operand}\par
  {\cf2 Operation} {\cf6 Destination}, {\cf6 Source}\par
  {\cf2 Jump} {\cf6 Address}\par
\par
 {\cf11\b What is Operation,Operand, Destination, Source and Address?}\par
 Operation - assembler syntax, Operand - one from: Register, Memory, Immediate value.\par
 Memory it is a big array of 32-bit elements. Address - index of element in array.\par
\par
 {\cf11\b What is Register, Memory and Immediate?}\par
 Register - variable inside processor. Processor works mainly with registers. In assembly language each register has a name. The generic names for the registers are {\ul r8,r16,r32}{\v IDH_Abbreviations}.\par
 The sizes are :  8 bits ( 1 byte ) for r8, 16 bits ( 2 bytes/ 1 word) for r16, 32 bits (4 bytes/2 words) for r32.\par
 To execute operation you must put source and destination into registers.\par
 The processor will do an operation (with registers), specified by the {\uldb mnemonic}{\v IDH_Commands}. For example ADD EAX,EBX. Processor does: EAX=EAX+EBX\par
 Memory - pointer to memory address (one from {\ul m8,m16,m32}{\v IDH_Abbreviations}). For example if EAX=5, then memory = value by address 5.\par
 Immediate value - number in range of assembler data type (one from {\ul imm8, imm16, imm32}{\v IDH_Abbreviations}).\par
\par
 {\cf11\b Which data types supported in assembler?}\par
 It is BYTE, WORD(2 bytes) and DWORD(4 bytes).\par
\trgaph60\cellx1220\cellx2000\cellx4000\cellx6000\cellx7220
\intbl
\b NAME\b0 \cell
\b LEN\b0 \cell
\b DECIMAL\b0 \cell
\b HEXADECIMAL\b0 \cell
\b BINARY\b0 \cell
\row
\intbl
{\cf13\b BYTE}\cell
8 bit\cell
0 to 255\cell
0 to &HFF\cell
0 to 2^8-1\cell
\row
\intbl
{\cf13\b WORD}\cell
16 bit\cell
0 to 65535\cell
0 to &HFFFF\cell
0 to 2^16-1\cell
\row
\intbl
{\cf13\b DWORD}\cell
32 bit\cell
0 to 4,294,967,295\cell
0 to &HFFFFFFFF\cell
0 to 2^32-1\cell
\row
\trowd\par
 BYTE - {\ul r8,m8,imm8}{\v IDH_Abbreviations}; WORD - {\ul r16,m16,imm16}{\v IDH_Abbreviations}; DWORD - {\ul r32,m32,imm32}{\v IDH_Abbreviations}\par
 In Intel processors register's separated into 4 parts. Two 8-bit parts, one 16-bit and one full 32-bit.\par
 {\ul r8}{\v IDH_Abbreviations} - 8-bit part of register, {\ul m8}{\v IDH_Abbreviations} - 8-bit part of memory, {\ul imm8}{\v IDH_Abbreviations} - number in range of BYTE.\par
 An example the parts of the Accumulator register, 8-bit AL and AH, 16-bit AX, 32-bit EAX \par
\par
 {\cf11\b How can I run an assembler program?}\par
 {\f4\b\i See topics:}{\uldb Compile}{\v IDH_Compile} and {\uldb Execute}{\v IDH_Exec}\par
\par
 {\cf11\b Where must I write an assembler programm? Can i write it inside VB?}\par
 You can write an assembler program in any text editor or in LASM IDE.\par
 No you cannot write LASM program in VB IDE, but you can use {\uldb Inline Assembler}{\v !{\footnote ExecFile('http://www.persistentrealities.com/files/inlineasm.zip',,1,)}} for it (http://www.persistentrealities.com/files/inlineasm.zip)\par\page
#{\footnote IDH_Compile}
\keepn
{\f2\b\cf7  COMPILE/ASSEMBLE}
\par\pard
{\cf11\b How to compile ASM source?}\par
 Compiler's module({\uldb LASM.BAS}{\v !{\footnote ExecFile('LASM.BAS',,3,)}}) have private variable named 'Code' for save compiler output.\par
\par
Use this function for compile you LASM source.\par
{\f4  \b Compile\b0 ({\cf9 ByRef} SourceCode {\cf9 As String}, {\cf9 Optional ByVal} AutoCreateProc {\cf9 As Boolean} = {\cf9 True}) {\cf9 As Boolean}}\par
  IF AutoCreateProc = True, then COMPILER_CreateCodeProc function will called. \par
     When calculating label's adrresses, to address will added length of:\par
     {\cf2 Push} {\cf6 EBP}\par
     {\cf2 Mov}  {\cf6 EBP,ESP}\par
     {\cf2 Push} {\cf6 EBX}\par
     {\cf2 Push} {\cf6 ESI}\par
     {\cf2 Push} {\cf6 EDI}\par
\par
After compiling, compiled source can be executed by ExecuteCode function in {\uldb LEXEC.BAS}{\v !{\footnote ExecFile('LEXEC.BAS',,3,)}}\par
\par
If you want to save 'Code' into file, then you must use:\par
{\f4  \b Compiler_SaveToFile\b0 ({\cf9 ByVal} FileName {\cf9 As String}, {\cf9 Optional ByVal} SaveAsHex {\cf9 As Boolean})}\par
  If SaveAsHex = True, then compiled code will saved as HEX (two symbols per byte)\par
     You can paste hex codes in VB string variable. Executor understand hex codes.\par
     You can execute hex codes immediately or precompile it by Hex2Bin function in LEXEC module\par
\par
\par
{\cf11 Example:}\par
{\f4  {\cf2 If} Compile(Text1.Text, {\cf2 True}) {\cf2 Then}\par
    MsgBox COMPILER_CallExecutor (p1, p2, p3, p4)\par
 {\cf2 End If}\par}
\par
\par
 {\f4\b\i See also:} {\uldb Execute}{\v IDH_Exec}\par\page
#{\footnote IDH_Exec}
\keepn
{\f2\b\cf7  EXECUTE}
\par\pard
{\cf11\b How to execute compiled source?}\par
For execute compiled code use this function from {\uldb LEXEC.BAS}{\v !{\footnote ExecFile('LEXEC.BAS',,3,)}}\par
 {\f4 Return=\b ExecuteCode\b0 ({\cf9 ByVal} StringToConvert {\cf9 As String, ByVal} P1 {\cf9 As Long, ByVal} P2 {\cf9 As Long, ByVal} P3 {\cf9 As Long, ByVal} P4 {\cf9 As Long, Optional ByVal} FromHex {\cf9 As Boolean = False})}\par
 if FromHex=True, then executor will 'think' that StringToConvert in hex format and convert it to binary by Hex2Bin function.\par
 Else StringToConvert will executed immediately\par
 It is not recommended to pass hex codes to executor. You can precompile hex to bin when initialise. For example in Form_Load.\par
\par
 When you execute assembled code, you can pass to it up to 4 parameters. It is 'P1'...'P4'\par
 Also you can use CODEPTR function to pass address of VB function.\par
 CODEPTR is representation of VB {\f4\cf9 Addressof} function. You can use both CODEPTR and {\f4\cf9 Addressof}.\par
 To pass pointers to variables, strings and objects use next VB functions: {\f4\cf9 VarPtr, StrPtr} and {\f4\cf9 ObjPtr}.\par
\par
\par
  Also you can use COMPILER_CallExecutor function\par
{\cf11 Example:}\par
{\f4  {\cf2 If} Compile(Text1.Text, {\cf2 True}) {\cf2 Then}\par
    MsgBox COMPILER_CallExecutor (p1, p2, p3, p4)\par
 {\cf2 End If}\par}
\par
\par
 {\f4\b\i See also:}{\uldb Compile}{\v IDH_Compile}\page
#{\footnote IDH_Types}
\keepn
{\f2\b\cf7  DATA TYPES}
\par\pard
There are 3 data types supported by LASM compiler.\par
It is {\b\cf2 BYTE}, {\b\cf2 WORD} and {\b\cf2 DWORD}.\par
\par
 Each data type assigned to equivalent part of register or memory.\par
  For example BYTE for {\ul r8(m8/imm8)}{\v IDH_Abbreviations}; WORD - {\ul r16(m16/imm16)}{\v IDH_Abbreviations}; DWORD - {\ul r32(m32/imm32)}{\v IDH_Abbreviations}\par
 LASM also support type identifier for immediate numbers and constants:\par
 BYTE{\f3\b\cf2 ?}, WORD{\f3\b\cf2 %} and DWORD{\f3\b\cf2 &}\par
\par
 {\f4\b\i See also:} {\uldb Type-declaration character}{\v IDH_TypeID}\par\page
#{\footnote IDH_Constants}
\keepn
{\f2\b\cf7  CONSTANTS}
\par\pard
 Use constants to replace immediate number or any expression\par
\b Syntax:\b0 \par
 {\b\cf2 CONST} Name{\b\cf2 =}imm\par
 {\b\cf2 CONST} Name {\b\cf2 EQU} Expression\par
Also you can use Name EQU imm and Name=Expression\par
\par
 {\f4\cf11 Example 1} (numbers):\par
 {\b\cf2 CONST} MyConst{\b\cf2 =}1\par
 {\b\cf2 MOV} {\cf6 EAX},{\cf6 MyConst}\par
\par
 {\f4\cf11 Example 2} (names):\par
 {\b\cf2 CONST} MyConst{\b\cf2 =}1\par
 {\b\cf2 CONST} Accumulator {\b\cf2 EQU} EAX\par
 {\b\cf2 MOV} {\cf6 Accumulator},{\cf6 MyConst}\par
\par
 {\f4\cf11 Example 3} (expressions)\par
 {\b\cf2 CONST} Accumulator {\b\cf2 EQU} EAX\par
 {\b\cf2 CONST} Counter {\b\cf2 EQU} ECX\par
 {\b\cf2 CONST} EAX= {\b\cf2 EQU} MOV EAX,\par
 {\b\cf2 CONST} EAX=EAX+ {\b\cf2 EQU} ADD EAX,\par
 {\b\cf2 eax=} {\cf6 5}\par
 {\b\cf2 Accumulator=Accumulator+} {\cf6 Counter}\par
\par
 {\f4\cf11 Example 4} (expressions)\par
 {\b\cf10 ; .CONST}\par
 {\b\cf2 CONST} EAX{\b\cf2 =}1 {\b\cf2 EQU} DB &HB8,&HC0,&H1,0,0,0\par
 {\b\cf10 ' .CODE}\par
 {\b\cf2 EAX=1}\par
\par
 {\f4\cf11 Example 5} (type identifiers)\par
 {\b\cf2 CONST} MyNumber{\b\cf2 =}1\par
 {\b\cf2 PUSH} {\cf6 MyNumber}{\b\cf2 ?}\par
 {\b\cf2 PUSH} {\cf6 MyNumber}{\b\cf2 %}\par
 {\b\cf2 PUSH} {\cf6 MyNumber}{\b\cf2 &}\par
\page
#{\footnote IDH_Comments}
\keepn
 {\f2\b\cf7  COMMENTARY}
\par\pard
{\cf11\b You have 3 ways to put comments in you source:}\par
It is: {\b\cf2 REM} or {\b\cf2 ;} or {\b\cf2 '}\par
\par
For example:\par
{\b\cf10 REM This is DOS-Basic like comments}\par
{\b\cf10 ; This is Assembler like comments}\par
{\b\cf10 ' This is QB/VB like comments}\par
\par
One commentary occupies the safe line. You can not combine commentary with any other assembler syntax.
\page
#{\footnote IDH_NS}
\keepn
 {\f2\b\cf7  NUMBER SYSTEMS}
\par\pard
{\cf11\b There are 3 number systems supported by compiler:}\par
  \b Decimal\b0  (Default)\par
  \b Hexadecimal\b0  ({\b\cf2 &H})\par
  \b Binary\b0  ({\b\cf2 &B})\par
\par
See how to write number 1 in different numeric systems:\par
1={\b\cf2 &H}1={\b\cf2 &B}1\par
\par
 {\cf11 Example:}\par
 {\b\cf2 MOV} {\cf6 EAX},[{\cf6 EBP}-{\b\cf2 &H}4]\page
#{\footnote IDH_TypeID}
\keepn
 {\f2\b\cf7  Type-declaration character}
\par\pard
{\cf11\b Next type identifier's supported}\par
{\b\cf2 ?} - \b BYTE\b0  (0-&HF)\par
{\b\cf2 %} - \b WORD\b0  (0-&HFFFF)\par
{\b\cf2 &} - \b DWORD\b0  (0-&HFFFFFFFF)\par
\par
\i You can use it with variable-type immediate value(imm).\i0 \par
{\cf11 Example 1:} (with constants)\par
{\b\cf2 CONST} VbCr{\b\cf2 =}13\par
\trgaph8\cellx2200\cellx3600
\intbl
{\b\cf2 PUSH} {\cf6 VbCr}{\b\cf2 ?}\cell
Push {\ul imm8}{\v IDH_Abbreviations}\cell
\row
\intbl
{\b\cf2 PUSH} {\cf6 VbCr}{\b\cf2 %}\cell
Push {\ul imm16}{\v IDH_Abbreviations}\cell
\row
\intbl
{\b\cf2 PUSH} {\cf6 VbCr}{\b\cf2 &}\cell
Push {\ul imm32}{\v IDH_Abbreviations}\cell
\row
\trowd\par
{\cf11 Example 2:} (with numbers)\par
\trgaph8\cellx2200\cellx3660
\intbl
{\b\cf2 SUB} [{\cf6 EAX}+1{\b\cf2 ?}],1\cell
[EAX+{\ul imm8}{\v IDH_Abbreviations}]\cell
\row
\intbl
{\b\cf2 SUB} [{\cf6 EAX}+1{\b\cf2 &}],1\cell
[EAX+{\ul imm32}{\v IDH_Abbreviations}]\cell
\row
\trowd\par
\i Or you can set length of memory pointer\i0 \par
{\cf11 Example 3:} (with memory)\par
\trgaph8\cellx2000\cellx4440
\intbl
{\b\cf2 MOV} [{\cf6 EAX}],2{\b\cf2 ?}\cell
Mov Byte Ptr[eax],2\cell
\row
\intbl
{\b\cf2 MOV} [{\cf6 EAX}],2{\b\cf2 %}\cell
Mov Word Ptr[eax],2\cell
\row
\intbl
{\b\cf2 MOV} [{\cf6 EAX}],2{\b\cf2 &}\cell
Mov Dword Ptr[eax],2\cell
\row
\trowd\par
 {\f4\b\i See also:} {\uldb DATA TYPES}{\v IDH_Types}\par\page
#{\footnote IDH_Features}
\keepn
 {\f2\b\cf7  FEATURES}
\par\pard
\b 1. Automatic memory pointers correction\b0 \par
{\cf11 For example:}\par
 {\b\cf2 MOV} {\cf6 AL},[{\cf6 EAX}]\par
will convert to\par
 {\b\cf2 MOV} {\cf6 AL}, {\b\cf2 BYTE PTR} [{\cf6 EAX}]\par
\par
\b 2. Automatic choise of imm type\b0 \par
{\cf11 For example:}\par
 {\b\cf2 PUSH} {\cf6 255} -> Push {\ul imm8}{\v IDH_Abbreviations}\par
 {\b\cf2 PUSH} {\cf6 256} -> Push {\ul imm16}{\v IDH_Abbreviations}\par
 {\b\cf2 MOV} [{\cf6 eax}+1],{\cf6 ECX} -> mov [eax+{\ul imm8}{\v IDH_Abbreviations}],ecx\par
 {\b\cf2 MOV} [{\cf6 eax}+{\b\cf2 &H}100],{\cf6 ECX} -> mov [eax+{\ul imm32}{\v IDH_Abbreviations}],ecx\par
\par
 \i To disable this, put {\uldb type identifier}{\v IDH_TypeID} after immediate value.\i0 \par
{\cf11 For example:}\par
 {\b\cf2 PUSH} {\cf6 255}{\b\cf2 %} -> Push {\ul imm16}{\v IDH_Abbreviations}\par
\par
\b 3. Automatic correction of negative value\b0 \par
{\cf11 For example:}\par
 {\b\cf2 MOV} {\cf6 EAX},[{\cf6 EBP}-{\b\cf2 &H}4] -> mov eax,[ebp+&HFC]\par\page
#{\footnote IDH_Keeping}
\keepn
 {\f2\b\cf7  Keeping code in program}
\par\pard
{\cf11\b There are several way's to distribute assembling code in you program.}\par
\b 1. Save compiled binary data to disk.\b0 \par
    In this way you can load binary sources from disk to variable and execute it.\par
    \i Required\i0 : {\uldb LEXEC.BAS}{\v !{\footnote ExecFile('LEXEC.BAS',,3,)}}\par
\b 2. Save compiled binary data in resource\b0 \par
    In this way you can execute compiled program from RES-file\par
    \i Required\i0 : {\uldb LEXEC.BAS}{\v !{\footnote ExecFile('LEXEC.BAS',,3,)}}\par
\b 3. Save compiled hex data in string.\b0 \par
    In this way you can execute compiled function from string.\par
    \i Required\i0 : {\uldb LEXEC.BAS}{\v !{\footnote ExecFile('LEXEC.BAS',,3,)}}\par
\b 4. Save not compiled source inside program or load from file/resource.\b0\par
    In this way you can compile source file with mnemonics at run-time.\par
    \i Required\i0 : {\uldb LASM.BAS}{\v !{\footnote ExecFile('LASM.BAS',,3,)}}, {\uldb LEXEC.BAS}{\v !{\footnote ExecFile('LEXEC.BAS',,3,)}}\par\page
#{\footnote IDH_About}
\keepn
 {\f2\b\cf7  ABOUT}
\par\pard
\f4
 BP Local Assembler for Visual Basic 6\par
  Basic Production, 2004\par
\par
 LASM it is a 32-bit open source assembler compiler and executor\par
\par
 Contact BP: {\uldb cyraxua@hotmail.com}{\v !{\footnote ExecFile('mailto:cyraxua@hotmail.com',,1,)}}, {\uldb bp@pochtamt.com}{\v !{\footnote ExecFile('mailto:bp@pochtamt.com',,1,)}}\par
\par
 {\cf11 Find a bug?}\par
 Mail me with subject: \b LASM: BUG\b0  or \b LASM: BUGFIX\b0 \par
 {\cf11 Have a nice sample?}\par
 Mail me with subject: \b LASM: SAMPLE\b0 \par
 {\cf11 Write new feature?}\par
 Mail me with subject: \b LASM: FEATURE\b0 \par
\par
 {\f0\i\cf9 And you will added to LASM developers list.}\page
}