Reputation: 135
We can write ASSIGN DB 10, 20, 30, 40, 50
command in emu8086 but it loads these bytes to random memory fields.
How can I load these bytes to the memory field I wanted? For example, I want to define these bytes beginning from A40EH.
Upvotes: 2
Views: 53
Reputation: 10381
Memory addresses contain two parts : segment and offset. The segment is assigned by the operating system, the offset is determined by the data itself. The programmer can control the offset. In your case, if you want some data in a specific position you can fill your data segment with lots of bytes until you get the desired position, example :
.model large
.stack 100h
.data
▼
filler db 0A40Eh dup(?) ;◄■■ BYTES 0 TO 0A40DH.
ASSIGN DB 10, 20, 30, 40, 50, 'END$' ;◄■■ BYTES START AT 0A40EH.
.code
mov ax, @data
mov ds, ax
mov ah, 9
lea dx, ASSIGN
int 21h ;◄■■ DISPLAY ASSIGN TO CHECK IF WORKS.
mov ah, 0
int 16h ;◄■■ WAIT FOR A KEY PRESS.
mov ax, 4c00h
int 21h
Upvotes: 3