ALP to print the stars using times directive (32-bit)
kw.asm
section .data title db "———————————————————————————" db 10, "ALP to print the stars" db 10, "———————————————————————————",10 title_len equ $-title star times 10 db "*" end db 10, "———————————————————————————",10 end_len equ $-end section .bss %macro display 4 mov eax,%1 mov ebx,%2 mov ecx,%3 mov edx,%4 int 80h %endm section .text global _start _start: display 4,1,title,title_len display 4,1,star,10 display 4,1,end,end_len exit: mov ebx,0 mov eax,1 int 80h
Output
kodingwindow@kw:~$ nasm -felf64 kw.asm
kodingwindow@kw:~$ ld kw.o && ./a.out ——————————————————————————— ALP to print the stars ——————————————————————————— ********** ——————————————————————————— kodingwindow@kw:~$
Comments and Reactions
What Next?
ALP to print the ASCII hex to hexadecimal number (32-bit)
ALP to print the given alphanumeric characters (32-bit)
ALP to print the length of a given string (32-bit)
Advertisement