Data commit

This commit is contained in:
Ingy döt Net 2023-07-01 11:58:00 -04:00
parent 7387c8f97b
commit cb5bb5e222
199093 changed files with 3378972 additions and 0 deletions

View file

@ -0,0 +1,20 @@
section .data
string db "Hello World", 0
section .bss
string2 resb 12
section .text
global _main
_main:
mov ecx, 0
looping:
mov al, [string + ecx]
mov [string2 + ecx], al
inc ecx
cmp al, 0 ;copy until we find the terminating 0
je end
jmp looping
end:
xor eax, eax
ret

View file

@ -0,0 +1,22 @@
section .data
string db 11,"Hello World"
section .bss
string2 resb 12
section .text
global _main
_main:
xor ecx, ecx ;clear ecx
mov cl, [string]
mov [string2], cl ;copy byte signaling length
mov edx, 1
looping: ;copy each single byte
mov al, [string + edx]
mov [string2 + edx], al
inc edx
dec ecx
cmp ecx, 0
jg looping
xor eax, eax
ret