summaryrefslogtreecommitdiff
path: root/zap/source/amd64/mem/memfill.S
diff options
context:
space:
mode:
Diffstat (limited to 'zap/source/amd64/mem/memfill.S')
-rw-r--r--zap/source/amd64/mem/memfill.S34
1 files changed, 0 insertions, 34 deletions
diff --git a/zap/source/amd64/mem/memfill.S b/zap/source/amd64/mem/memfill.S
deleted file mode 100644
index c38eec8..0000000
--- a/zap/source/amd64/mem/memfill.S
+++ /dev/null
@@ -1,34 +0,0 @@
-# Copyright 2022 Gabriel Jensen.
-# This Source Code Form is subject to the terms of the Mozilla Public License, v. 2.0.
-# If a copy of the MPL was not distributed with this file, You can obtain one at https://mozilla.org/MPL/2.0/.
-
-.globl zap_memfill
-
-zap_memfill:
-# Address of the current element:
-#define addr %rdi
-# Address of the element after the last element:
-#define afterbuf %rsi
-# Byte value:
-#define val %dl
-
- addq addr,afterbuf # afterbuf += addr // afterbuf contains the number of bytes
-
- # Iterate over buffer:
-.loop:
-
- # Check if we have reached the final element:
- cmpq addr,afterbuf # if (addr == afterbuf)
- je .done # goto done
-
- # Set the value of the current element:
- movb val,(addr) # *addr = val
-
- # Continue to next element:
- incq addr # ++addr
- jmp .loop # goto loop
-
- # Finish:
-.done:
-
- ret # return