如何在sasm中定义stcat,strlen,substr

时间:2014-06-04 11:26:48

标签: assembly nasm

我正在使用Sasm Ide。我想知道如何在sasm中定义strcat,substr,strlen宏

   %include "io.inc"
    %define String "abc"
    %strcat "Alpha: ", '12" screen'
    %strcat beta '"foo"\', "'bar'"

    section .text
    global CMAIN
    CMAIN:
    PRINT_STRING String

        ;write your code here
        xor eax, eax
        ret

1 个答案:

答案 0 :(得分:0)

%include "io.inc"
%defstr myname ABC
%strlen length myname
%substr text "This is String" 3,2 
%strcat names 'Assembly' , '.Language'


section .text
global CMAIN
CMAIN:
PRINT_STRING myname
NEWLINE
PRINT_DEC 2,length
NEWLINE
PRINT_STRING text
NEWLINE
PRINT_STRING names 

    ;write your code here
    xor eax, eax
    ret