X-Git-Url: https://git.rrq.au/?a=blobdiff_plain;ds=sidebyside;f=impl.asm;h=c713036c82afb2743c45a547e4b315ac4bf41ba4;hb=fbd07fa0c1aaad0cca46f9b1fc4839e053454f03;hp=a9b8564e19faeb9c6bdf3ed7b8906f1dccf7d533;hpb=4061939a8f1a4afd749434ed70a6122016c0a8dc;p=rrq%2Fjonasforth.git diff --git a/impl.asm b/impl.asm index a9b8564..c713036 100644 --- a/impl.asm +++ b/impl.asm @@ -129,6 +129,27 @@ read_word: ret +;; Read a word from a buffer. Returns the buffer without the word, as well as +;; the word that was read (including lengths). +;; +;; Inputs: +;; * rsi = Input buffer +;; * rcx = Length of buffer +;; +;; Outputs: +;; * rsi = Updated buffer +;; * rcx = Length of updated buffer +;; * rdi = Word buffer +;; * rdx = Length of word buffer +pop_word: + mov rdi, rsi + mov rdx, 10 + + add rsi, 10 + sub rcx, 10 + + ret + ;; Parses a string. ;; ;; Parameters: