汇编学习例程 第1~2章

汇编学习例程

; 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

;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

;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
。。。。。。。。。。无图。。。。。。。。。。。。
;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
汇编学习例程 第1~2章_第1张图片

;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
汇编学习例程 第1~2章_第2张图片

;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
。。。。。。。。。。无图。。。。。。。。。。。。


;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 exit 0 end start 
汇编学习例程 第1~2章_第3张图片

;eg0207.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 eax,dword ptr array mov ebx,type bvar mov ecx,type wvar mov edx,type dvar mov esi,lengthof array mov edi,sizeof array mov ebp,arr_size call disprd exit 0 end start
。。。。。。。。。。无图。。。。。。。。。。。。


;eg0208.asm in Windows Console include io32.inc .data const = 64 bvar byte 87h,49h dvar dword 12345678h,12 .code start: mov al,12h mov ah,'d' lab1: mov bx,-1 mov ecx,const mov edx,const*4/type dvar mov esi,offset bvar mov edi,lab1 mov bvar,01001100b mov dvar+4,12h call disprd exit 0 end start
汇编学习例程 第1~2章_第4张图片




   

你可能感兴趣的:(汇编学习例程 第1~2章)