flat assembler
Message board for the users of flat assembler.

Index > Main > Why can't DL contain my address?

Author
Thread Post new topic Reply to topic
Adcock



Joined: 09 Aug 2017
Posts: 4
Adcock 08 Oct 2018, 06:44
Code:
org 256
mov [wtf],11110111b
mov dl,[wtf]
mov ah,2
int 21h
int 20h
label wtf byte
db 0b    

Why this works but not this.
Code:
org 256
mov [wtf],11110111b
mov dl,wtf
mov ah,2
int 21h
int 20h
label wtf byte
db 0b    

The following works too. [Regardless of output]
Code:
org 256
mov [wtf],11110111b
mov dx,wtf
mov ah,9
int 21h
int 20h
label wtf byte
db 0b    


Edit :

Wait wait. I think I got it.
Cause address is 16 bit but dl is 1 byte.
Right?

_________________
ReactOS
Open Your Windows To Freedom
Post 08 Oct 2018, 06:44
View user's profile Send private message Reply with quote
CandyMan



Joined: 04 Sep 2009
Posts: 414
Location: film "CandyMan" directed through Bernard Rose OR Candy Shop
CandyMan 08 Oct 2018, 07:22
Because you used "org 256" directive. Address of wtf is bigger than 255 and the register dl is 8-bit (0..255 unsigned value).

_________________
smaller is better
Post 08 Oct 2018, 07:22
View user's profile Send private message Reply with quote
DimonSoft



Joined: 03 Mar 2010
Posts: 1228
Location: Belarus
DimonSoft 09 Oct 2018, 09:59
Adcock wrote:
Wait wait. I think I got it.
Cause address is 16 bit but dl is 1 byte.
Right?

Exactly.
Post 09 Oct 2018, 09:59
View user's profile Send private message Visit poster's website Reply with quote
Display posts from previous:
Post new topic Reply to topic

Jump to:  


< Last Thread | Next Thread >
Forum Rules:
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum
You cannot attach files in this forum
You can download files in this forum


Copyright © 1999-2025, Tomasz Grysztar. Also on GitHub, YouTube.

Website powered by rwasa.