学 Win32 汇编[7]: 定义字符串

学 Win32 汇编[7]: 定义字符串


例一
; Test7_1.asm
.386
.model flat, stdcall

include    windows.inc
include    kernel32.inc
include    masm32.inc
include    debug.inc
includelib kernel32.lib
includelib masm32.lib
includelib debug.lib

.data
    v1 db 'ABCDEFG', 0
    v2 db "ABCDEFG", 0
    v3 db 'A', 'B', 'C', 'D', 'E', 'F', 'G', 0
    v4 db 'ABC', 'DEFG', 0
    v5 db 65, 66, 67, 68, 69, 70, 71, 0
    v6 db 'A', 'A'+1, "C", 44h, 105o, 70, 1000111b, 0
.code
start:
    PrintString v1  ;ABCDEFG
    PrintString v2  ;ABCDEFG
    PrintString v3  ;ABCDEFG
    PrintString v4  ;ABCDEFG
    PrintString v5  ;ABCDEFG
    PrintString v6  ;ABCDEFG
    ret
end start

例二:
; Test7_2.asm
.386
.model flat, stdcall

include    windows.inc
include    kernel32.inc
include    masm32.inc
include    debug.inc
includelib kernel32.lib
includelib masm32.lib
includelib debug.lib

.data
    v1 db 3 dup('A'), 0
    v2 db 3 dup('Del'), 0
.code
start:
    PrintString v1  ;AAA
    PrintString v2  ;DelDelDel
    ret
end start

posted on 2010-04-04 19:08  万一  阅读(4026)  评论(0)  编辑  收藏
上一篇:python中字符串相关内置方法


下一篇:Linux 磁盘分区和挂载