亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频

? 歡迎來到蟲蟲下載站! | ?? 資源下載 ?? 資源專輯 ?? 關(guān)于我們
? 蟲蟲下載站

?? chap03.html

?? vid寫的FASM向?qū)?
?? HTML
?? 第 1 頁 / 共 2 頁
字號:
<html>
<head>
<link href="style.css" rel="stylesheet" type="text/css">
<title>03 TAJGA FASM Tutorial</title>
</head>

<body>

<center><b>CHAPTER 3 - Labels & Addresses & Variables</b></center><br><br>


Okay, let's get to variables. In previous chapter i wrote that variable is
general term for space which stores some value. Registers are variables for
example. But there is limited number of registers (VERY limited, some 8 + few
special), and this is nearly always not enough. For this reason memory (RAM -
random access memory) is used.<br><br>

<b>NOTE:</b> when someone says "variable" he almost always means memory
variable.

<br><br><br>
<b>3.1. Labels</b>

<br>
Problem is that you have to know WHERE in memory is some value stored.
Position in memory (called "address") is given by number. But it is quite hard
to remember this number (address) for every variable.
<blockquote class="term">
term: <b>address</b><br>
number which gives position in memory
</blockquote>

Another problem with addresses is that when you change your program, address
can be changed too, and so you would have to correct this number everywhere
where it is used. For this reason addresses are represented by "labels".
Label is just some word (not string, it is not enclosed in apostrophes),
which, in your program, represents address in memory. When you compile your
program, compiler will replace label with proper address. Label consists of
alphabet characters ("a" to "z", "A" to "Z") numbers ("0" to "9"), underscores
("_") and dots ("."). But first character of label can't be number or dot.
Label also can't have same name as directive or instruction (instruction
mnemonics). Labels are case sensitive in FASM ('a' is NOT same as 'A').
Example of labels:
<br><br>

<table align=center width=70% border=0 bgcolor=#7F91EC cellspacing=1 cellpadding=0>
<tr align=center bgcolor=#CBCFD8><td><code>name       </code></td><td>is label</td></tr>
<tr align=center bgcolor=#CBCFD8><td><code>a	      </code></td><td>is label</td></tr>
<tr align=center bgcolor=#CBCFD8><td><code>A	      </code></td><td>is label, different from "a"</td></tr>
<tr align=center bgcolor=#CBCFD8><td><code>name2      </code></td><td>is label</td></tr>
<tr align=center bgcolor=#CBCFD8><td><code>name.NAME2 </code></td><td>is label</td></tr>
<tr align=center bgcolor=#CBCFD8><td><code>name._NAME2</code></td><td>is label</td></tr>
<tr align=center bgcolor=#CBCFD8><td><code>_name      </code></td><td>is label</td></tr>
<tr align=center bgcolor=#CBCFD8><td><code>_	      </code></td><td>is label</td></tr>
<tr align=center bgcolor=#CBCFD8><td><code>.name      </code></td><td>is not label, because is starts with dot (labels starting with
		     dot have special meaning in FASM, which you will learn later)</td></tr>
<tr align=center bgcolor=#CBCFD8><td><code>1	      </code></td><td>is not label because it starts with number</td></tr>
<tr align=center bgcolor=#CBCFD8><td><code>1st_name   </code></td><td>is not label for same reason</td></tr>
<tr align=center bgcolor=#CBCFD8><td><code>name1 name2</code></td><td>is not label, because it contains space</td></tr>
<tr align=center bgcolor=#CBCFD8><td><code>mov	      </code></td><td>is not label, because "mov" is instruction mnemonics</td></tr>
</td></tr></table>
<br>
<blockquote class="term">
term: <b>label</b><br>
Placeholder for some address, eg. placeholder for some number, because address is number. In FASM you can
use label same way as any other number (not really, but it doesn't matter for you too much now).
</blockquote>

You can define label using directive "label". This directive should be
followed with label itself (label name). For example:
<br><br>

<table align=center width=70% border=0 bgcolor=#7F91EC cellspacing=1 cellpadding=0>
<tr align=center bgcolor=#CBCFD8><td width=120><code>label name</code></td><td>is label definition, it defines label "name" </td></tr>
<tr align=center bgcolor=#CBCFD8><td width=120><code>label _name</code></td><td>is label definition, it defines label "_name"</td></tr>
<tr align=center bgcolor=#CBCFD8><td width=120><code>label label</code></td><td>is not label definition, because "label" can't be name of label
			     as decribed in previous paragraph
</td></tr></table>
<br>

this will define label that will represent address of data defined behind it<br><br>

<blockquote class="term">
directive: <b>label</b>
</blockquote>

<blockquote class="term">
<b>label definition</b><br>
directive <b>label</b> followed by label name
</blockquote>

Shorter way to define label is just writing label name followed by colon
(<code>:</code>)
<blockquote class="code"><pre>
name<font color=#333399>:</font>
_name<font color=#333399>:</font>
</pre></blockquote>
but we won't use this way for some time.
<br><br><br>

<b>3.2. Variable definition</b>

<br>
Now how we can return to problem with variables: how to define variable in
memory. Program you create (compiled program, in machine code) is loaded to
memory at execution time, where processor executes it instruction by
instruction. Look at this program:
<blockquote class="code"><pre>
org <font color=#339933>256</font>
mov al<font color=#333399>,</font><font color=#339933>10</font>
db <font color=#bb0000>'this is a string'</font>
int <font color=#339933>20h</font>
</pre></blockquote>

This program will probably crash, because after processor executes <code>mov
al,10</code> then it reaches string. But in program there is no difference between
string and instructions in machine code. Both are translated into array of numeric
values (bytes). There is no way processor can differ whether numeric value is
translation of string or translation of instruction. In this example,
processor will execute instructions whose numeric representation (in machine
code) is same as ASCII representation of string "this is a string".

Now look at this:
<blockquote class="code"><pre>
org <font color=#339933>256</font>
mov al<font color=#333399>,</font><font color=#339933>10</font>
int <font color=#339933>20h</font>
db <font color=#bb0000>'this is a string'</font>
</pre></blockquote>

This program will not crash, because before reaching bytes defined by string
processor reaches instruction <code>int 20h</code>, which ends execution of program. So
bytes defined with string will not be executed, it will just take some space.
This is way how you can define variable - define some data at place where
processor won't try to execute it (behind <code>int 20h</code> in this case).<br><br>

So code with byte-sized variable of value 105
<blockquote class="code"><pre>
org <font color=#339933>256</font>
mov al<font color=#333399>,</font><font color=#339933>10</font>
int <font color=#339933>20h</font>
db <font color=#339933>105</font>
</pre></blockquote>

Last line defines byte variable containing 105.<br><br>

Now how to access variable? First we must know address of variable. For this
we can use label (described above, reread it if you have forgotten)
<blockquote class="code"><pre>
org <font color=#339933>256</font>
mov al<font color=#333399>,</font><font color=#339933>10</font>
int <font color=#339933>20h</font>
label my_first_variable
db <font color=#339933>105</font>
</pre></blockquote>

So we already know address of variable. It is represented by label
<code>my_first_variable</code>. Now how to access it? You may think it is, for example
<blockquote class="code"><pre>
mov al<font color=#333399>,</font>my_first_variable
</pre></blockquote>

but no! Remember i told that label (<code>my_first_variable</code> in this
case) stands for address of variable. So this instruction will move address of
variable to <code>al</code> register, not variable's contents. To access
contents of variable (or contents of any memory location) you must enclose it's
address in brackets (<code>[</code> and <code>]</code>). So to access contents
of our variable, and copy it's value to <code>al</code> we use
<blockquote class="code"><pre>
mov al<font color=#333399>,[</font>my_first_variable<font color=#333399>]</font>
</pre></blockquote>

Now we will define two variables:
<blockquote class="code"><pre>
org <font color=#339933>256</font>
<font color=#333399>&lt;</font>some instructions<font color=#333399>&gt;</font>
int <font color=#339933>20h</font>
label variable1
db <font color=#339933>100</font>
label variable2
db <font color=#339933>200</font>
</pre></blockquote>

So to copy value of <code>variable1</code> to <code>al</code> we use
<blockquote class="code"><pre>
mov al<font color=#333399>,[</font>variable1<font color=#333399>]</font>
</pre></blockquote>

To copy <code>al</code> to <code>variable1</code> use
<blockquote class="code"><pre>
mov <font color=#333399>[</font>variable1<font color=#333399>],</font>al
</pre></blockquote>

To set value of <code>variable1</code> (exact: to set value of variable which is stored
at address represented by <code>variable1</code>) to 10 we could try
<blockquote class="code"><pre>
mov <font color=#333399>[</font>variable1<font color=#333399>],</font><font color=#339933>10</font>
</pre></blockquote>

but this will cause error (try it if you want). Problem is that you know that
you are changing variable at address <code>variable1</code> to <code>10</code>.
But what is size of variable? In previous two cases byte-size could be
determined because you used <code>al</code> register which is byte sized, so
compiler decided that variable at <code>variable1</code> is byte sized too,
because you can't move between operands with different sizes. But in this case,
value 10 can be of any size, so it can't decide size of memory variable. To
solve this we use "size operators". We	will talk about two size operators for
now: <code>byte</code> and <code>word</code>. You can put size operator before
instruction operand when accessing it to let compiler know what the variable
size is:
<blockquote class="code"><pre>
mov byte <font color=#333399>[</font>variable1<font color=#333399>],</font><font color=#339933>10</font>
</pre></blockquote>

Another way to make this is
<blockquote class="code"><pre>
mov <font color=#333399>[</font>variable1<font color=#333399>],</font> byte <font color=#339933>10</font>
</pre></blockquote>

in this case compiler knows that moved value 10 is byte sized so it decides
that variable is byte-sized too (because we can move byte sized value only to
byte sized variable).<br><br>

But it would be hard to always remember and always write size of variable when
you access it. For this reason you can assign size of variable to label when
you define it. Just write size operator behind label name in definition:
<blockquote class="code"><pre>
label variable1 byte
db <font color=#339933>100</font>
</pre></blockquote>

or

?? 快捷鍵說明

復(fù)制代碼 Ctrl + C
搜索代碼 Ctrl + F
全屏模式 F11
切換主題 Ctrl + Shift + D
顯示快捷鍵 ?
增大字號 Ctrl + =
減小字號 Ctrl + -
亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频
亚洲精品国产a| 久久精品国产99| 日韩电影在线一区二区| 国产精品1区2区3区| 欧美群妇大交群中文字幕| 日本一区二区成人在线| 日韩专区在线视频| 色婷婷综合激情| 欧美激情资源网| 毛片av一区二区| 精品视频123区在线观看| 中文字幕精品一区 | 欧美挠脚心视频网站| 国产午夜精品一区二区 | 欧美四级电影在线观看| 国产色91在线| 美腿丝袜亚洲色图| 欧美剧情片在线观看| 亚洲欧美激情插| 波多野结衣视频一区| 久久婷婷成人综合色| 国产成人精品三级| 日韩午夜在线观看| 婷婷开心久久网| 欧美色综合影院| 亚洲免费三区一区二区| 91色九色蝌蚪| 亚洲日本乱码在线观看| 99久久久无码国产精品| 中文字幕亚洲在| 成人网页在线观看| 国产精品国产三级国产aⅴ中文| 黑人精品欧美一区二区蜜桃| 日韩欧美在线一区二区三区| 麻豆视频观看网址久久| 日韩午夜在线观看| 激情综合色播五月| 久久久久久免费网| 粉嫩aⅴ一区二区三区四区五区| 久久一区二区三区国产精品| 国精品**一区二区三区在线蜜桃| 精品久久久影院| 国产福利一区在线| 国产精品国产精品国产专区不蜜 | 精品国产乱码久久久久久1区2区| 天涯成人国产亚洲精品一区av| 欧美日韩成人综合| 日韩精品福利网| 欧美精品一区视频| 成人激情小说乱人伦| 国产精品成人一区二区三区夜夜夜| fc2成人免费人成在线观看播放| 九九精品视频在线看| 亚洲精品在线观| 成人国产视频在线观看| 亚洲人成影院在线观看| 欧美精品久久一区二区三区| 蜜乳av一区二区| 国产精品视频一二| 欧美丝袜第三区| 精品亚洲porn| 亚洲欧美影音先锋| 欧美丰满嫩嫩电影| 国产成人免费视频精品含羞草妖精 | 亚洲欧美日韩在线| 欧美视频精品在线| 国产乱码精品1区2区3区| 亚洲欧美怡红院| 欧美精品一卡二卡| 丁香婷婷综合激情五月色| 日韩伦理av电影| 欧美电影免费观看完整版| 菠萝蜜视频在线观看一区| 亚洲一区免费视频| 国产午夜亚洲精品理论片色戒 | 欧美羞羞免费网站| 国产精品一级在线| 亚洲大片精品永久免费| 国产欧美一区二区三区鸳鸯浴 | 亚洲成av人片www| 国产欧美精品日韩区二区麻豆天美| 在线观看成人免费视频| 国产美女一区二区| 五月激情综合婷婷| 亚洲同性gay激情无套| 日韩精品一区二区三区视频| 91在线观看免费视频| 久久av老司机精品网站导航| 亚洲综合一区二区| 中文字幕第一区二区| 欧美videos中文字幕| 欧美三片在线视频观看| av在线不卡观看免费观看| 精品制服美女久久| 天天av天天翘天天综合网色鬼国产| 国产精品视频观看| 久久久高清一区二区三区| 91超碰这里只有精品国产| 色婷婷精品久久二区二区蜜臂av| 国产东北露脸精品视频| 免费成人深夜小野草| 亚洲欧洲无码一区二区三区| 精品区一区二区| 欧美一区二区三区免费大片| 欧美在线free| 色妹子一区二区| 91亚洲精品久久久蜜桃| 成人免费精品视频| 国产精品亚洲综合一区在线观看| 麻豆精品在线看| 蜜臂av日日欢夜夜爽一区| 亚洲午夜精品久久久久久久久| 综合色中文字幕| 亚洲欧美一区二区三区孕妇| 国产精品盗摄一区二区三区| 国产精品日韩成人| 国产精品嫩草影院com| 国产精品不卡视频| 国产精品国产自产拍高清av王其| 国产精品拍天天在线| 国产精品入口麻豆九色| 亚洲欧洲另类国产综合| 国产精品久久精品日日| 亚洲人成影院在线观看| 亚洲老妇xxxxxx| 亚洲成人第一页| 秋霞午夜av一区二区三区 | 一区二区三区在线播| 亚洲一区二区三区爽爽爽爽爽| 亚洲另类在线视频| 亚洲国产成人高清精品| 蜜臀精品一区二区三区在线观看 | 欧美日韩精品综合在线| 在线不卡中文字幕播放| 精品免费一区二区三区| 久久久久国产精品厨房| 国产精品高潮久久久久无| 一区二区三区在线观看视频| 首页欧美精品中文字幕| 美女高潮久久久| 精品一区二区三区免费播放 | 日韩精品国产欧美| 奇米影视7777精品一区二区| 国产一区二区导航在线播放| 成人高清免费观看| 欧美日韩一级视频| 欧美大片国产精品| 国产精品理论在线观看| 在线观看91精品国产麻豆| 欧美精品一区二区三区很污很色的 | 日韩一区二区中文字幕| 99精品在线免费| 在线一区二区三区| 日韩精品一区二区三区在线| 国产精品免费久久久久| 亚洲电影一区二区| 国产精品亚洲成人| 欧美优质美女网站| 久久久一区二区三区| 依依成人综合视频| 国产精品香蕉一区二区三区| 色94色欧美sute亚洲线路二 | 欧美亚洲综合一区| 日韩美女视频在线| 亚洲精品v日韩精品| 激情综合网av| 欧美日本在线视频| 亚洲女同一区二区| 国产寡妇亲子伦一区二区| 欧美一区二区三区视频免费 | 久久成人免费网站| 欧美午夜电影在线播放| 欧美高清在线视频| 另类小说欧美激情| 欧美日韩国产精品成人| 综合久久久久综合| 国产精品夜夜嗨| 日韩一区二区三区四区 | 中文字幕不卡在线观看| 激情综合网天天干| 日韩欧美一二区| 亚洲成av人片在www色猫咪| 91亚洲精华国产精华精华液| 久久久久久久久久久久电影| 日本免费新一区视频| 欧美亚洲禁片免费| 最新日韩av在线| 成人a区在线观看| 中文字幕第一页久久| 国产精品一区二区久久精品爱涩| 日韩亚洲欧美中文三级| 午夜精品福利一区二区三区av| 91免费小视频| 亚洲视频小说图片| 粉嫩av亚洲一区二区图片| 国产欧美日韩精品在线| 风流少妇一区二区| 欧美国产一区视频在线观看| 风间由美一区二区三区在线观看| 久久久国产精品麻豆|