Assembly Language Programming Tutorial - 19 - Defining Data and Variables

preview_player
Показать описание


All references in this video came from:

Download:

Рекомендации по теме
Комментарии
Автор

For people having trouble:
This code doesn't work with ".model small", if you want to use it like this you have to use ".model tiny".
For ".model small" you should do this instead:

.model small

.data

num1 db 6

.code


.startup

mov dl, num1

add dl, 30h
mov ah, 2h ;code to print character
int 21h ;starts the code above (prints value on "dl")

.exit

bm_tv
Автор

When you said Rasim I thought I heard "rossmann" like the Apple guy lol.
Thanks for the upload Rasim! I appreciate you.

inadaizz
Автор

better flow than the previous videos, nice to see explanations

Nintenzo
Автор

for everyone have problems here is the right code
.model small
.stack 100h
.data
data1 db 5
.code
main proc

mov ax, data
mov ds, ax

mov dl, data1
add dl, 30h

mov ah, 2
int 21h


endp
end main


u need this 2 line of code to work properly
mov ax, data
mov ds, ax

nero
Автор

It works for me with a .model tiny only

volodymyrgutsu
Автор

nothing would change the value which is added into dl register then not correct output will come?

TheWackyCoop
Автор

If I put 7 instead of 2, it won't show 7, it shows 2. Why is that?

arhaisme
Автор

I'm having problems following the different strange letters. Some times i don't know when you talking about a register or a variable or a thing like 2h... where does 2h come from? is it what goes under (.data) a way to declare variables?

AlexSophiaAguilar
Автор

yeah i am getting the same issue with the variable not working

TruckerAgain
Автор

why it printed 2 while it run?
mov dl, count1 ; is it move 2 to dl?
add dl, 48; add 48+2?
I am confused, or they are in ASCII code?

khorclcl
Автор

It doesn't work for me
it kept saying that
so it changes nothing

ahmedabdelmalek
Автор

My Result is not showing Correctly .. its giving This " ý " , when i used db otherwise its shows 2, when i dont used the Variable . why is that . please help Dude .

handsomekhan
Автор

my shows Question mark.
why is that?

kce_ruby
Автор

How to make an executable for win7? .. so far i need DOSBOX to run them without the emulator

Hunar
Автор

So what is the difference between DB and BYTE ?

ahmedabdelmalek
Автор

.model small

.data

xchar db 65 ;ascii char A

.code


main proc
mov ax, data
mov ds, ax


mov dl, xchar

mov ah, 2h ;print char
int 21h ;print value of dl

endp
end main

AmineOnline
join shbcf.ru