Current location - Loan Platform Complete Network - Big data management - Assembly, TYPE, SIZE, LENGTH
Assembly, TYPE, SIZE, LENGTH
Those are numeric return operators. These operators send back some feature or part of a memory address as a value. (1) TYPE format: TYPE expression If the expression is a variable, the assembler will send back the type of that variable expressed as a number of bytes: 1 for DB (byte), 2 for DW (word), 4 for DD (double word), 6 for DF (six-byte word), 8 for DQ (four words), and 10 for DT (10 bytes) If the expression is a mark, the assembler If the expression is a scalar, the assembler will return a value representing the type of the scalar: -1 for NEAR, -2 for FAR, and 0 if the expression is a constant. Example: The string ARRAY DW 1,2,3 is defined. For the instruction ADD SI, TYPE ARRAY the assembler will be formed into ADD SI, 2 (because of the type of DW defined above.) (2) LENGTH is formatted as follows: LENGTH variable ① for the use of DUP in the variable, the assembler will send back the number of units allocated to the variable ② for other cases, then send 1 Example 1: Definition FEES DW 100 DUP (0) ----- allocated to FEES 100 units for the instruction MOV CX, LENGTH FEES assembler will be formed into: MOV CX, 100 Example 2: Definition AEES DW 100 DUP (0) ----- assembler will form it as: MOV CX Example 2: Define ARRAY DW 1,2,3 For the instruction MOV CX,LENGTH ARRAY the assembler will make it form as: MOV CX,1 Example 3: TABLE DB 'ABCD' For the instruction MOV CX,LENGTH TABLE will make it form as: MOV CX,1 (3) SIZE Format: SIZE variable The number of bytes allocated to the variable by the assembler return. The secondary value is the product of the LENGTH value and the TYPE value. Example 1: Define FEES DW 100 DUP (0) ----- Allocated to FEES 100 units For the instruction MOV CX, SIZE FEES the assembler will make it form : MOV CX, 200 Example 2: Define ARRAY DW 1,2,3 For the instruction MOV CX, SIZE ARRAY the assembler will make it form : MOV CX, 2 Example 3: TABLE DB 'ABCD' For instruction MOV CX,SIZE TABLE is formed as MOV CX,1