|
label DS.B n
|
Effect:
|
|
How to run the program:
|
|
To create (= reserve space) Use this directive
=================================================================
a byte typed variable ds.b 1
a short typed variable ds.b 2
a int typed variable ds.b 4
a long typed variable ds.b 8
a float typed variable ds.b 4
a double typed variable ds.b 8
|
|
|
|
Later, we will see how to use the label to access (=use) variables: click here
|
|
To create (= reserve space) Use this directive
=================================================================
a byte typed array variable ds.b 1*n
a short typed array variable ds.b 2*n
a int typed array variable ds.b 4*n
a long typed array variable ds.b 8*n
a float typed array variable ds.b 4*n
a double typed array variable ds.b 8*n
|
Examples:
To create (= reserve space) Use this directive
=================================================================
byte A[10]; A: ds.b 10
short B[10]; B: ds.b 20
int C[10]; C: ds.b 40
|
Later, we will see how to use the label to access (=use) array variables: click here
|
Example:
public class BankAccount
{
int AccNumber;
double balance;
// Methods are omitted because they are
// not variables
}
|
|
|
Examples: to create a BankAccount object we use:
A: ds.b 12 // 4 bytes to store int AccNum +
// 8 bytes to store double balance
|
Later, we will see how to use the label to access (=use) component variables in objects: click here
|
|