
Basic Data Operation

This is a basic data operation. It represents a fundamental action on a basic data type.
You may see other such operations in the Basic Data Operations category, or:


Integer Operations
Arithmetic |
Comparison
Boolean Operations
Bitwise |
Logical
String Operations
Concatenation |
Interpolation |
Comparison |
Matching
Memory Operations
Pointers & references |
Addresses


In this task, the goal is to demonstrate common operations on pointers and references. These examples show pointer operations on the stack, which can be dangerous and is rarely done. Pointers and references are commonly used along with Memory allocation on the heap.

.model small
.stack 1024
.data                    ; data segment begins here
UserRam byte 256 dup (0) ; the next 256 bytes have a value of zero. The address of the 0th of these bytes can be referenced as "UserRam"
 
tempByte equ UserRam     ;this variable's address is the same as that of the 0th byte of UserRam
tempWord equ UserRam+2   ;this variable's address is the address of UserRam + 2
.code
start:
mov ax, @data
mov ds, ax
 
mov ax, @code
mov es, ax