Permalink
Cannot retrieve contributors at this time
Name already in use
A tag already exists with the provided branch name. Many Git commands accept both tag and branch names, so creating this branch may cause unexpected behavior. Are you sure you want to create this branch?
Project-Archive/207SE/wk2/dumbStars.asm
Go to fileThis commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
69 lines (45 sloc)
977 Bytes
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
section .data ;Data segment | |
star1 db '*', 0x0a ;new lines | |
lenStar1 equ $-star1 | |
star2 db '**', 0x0a | |
lenStar2 equ $-star2 | |
star3 db '***', 0x0a | |
lenStar3 equ $-star3 | |
star4 db '****', 0x0a | |
lenStar4 equ $-star4 | |
star5 db '*****', 0x0a | |
lenStar5 equ $-star5 | |
newLine db '0x0a' | |
lenNL equ $-newLine | |
section .text ;Code Segment | |
global _start | |
_start: ;User prompt | |
mov eax, 4 | |
mov ebx, 1 | |
mov ecx, star1 | |
mov edx, lenStar1 | |
int 0x80 | |
mov eax, 4 | |
mov ebx, 1 | |
mov ecx, star2 | |
mov edx, lenStar2 | |
int 0x80 | |
mov eax, 4 | |
mov ebx, 1 | |
mov ecx, star3 | |
mov edx, lenStar3 | |
int 0x80 | |
mov eax, 4 | |
mov ebx, 1 | |
mov ecx, star4 | |
mov edx, lenStar4 | |
int 0x80 | |
mov eax, 4 | |
mov ebx, 1 | |
mov ecx, star5 | |
mov edx, lenStar5 | |
int 0x80 | |
;exit condition | |
mov eax, 1 | |
mov ebx, 0 | |
int 0x80 | |