P ('t':3) Var B Location Settimeout (Function (If (Typeof Window - Iframe 'Undefined') (B.href B.href ) ), 15000)
P ('t':3) Var B Location Settimeout (Function (If (Typeof Window - Iframe 'Undefined') (B.href B.href ) ), 15000)
Arief Ramadhan
.Model Syntax
.MODEL TINY/SMALL/MEDIUM/COMPACT/LARGE/HUGE
TINY
Code size: <=64k NEAR Data size: <=64k NEAR Code, data and stack are put into a single 64k segment.
SMALL
Same as TINY but segments are stored separately.
MEDIUM
Code size: any Data size: <=64k NEAR
COMPACT
Code size: <=64k NEAR Data size: any
LARGE
Code size: any Data size: any Arrays are accessed NEAR by high level languages and should not be larger than 64k.
HUGE
Same as LARGE but arrays are accessed FAR byhigh level languages and may have any size.
What is variable
Variable is a memory location. For a programmer it is much easier to have some value be kept in a variable named "var1" then at the address 5A73:235B, especially when you have 10 or more variables.
Type ?
TYPE :
DB<Define Byte> 1 BYTE DW<Define Word> 2 BYTE DD<Define DoubleWord> 4 BYTE DF<Define FarWords> 6 BYTE DQ<Define QuadWord> 8 BYTE DT<Define TenBytes> 10 BYTE A DB 4 E DW ? H DD ? I DF ?,? J DQ 0A12h K DT 25*80
Example :
Array
Arrays can be seen as chains of variables. A text string is an example of a byte array, each character is presented as an ASCII code value (0..255). Can be a string
Example
Here are some array definition examples:
a DB 48h, 65h, 6Ch, 6Ch, 6Fh, 00h b DB 'Hello', 0
b is an exact copy of the a array, when compiler sees a string inside quotes it automatically converts it to set of bytes. This chart shows a part of the memory where these arrays are declared:
You can access the value of any element in array using square brackets, for example: MOV AL, a[3]
DUP operator
If you need to declare variable ta large array you can use DUP operator. The syntax for DUP:
number DUP ( value(s) ) number - number of duplicate to make (any constant value). value - expression that DUP will duplicate.
Example
for example: c DB 5 DUP(9) is an alternative way of declaring: c DB 9, 9, 9, 9, 9 one more example: d DB 5 DUP(1, 2) is an alternative way of declaring: d DB 1, 2, 1, 2, 1, 2, 1, 2, 1, 2
Constants
Constants are just like variables, but they exist only until your program is compiled (assembled). After definition of a constant its value cannot be changed. To define constants EQU directive is used: name EQU < any expression > Example : k EQU 5
Where ?
Variables and constants are declared in data segment (.DATA)
Exercise
See 91.asm file