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

? 歡迎來到蟲蟲下載站! | ?? 資源下載 ?? 資源專輯 ?? 關于我們
? 蟲蟲下載站

?? basic.html

?? 英文版
?? HTML
字號:
<!doctype html public "-//W3C//DTD HTML 3.2//EN"><html><head><title>Writing assembler in BASIC</title><meta http-equiv="content-type" content="text/html; charset=ISO-8859-1" /><meta http-equiv="content-language" content="en" /><meta name="resource-type" content="document"><meta name="copyright" content="This document copyright 2001 by Richard Murray. Use for non-profit and education purposes explicitly granted."><meta name="author" content="Richard Murray"><meta name="rating" content="general"></head><!--  /assembler/basic.html              --><!--                                     --><!--  (C) Copyright 2001 Richard Murray  --><!--  Designed by Richard Murray         --><!--  rmurray@heyrick.co.uk              --><!--                                     --><body bgcolor="#f0f0f0" text="#000000" link="#0022dd" vlink="#002288"><table border = "0" width="100%">  <tr>    <td align=center width=100>      <img src="arm3.gif" width=79 height=78 align = middle>    </td>    <td>      <h1 align="center"><font color="#800080">Writing assembler in BASIC</font></h1>    </td>    <td align=center width=100>      <img src="arm3.gif" width=79 height=78 align = middle>    </td></table><p>&nbsp;<p><h2>Introduction</h2>BASIC is demeaned by many as being a rather useless language. Okay, it has the obvious limitationin that it is an interpreted language (so each line must be 'compiled' on the fly), and it hasno structure typing. Also, it is a boon for sit-and-type programmers; the sort that Pascalfanatics have nightmares about.<p>&nbsp;<p>But BASIC, for all its seemingly apparent limitations, is very powerful. It is an absolutedoddle to drop into assembler, and back to BASIC. You can, with cunning, intermix BASIC andassembler and even call BASIC from assembler called from BASIC. Uh, confused yet?<br>Actually, it is nothing that you can't do from C, with the right tools. But, unlike C, you don'tneed a &quot;development environment&quot; costing hundreds of pounds, nor one that is<i>huge</i> to download. In fact, all you need is provided right there in your computer. BASIC,in ROM, and !Edit, also in ROM.<p>&nbsp;<p>BASIC offers you quite a powerful assembler. It is notably missing floating point and ADRL,however Darren Salt has created a useful module that provides these facilities.<br><a href="http://www.youmustbejoking.demon.co.uk/progs.frameset.html">Follow this link to seeDarren Salt's programs, including a vastly extended debugger module.</a> <font color = "red" size = "-1">[EXTERNAL LINK]</font><p>Maybe you've asked BASIC for a little bit of help on it's assembler.<br>BASIC provides detailed help on it's commands, <code>COLOUR</code> for example...<pre>&gt;HELP COLOURCOLOUR a [TINT t]: set text foreground colour [and tint] (background 128+a).COLOUR a,p: set palette entry for logical colour a to physical colour p.COLOUR r,g,b: set colour to r, g, b.COLOUR a,r,g,b: set palette entry for a to r, g, b physical colour.</pre>So it is a bit of a disappointment that the assembler is described correctly, but in a veryterse (and barely readable) form...<pre>&gt;HELP [Assembly language is contained in [] and assembled at P%. Labels follow '.'.Syntax:SWI[&lt;cond&gt;] &lt;expr&gt;ADC|ADD|AND|BIC|EOR|ORR|RSB|RSC|SBC|SUB[&lt;cond&gt;][S] &lt;reg&gt;,&lt;reg&gt;,&lt;shift&gt;MOV|MVN[&lt;cond&gt;][S] &lt;reg&gt;,&lt;shift&gt;CMN|CMP|TEQ|TST[&lt;cond&gt;][S|P] &lt;reg&gt;,&lt;shift&gt;MLA[&lt;cond&gt;][S] &lt;reg&gt;,&lt;reg&gt;,&lt;reg&gt;,&lt;reg&gt;MUL[&lt;cond&gt;][S] &lt;reg&gt;,&lt;reg&gt;,&lt;reg&gt;LDR|STR[&lt;cond&gt;][B] &lt;reg&gt;, '[ &lt;reg&gt;[,&lt;shift&gt;] '] [,&lt;shift&gt;][!]LDM|STM[&lt;cond&gt;]DA|DB|EA|ED|FA|FD|IA|IB &lt;reg&gt;[!],{&lt;reg list&gt;}[^]B[L][&lt;cond&gt;] &lt;label&gt;OPT|=|DCB|EQUB|DCW|EQUW|DCD|EQUD|EQUS &lt;expr&gt;ADR[&lt;cond&gt;] &lt;reg&gt;,&lt;label&gt;ALIGNwhere &lt;shift&gt;=&lt;reg&gt;|#&lt;expr&gt;|&lt;reg&gt;,ASL|LSL|LSR|ASR|ROR &lt;reg&gt;|#&lt;expr&gt;|RRXand &lt;cond&gt;=AL|CC|CS|EQ|GE|GT|HI|HS|LE|LS|LT|LO|MI|NE|NV|PL|VC|VSand &lt;reg&gt;=R0 to 15 or PC or &lt;expr&gt;</pre><p>But don't worry. This assembler area describes the ARM assembler, and this document tells youhow to get going.<br>Here, we discuss the basics. Other documents expand upon these themes.<p>&nbsp;<p><h2>The first step</h2>The first step is to reserve yourself a chunk of memory. All code must be assembled somewhere.You can choose to poke around in memory, or claim a chunk of RMA and assemble into that. Suchthings are regarded as <i>hacky</i>. The good way to program is to DIM a block of memory andassemble your (position independent?) code into it.<p>So to reserve ourselves some memory, we use DIM.<pre>  DIM code% 4096</pre><p>You should reserve enough memory to hold your code. If you overshoot, the assembler will not stopunless you are using range checking. Without range checking, bizarre things may happen.<br>If you start getting errors that don't make sense, try doubling your memory allocation.<p>A useful trick, at the end of your assembly, is to use:<pre>  PRINT P% - code%</pre>This prints the result of the current value of the <i>next instruction to be assembled</i>pointer with the <i>beginning of code memory</i> subtracted from it. The result is the amount ofspace used by your code.<br>Such a command helps you to optimise your use of memory. You don't need to claim 4096 bytes ifyour code only uses 124 bytes!<p>&nbsp;<p>This leads us to the <code>FOR</code>...<code>NEXT</code> loop.<br>Typically, assembler must be assembled twice. The first time, you want to whizz blindly throughand ignore all the errors. This may sound weird, but it will make a note of the labels in yourprogram, and where they are. So the second time around you can assemble and all the labelsreferred to will be known. Et voila!<p>The document <a href="opt.html">opt.html</a> describes all the available options, the values thatshould be used in your loop.<br>Typically, you will see...<ul>  <li> <code>FOR loop% = 0 TO 2 STEP 2</code><br>       The <i>de facto</i> way to assemble code, using two-pass assembly.       <br>&nbsp;<br>  <li> <code>FOR loop% = 0 TO 3 STEP 3</code><br>       The standard two-pass assembly, but outputs a listing. Useful for debugging, but otherwise       it just slows down the assembly.       <br>&nbsp;<br>  <li> <code>FOR loop% = 4 TO 6 STEP 2</code> <i>or</i> <code>FOR loop% = 4 TO 7 STEP 3</code>       Offset two-pass assembly (without and with listing). The code is assembled in your       memory block, to be executed at some other location. This is usually used for things like       modules. Refer to <a href="exa4.html">example four</a> to see how this is used.</ul><p>We are going to use 8 and 10.<pre>  FOR loop% = 8 TO 10 STEP 2</pre>This is just like the usual two-pass assembly, but it also uses range checking. It only needsone more bit of code to use, and the benefits are tremendous. You are assured that your code fitsinto the allocated space. If you should overshoot, you will receive a message such as:<pre>  Assembler limit reached at line 100</pre><p>Following your <code>FOR</code> loop, you need to tell the assembler where to put your code.This is done by setting <code>P%</code>.<pre>    P% = code%</pre>Do NOT forget this, the results of forgetting it can range from amusing to tragic, depending onwhat P% pointed to. It is worth noting that judicious use of P% can allow you to patch otherapplications while they are running. But I'm guessing only a geek like me would bother to try todo such a thing!<p>The next step is to set up your range check. To do this, you set <code>L%</code> to the end ofyour allocated memory.<pre>    L% = code% + 4096</pre>It is useful if you set your allocation amount (the value 4096) to a constant variable, then youonly need to change the one thing.<p>With your locations set up, you can enter the assembler. This is done using the left squarebracket.<pre>    [ OPT     loop%</pre>Following your square bracket, you need to set the OPTion, as shown.<br><code>OPT</code> is not an opcode understood by the processor. It is simply a pseudo-opcodedesigned to tell the assembler how to behave. It is not provided in APCS assemblers.<p>&nbsp;<p>Okay.<br>You are in the assembler. Set up, ready to roll.<br>Let's stick in some code.<pre>      ; example code           ADR     R0, message           SWI     &quot;OS_PrettyPrint&quot;           MOV     PC, R14         .message           EQUS    &quot;Wheeee! Isn't this fun?&quot;           EQUB    13           EQUB    0           ALIGN</pre><p>Finally, we need to close our assembler code and end the loop.<pre>    ]  NEXT</pre><p>&nbsp;<p>What comes next depends upon what you plan to do with the code. You can CALL it, USR it, save itto disc, or simply leave it to CALL/USR it at a later time in your program.<br>Here, we shall CALL it.<p>&nbsp;<p>&nbsp;<p>Your completed program should look like this.<pre>  DIM code% 40  FOR loop% = 8 TO 10 STEP 2    P% = code%    L% = code% + 40    [ OPT     loop%      ; example code      ADR     R0, message      SWI     &quot;OS_PrettyPrint&quot;      MOV     PC, R14    .message      EQUS    &quot;Wheeee! Isn't this fun?&quot;      EQUB    13      EQUB    0      ALIGN    ]  NEXT  IF INKEY(-1) THEN PRINT P%-code%  CALL code%</pre>Immediately you should see two changes. The most obvious is the addition of the INKEY line. Thiswill report the size of the code if you hold down Shift when you run the program. Because of thisI was able to reduce the memory required to 40 bytes instead of four thousand.<p>&nbsp;<p>Let's look at some other things.<br>Did you notice the comment? You can use <code>;</code> or <code>\</code> to start comments,though it is convention to use the semi-colon. Anything following the semi-colon is a comment,until a colon is reached.<br><i>Note - this is different to BASIC</i><p>The following will not work:<pre>  ; this is a comment :-)</pre>Because the following will work:<pre>  MOV R0, R1, ASL #4 ; load R1&lt;&lt;4 into R0, now store it : STR R0, [R2]</pre>That example isn't good code, you shouldn't have code following comments unless it is VERY clearwhat is going on. But it will work. The assembler treats the colon like BASIC treats a newline,and it'll keep on assembling.<p>&nbsp;<p>Also notice the ALIGN. The string is 25 bytes ( <i>Wheeee! Isn't this fun?</i> plus newline plusterminator). You cannot follow this with anything in a word-aligned system until it isword-aligned. The ALIGN command will skip forward until P% is word-aligned. If you do not takecare to word-align your strings, you will need to use ALIGN after them. It is recommended to useALIGN anyway instead of lots of EQUB 0's because hardwiring the string lengths removesflexibility. But, it's your preference. I used to hardwire as the ALIGN built into BASIC does notnull the padding bytes, making your executable untidy. Such things bother me, but hey, I'vealready said I'm a geek!<p>&nbsp;<p>Well. It might not be much, but it is your first simple assembler program. There is a hell of alot more that you can do - <i>ChangeFSI</i> is testament to BASIC and assembler working together.This is only a start.<p>&nbsp;<p>&nbsp;<p><h2>Variations on a theme</h2>If you have no forward references, you can dispose of the FOR loop.<p><pre>DIM code% 16P% = code%[ OPT   2  MOV   R0, #0  CMP   PC, PC  MOVEQ R0, #&FF  MOV   PC, R14]PRINT USR(code%)</pre>This snippet of code is a processor-independent way of determining if the system is in 26bit modeor 32bit mode. <a href="32bit.html">Read this if you are interested in the difference.</a><br>In 26bit mode, when R15 is the first operand, only the PC (<a href="regs.html">ProgramCounter</a>) part is available. The PSR (<a href="psr.html">Processor Status Register</a>) isstripped.<br>As the second operand, all 32bits are available. Thus, on a 26bit system the comparison fails.<br>In 32bit mode, R15 is the PC and only the PC. There is no PSR. This, the comparison passes andR0 is updated to be 255.<p>&nbsp;<p><hr size = 3><a href="index.html#04">Return to assembler index</a><hr size = 3><address>Copyright &copy; 2001 Richard Murray</address></body></html>

?? 快捷鍵說明

復制代碼 Ctrl + C
搜索代碼 Ctrl + F
全屏模式 F11
切換主題 Ctrl + Shift + D
顯示快捷鍵 ?
增大字號 Ctrl + =
減小字號 Ctrl + -
亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频
中文字幕日韩av资源站| 国产一区在线精品| 欧美二区在线观看| 成人午夜电影小说| 午夜精品久久一牛影视| 久久久精品一品道一区| 欧美亚洲动漫另类| 成年人网站91| 国产真实乱偷精品视频免| 夜夜精品浪潮av一区二区三区| 欧美一区二区三区视频| 色综合久久久久综合| 国产成人免费视| 卡一卡二国产精品 | 香蕉av福利精品导航| 国产精品精品国产色婷婷| 日韩欧美一级片| 欧美日韩情趣电影| 色综合久久久久综合99| 成人av资源站| 国产高清不卡一区| 精品一区二区av| 日韩精品一区第一页| 亚洲黄色免费网站| 中文字幕乱码日本亚洲一区二区 | 一区二区三区四区av| 国产精品人成在线观看免费| 日韩一区二区三区电影| 欧美性色黄大片| 色天使色偷偷av一区二区| 成人精品gif动图一区| 韩日av一区二区| 久久精品国产精品亚洲精品| 天天操天天综合网| 亚洲成人av电影在线| 亚洲男人天堂av网| 一区二区三区丝袜| 亚洲欧美日韩中文播放 | 亚洲精品五月天| 亚洲激情欧美激情| 亚洲韩国精品一区| 亚洲电影第三页| 日韩精品色哟哟| 日本不卡一区二区| 免费成人深夜小野草| 久久成人久久爱| 国产精品99久久久久久有的能看 | 色综合天天做天天爱| 99国产精品久| 欧美在线一二三| 欧美日韩国产免费一区二区| 欧美日韩一区在线| 日韩欧美一区中文| 亚洲精品一区在线观看| 欧美韩国日本综合| 亚洲欧美激情小说另类| 亚洲国产裸拍裸体视频在线观看乱了 | 黄一区二区三区| 国产精品一区免费在线观看| 不卡av在线免费观看| 日本乱人伦aⅴ精品| 欧美浪妇xxxx高跟鞋交| 日韩三级视频中文字幕| 中文字幕av一区 二区| 亚洲精品一二三四区| 亚洲成av人片观看| 国产一区二区三区蝌蚪| 97久久精品人人做人人爽 | 国产精品乱码人人做人人爱| 亚洲欧美精品午睡沙发| 日日摸夜夜添夜夜添国产精品| 免费看日韩精品| 成人18精品视频| 欧美欧美欧美欧美| 337p粉嫩大胆噜噜噜噜噜91av| 中文字幕亚洲成人| 婷婷丁香久久五月婷婷| 国产一区二区视频在线| 91免费国产在线| 欧美成人免费网站| 亚洲三级在线看| 麻豆免费精品视频| 91欧美一区二区| 欧美一级生活片| 国产精品成人免费精品自在线观看| 亚洲高清在线视频| 成人午夜av电影| 91精品国产综合久久久久久漫画| 国产日产欧产精品推荐色| 亚洲愉拍自拍另类高清精品| 国产一区二区调教| 欧美在线免费视屏| 欧美亚洲精品一区| 久久影音资源网| 自拍视频在线观看一区二区| 午夜久久久影院| 国产69精品久久久久毛片| 欧美三级电影网站| 国产亚洲一区二区三区四区| 一区二区成人在线| 国内精品伊人久久久久av一坑 | 成人蜜臀av电影| 欧美日韩国产美女| 国产嫩草影院久久久久| 午夜欧美视频在线观看| 成人黄色电影在线| 7777精品伊人久久久大香线蕉最新版 | 一本色道**综合亚洲精品蜜桃冫| 日韩精品自拍偷拍| 亚洲老妇xxxxxx| 粉嫩高潮美女一区二区三区 | 亚洲精品国产a| 国产精品一卡二卡| 欧美日韩国产免费| 综合自拍亚洲综合图不卡区| 久久精品久久精品| 欧美色图在线观看| 国产精品日韩成人| 国产高清亚洲一区| 日韩视频免费观看高清在线视频| 一区二区三区在线观看欧美| 国产精品一区二区男女羞羞无遮挡| 欧美巨大另类极品videosbest | 久久久99久久精品欧美| 日韩黄色免费网站| 色狠狠桃花综合| 国产精品无遮挡| 国产一区二区免费看| 精品国产乱码久久久久久闺蜜| 亚洲444eee在线观看| 91蜜桃婷婷狠狠久久综合9色| 精品88久久久久88久久久| 视频一区欧美精品| 在线一区二区视频| 国产免费久久精品| 不卡高清视频专区| 国产精品久久久久久久久久久免费看 | 男女视频一区二区| 在线精品国精品国产尤物884a| 国产精品国产a级| 懂色av一区二区夜夜嗨| 国产日韩欧美不卡在线| 国内精品自线一区二区三区视频| 91精品国产91久久久久久最新毛片| 亚洲一区二区三区四区中文字幕| 91网站在线播放| 亚洲视频在线观看一区| 国产精品18久久久久久久久久久久| 久久亚区不卡日本| 国产一区二区在线观看视频| 久久在线免费观看| 日韩黄色一级片| 欧美一区二区三区电影| 亚洲午夜视频在线| 91精品国产综合久久精品app| 亚洲成av人片在线观看| 555www色欧美视频| 亚洲美女在线一区| 久久精品国产免费看久久精品| 日韩欧美在线1卡| 黄色成人免费在线| 国产亚洲女人久久久久毛片| 国产a视频精品免费观看| 国产午夜亚洲精品理论片色戒| 99热这里都是精品| 亚洲欧洲制服丝袜| 欧美日韩精品一区二区三区| 亚洲成a人片在线不卡一二三区| 欧美精品粉嫩高潮一区二区| 免费成人小视频| 久久久久久毛片| 成人av片在线观看| 亚洲黄色性网站| 欧美精品18+| 午夜精品福利视频网站| 久久影音资源网| 99re这里都是精品| 偷拍与自拍一区| 精品国产91亚洲一区二区三区婷婷| 久久国产精品72免费观看| 国产精品久久久一区麻豆最新章节| 99精品久久免费看蜜臀剧情介绍| 亚洲妇女屁股眼交7| 精品美女一区二区| 成人精品国产免费网站| 亚洲gay无套男同| 久久亚洲免费视频| 91在线视频在线| 日韩精品成人一区二区在线| 久久你懂得1024| 国产一区免费电影| 亚洲aⅴ怡春院| 欧美国产日韩精品免费观看| 在线精品视频一区二区| 韩国成人在线视频| 99精品热视频| 精品一区二区在线视频| 亚洲欧美日韩国产综合在线| 日韩视频在线永久播放| www.亚洲色图|