Create learn asm repo
Repository for learning assembly language
This commit is contained in:
Executable
BIN
Binary file not shown.
@@ -0,0 +1,34 @@
|
||||
|
||||
SECTION .data
|
||||
msg db 'A cat!', 0Ah
|
||||
|
||||
SECTION .text
|
||||
global _start
|
||||
|
||||
_start:
|
||||
mov edx, msg
|
||||
call strlen
|
||||
|
||||
mov ecx, msg
|
||||
mov ebx, 1
|
||||
mov eax, 4
|
||||
int 80h
|
||||
|
||||
mov ebx, 0
|
||||
mov eax, 1
|
||||
int 80h
|
||||
|
||||
strlen:
|
||||
push ebx
|
||||
mov ebx, edx
|
||||
|
||||
nextchar:
|
||||
cmp byte [edx], 0
|
||||
jz finished
|
||||
inc edx
|
||||
jmp nextchar
|
||||
|
||||
finished:
|
||||
sub edx, ebx
|
||||
pop ebx
|
||||
ret
|
||||
Binary file not shown.
Reference in New Issue
Block a user