M bootstrap.asm +4 -9
@@ 299,7 299,7 @@ fcreate write
tail syscall3
section .rodata
- digits db "0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZ"
+ digits db "0123456789abcdefghijklmnopqrstuvwxyz"
; lendigits db $ - digits
section .text
@@ 319,11 319,6 @@ finddigit:
; destroys: rcx, rdi
digit?:
call finddigit
- jz .done
- ; try lower case
- sub rax, 'a' - 'A'
- call finddigit
-.done:
; compute digit
dec rdi ; rdi points to the digit that was found
sub rdi, digits
@@ 336,13 331,13 @@ digit?:
; ( saddr -- 0|[-1 n])
; todo: negative numbers
fcreate number
- mpush rcx, rbx, rdx
+ mpush rcx, rbp, rbx, rdx
; init base^n value with base^0
mov rcx, 1
; sign at front?
- movzx rbp, byte [tos+ptrsize]
- cmp rbp, '-'
+ mov bpl, [tos+ptrsize]
+ cmp bpl, '-'
jnz .positive
.positive:
M system.fox +2 -2
@@ 63,7 63,7 @@ m: nip 08768d48 ,4 ; : nip nip ; ( l
( does not alter flags )
( a b -- b a )
m: swap c28948 ,3 ( mov rdx, rax )
- 068B48 ,3 ( mov rax, [rsi] )
+ 068b48 ,3 ( mov rax, [rsi] )
168948 ,3 ; : swap swap ; ( mov [rsi], rdx )
( does not alter flags )
@@ 241,7 241,7 @@ m: \ begin getc a - drop until ; : \ ^
: lit-4 ^ dup c0c748 ,3 ,4 ; \ mov rax, int32 sign extended
( n -- )
-: lit+ dup 7FFFFFFF - neg drop -if lit8 ;; then lit4 ;
+: lit+ dup 7fffffff - neg drop -if lit8 ;; then lit4 ;
: lit- dup 80000000 + drop -if lit8 ;; then lit-4 ;
( c: n -- ; r: -- n )