当前位置:软件学习 > 其它软件 >>

汇编学习例程

汇编学习例程

[cpp] 
<strong><span style="font-size:18px;">; eg0101.asm in Windows Console 
 
include io32.inc 
.data 
msg byte 'Hello, Assembly!',13,10,0 ;字符串 
.code 
start: 
    mov eax, offset msg     ;显示 
    call dispmsg 
     
    exit 0 
    end start</span></strong> 

[cpp]
<strong><span style="font-size:18px;">;eg0201.asm 
 
        include io32.inc 
.data 
const1  byte 100,100d,01100100b,64h,'d' 
const2  byte 1,+127,128,-128,255,-1 
const3  byte 105,-105,32,-32,32h,-32h 
const4  byte '0123456789', 'abcxyz', 'ABCXYZ' 
crlf    byte 0dh,0ah,0 
minint  = 10 
maxint  equ 0ffh 
const5  byte minint,minint+5,maxint-5,maxint-minint 
const6  byte 4*4,34h+34,67h-52h,52h-67h 
        .code 
start: 
        mov eax,offset const4 
        call dispmsg 
         
        exit 0; 
        end start</span></strong> 

[cpp]
<span style="font-size:18px;"><strong>;eg0202.asm 
        include io32.inc 
        .data 
minint  =10 
bvar1    byte 0,128,255,-128,0,+127 
bvar2    byte 1,-1,38,-38,38h,-38h 
bvar3    byte ? 
bvar4    byte 5 dup('$') 
bvar5    byte minint dup(0),minint dup(minint,?) 
         byte 2 dup(2,3,2 dup(4)) 
         .code 
start: 
         exit 0; 
         end start</strong></span> 

[cpp] 
<span style="font-size:18px;color:#000099;"><strong>。。。。。。。。。。无图。。。。。。。。。。。。</strong></span> 
[cpp] 
<span style="font-size:18px;"><strong>;eg0203.asm 
        include io32.inc 
        .data 
minint  =10 
wvar1   word 0,32768,65535,-32768,0,+32767 
wvar2   word 1,-1,38,-38,38h,-38h 
wvar3   word ? 
wvar4   word 2010h,1020h 
        word 5 dup(minint,?) 
wvar6   word 3139h,3832h 
bvar6   byte 39h,31h,32h,38h 
        byte 0 
        .code 
start: 
        mov eax,offset wvar6 
        call dispmsg 
        exit 0 
        end start</strong></span> 

[cpp] 
<span style="font-size:18px;"><strong>;eg0204.asm 
        include io32.inc 
        .data 
minint  = 10 
dvar1   dword 0,80000000h,0fffffffh,-80000000h,0,7fffffffh 
dvar2   dword 1,-1,38,-38,38h,-38h 
dvar3   dword ? 
        dword 2010h,1020h 
dvar5   dword minint dup(minint,?) 
dvar6   dword 38323139h 
bvar6   byte 39h,31h,32h,38h 
        byte 0 
        .code 
start: 
        mov eax,offset dvar6 
        call dispmsg 
        exit 0 
        end start</strong></span> 

[cpp]
<span style="font-size:18px;"><strong>;eg0205.asm 
        include io32.inc 
        .data 
        org 100h 
bvar1   byte 100 
        align 2 
wvar2   word 100 
        align 4 
dvar3   dword ? 
        align 4 
dvar4   dword ? 
        .code 
start: 
        exit 0 
        end start</strong></span> 
[cpp] 
<span style="font-size:18px;"><strong></strong></span><pre name="code" class="cpp"><span style="font-size:18px;color:#000099;"><strong>。。。。。。。。。。无图。。。。。。。。。。。。</strong></span></pre> 
<pre></pre> 
<p></p> 
<pre></pre> 
<p></p> 
<p></p> 
<pre name="code" class="cpp"><span style="font-size:18px;"><strong>;eg0206.asm 
        include io32.inc 
        .data 
bvar    byte 12h,34h 
        org $+10 
array   word 1,2,3,4,5,6,7,8,9,10 
wvar    word 5678h 
arr_size   = $-array 
arr_len = arr_size/2 
dvar    dword 9abcdef0h 
        .code 
start: 
        mov al,bvar 
        mov ah,bvar+1 
        mov bx,wvar[2] 
        mov ecx,arr_len 
        mov edx,$ 
        mov esi,offset dvar 
        mov edi,[esi] 
        mov ebp,dvar 
        call disprd 
         
 &

补充:软件开发 , 其他 ,
CopyRight © 2012 站长网 编程知识问答 www.zzzyk.com All Rights Reserved
部份技术文章来自网络,