Logo 
Search:

Assembly Language Forum

Ask Question   UnAnswered
Home » Forum » Assembly Language       RSS Feeds

Code of String Triangle in Assembly language

  Asked By: Mustabshir    Date: Nov 19    Category: Assembly Language    Views: 1297
  

I need code that how to print strings on screen in Tirangle form like this?

K
KU
KUD
KUDC
KUDCS

Share: 

 

1 Answer Found

 
Answer #1    Answered By: Sergey Kamenev     Answered On: Nov 19

format PE console
include 'win32a.inc'

invoke GetStdHandle,STD_OUTPUT_HANDLE

mov edi,sk
mov ecx,[qcsk]
mov edx,1
mMain:
push ecx
push edx
push edi
push eax

mov ebx,qcio
invoke WriteConsole,eax,edi,edx,ebx,0

pop eax
push eax

mov edi,snl
mov edx,1
mov ebx,qcio
invoke WriteConsole,eax,edi,edx,ebx,0

pop eax
pop edi
pop edx
pop ecx

inc edx
loop mMain

invoke ExitProcess,0

sk db 'KUDCS'
qcsk dd $-sk
qcio dd ?
snl db 10

include 'API\kernel32.inc'

data import

library kernel32,'KERNEL32.DLL'

end data

 
Didn't find what you were looking for? Find more on Code of String Triangle in Assembly language Or get search suggestion and latest updates.




Tagged: