|
|
|
|
|
||
|
Another way to declare new name is assign expression. Syntax is: name = expression where 'name' is any legal name (see '3. Labels and Instructions'). With this, we declare name which type is L_VAR - variable type. L_VAR type can be reassigned to another value: Data1 = 10 ; new name Data2 = Data1 + 123 ; new name Data1 = -Data3 ; reassignmentType L_LABEL can not be reassigned. Another restriction that was introduced to this version of mas is dependence for previous declaration. If expression depend of some other name, this name must be declared previous: Data2 = Data1 ; error - undeclared Data1 Data1 = 123Most assemblers do not issue error for this. In previous BETA version of mas this was not error. Only reason for this was logical nature of code design. I DO NOT LIKE logic to reference some data that is not declared yet! Maybe this is one mistake, but that's me :) Unlike this, expressions CAN REFERENCE LABEL that is not declared. I think that is good, because it permits to calculate size of code: CodeSize = end - start start: ; some code end:This violate my phrase of LOGICAL CODING, but it's very useful. Right side of assign operator (=) is expression. Expression can have operators (unary and binary), numbers, already declared names and labels. Numbers are represented in C-like style with exception for binary numbers: '0x' followed by a..fA..F0..9 - HEX numbers
|
||
|
|