# include <stdio.h>
int main(void) {
int num = 0;
char* sprompt = "%d";
char* star = "*";
char* s = "\n";
__asm {
lea edi, dword ptr[num]; // edi = &num
push edi;
push sprompt; // "%d"
call dword ptr[scanf]; // scanf("%d", &num);
/////////////////////////////////////
mov ecx, num;
mov eax, 1;
L: // stair
push ecx;
mov ecx, eax;
push eax;
L1: // '*'
push ecx;
push star;
call dword ptr[printf];
pop ebx;
pop ecx;
loop L1;
push s;
call dword ptr[printf];
pop ebx;
pop eax;
add eax, 1;
pop ecx;
loop L;
}
}
'어셈블리' 카테고리의 다른 글
stack 구조 엑셀 (0) | 2017.11.14 |
---|---|
임시 (0) | 2017.11.08 |
별찍기 어셈블 코드 (0) | 2017.10.30 |
소수 판별 코드 인라인 어셈블리 (0) | 2017.10.26 |
최대값 임시 수정해야될 코드 (0) | 2017.10.24 |