Archived
1
0
This repository has been archived on 2025-01-28. You can view files and clone it, but cannot push or open issues or pull requests.
asm_libs/src/path.asm
2022-11-06 18:21:21 +03:00

30 lines
368 B
NASM

format ELF
public filename as 'path.filename'
include '../include/_macros.inc'
extrn string.len
section '.text' executable
filename:
prelude
mov eax, [ebp+2*4]
push eax
call string.len
pop ebx
.loop:
cmp [ebx+eax], byte '/'
je .break
cmp ebx, 0
je .break
dec ebx
jmp .loop
.break:
add eax, ebx
inc eax
mov [ebp+2*4], eax
postlude
ret