summary |
shortlog |
log |
commit | commitdiff |
tree
raw |
patch |
inline | side by side (from parent 1:
02f53b2)
This procedure did not actually do what it claimed to be doing. It just happened
to work with the way it was called.
;; Parses a string.
;;
;; Parameters:
;; Parses a string.
;;
;; Parameters:
-;; * [.length] = Length of string
-;; * [.buffer] = Pointer to string buffer
+;; * rcx = Length of string
+;; * rdi = Pointer to string buffer
;;
;; Results:
;; * rax = Value
;;
;; Results:
;; * rax = Value
;; Add (10^(rcx-1) * parse_char(rdi[length - rcx])) to the accumulated value
;; for each rcx.
;; Add (10^(rcx-1) * parse_char(rdi[length - rcx])) to the accumulated value
;; for each rcx.
.loop:
;; First, calcuate 10^(rcx - 1)
mov rax, 1
.loop:
;; First, calcuate 10^(rcx - 1)
mov rax, 1
read_word.length db ?
read_word.char_buffer db ?
read_word.length db ?
read_word.char_buffer db ?
-parse_number.buffer dq ?
;; Takes a string on the stack and replaces it with the decimal number that the
;; string represents.
forth_asm PARSE_NUMBER, 'PARSE-NUMBER'
;; Takes a string on the stack and replaces it with the decimal number that the
;; string represents.
forth_asm PARSE_NUMBER, 'PARSE-NUMBER'
- pop [parse_number.length] ; Length
- pop [parse_number.buffer] ; String pointer
+ pop rcx ; Length
+ pop rdi ; String pointer
push rsi
call parse_number
push rsi
call parse_number