assembly-Sprache, die Hilfe bei der Suche nach agrv[1][0]

Ich versuche, das erste element von dem, was gespeichert ist in argv[1] in x86-Assembler.
Ich knallte den Stapel zweimal, um eax zunächst, weil ich will argc so kann ich die Anzahl der argc. Dann knallte argv zu ebx. Im denken zu setzen [ebx] in bl. Von hier aus bin ich verloren. Ich habe wenig oder keine Erfahrung in der Montage, ich bin gerade auf der Suche, um es zu verstehen.

main:
;
    mov ecx, 0 ;count output characters
    pop eax ;reject this 32 bits
    pop eax ;get argc
    ;
    pop ebx ; get argv
    ;mov bl, [ebx]
    ;
    add al, 30H ;convert integer to ascii
    mov edi, cline ;put char in output buffer
    mov byte [edi],al
    ;inc edi
    ;mov [edi], bl
    inc ecx ;increment output char count
    inc edi ;increment pointer to o/p buffer
    mov al, 0aH ;LF to end line
    mov byte[edi],al ;put it at end of output line
    inc ecx ;increment output char count
    push ecx ;save char count on stack
    mov edx,len ;length of string to write
    mov ecx,msg ;addr of string
    mov ebx,1 ;file descriptor 1 = stdout
    mov eax,4 ;"write" system call
    int 0x80 ;call the kernel
;
    pop edx ;restore char count into edx for system call
    mov ecx,cline ;address of string
    mov ebx,1 ;file descriptor 1 = stdout
  • Vergessen Sie nicht die code Blöcke bitte. Ich befestigt es für Sie.
InformationsquelleAutor sir_t | 2013-11-02
Schreibe einen Kommentar