add: minilibc to the examples
This commit is contained in:
18
examples/minilibc/strlen.pasm
Normal file
18
examples/minilibc/strlen.pasm
Normal file
@@ -0,0 +1,18 @@
|
||||
; strlen
|
||||
|
||||
set str "hello, world !\0"
|
||||
|
||||
end_:
|
||||
mov eax, a2
|
||||
end
|
||||
|
||||
main:
|
||||
mov a1, str
|
||||
mov a2, 0
|
||||
|
||||
loop:
|
||||
cmp (char)*a1, 0
|
||||
je end_
|
||||
add a2, 1
|
||||
add a1, 1
|
||||
jmp loop
|
||||
Reference in New Issue
Block a user