I have been working with assembly (TASM32) for a few months now and have ran into a problem which I cannot fix. Here's a working example written in C++ which needs to be converted to assembly.
Here's the assembly version I've written. It goes through the five names fine, after the names, it brings up a message box with random characters.
Does anyone know what the problem is, or have any suggestions for me? This seems much more complicated than it should be...
Sorry for my English.
Thank you,
Stefan Kendrick
Code:
#include <windows.h>
int main(){
char *name_list[5] = {"Micheal", "Stefan", "Judy", "William", "Lora"};
for(int i = 0; i < 5; i++){
MessageBox(0, name_list[i], name_list[i], 0);
}
return 0;
}
Code:
.386
.model flat
EXTRN MessageBoxA : PROC
EXTRN ExitProcess : PROC
.DATA
dd ? ; TASM gayness
.CODE
MAIN:
pushad
call lblNames
db "Micheal", 0
db "Stefan", 0
db "Judy", 0
db "William", 0
db "Lora", 0
lblNames:
pop esi ; esi = current name
push 5 ; 5 names
pop ecx ; ecx = counter
lblNameLoop:
push 0
push esi
push esi
push 0
call MessageBoxA
lblNextChar:
lodsb
test al, al
jnz lblNextChar
pop ecx
loop lblNameLoop
popad
push 0
call ExitProcess
END MAIN
Sorry for my English.
Thank you,
Stefan Kendrick