mov si,82h
Mov ah,2
mov dl,[si]
int 21h
mov ah,4ch
int 21h
End
Why? if run
ex a ;first time
Output: a
but
ex ;second time
Output a
It not blank?
Is your program an EXE or a COM? If an EXE, are you using a .STARTUP directive or loading DS with something like:
mov ax,@data
mov ds,ax
If yes, then you need to use an ES override to access anything in the PSP:
mov dl,es:[si]
How to use PSP in .Com File?
.Com must Define ORG 100h?
Thank you.
For a COM file the loader sets CS = DS = SS = ES = segment address of PSP, so your code would work correctly without a segment override:
mov si,82h
Mov ah,2
mov dl,[si] ; <== OK
int 21h
Without an override, the segment register for MOV, and most other instructions that access data, is DS.