Skip to content

Commit fae1dca

Browse files
committed
[skip ci] default to relative addressing in assembly
1 parent fae1829 commit fae1dca

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

count.asm

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,7 @@
77
; - https://www.muppetlabs.com/~breadbox/software/tiny/teensy.html
88

99
BITS 64
10+
DEFAULT REL ; Use RIP-relative addressing by default which is faster and smaller
1011

1112
; Needs to be page aligned - there is some historical reasons why it's usually
1213
; set to 0x08048000 but it's not required. From my testing 0x10000 is the lowest
@@ -82,7 +83,7 @@ print:
8283
to_decimal_loop:
8384
xor edx, edx ; `edx` must be zeroed (`edx` and `eax` are combined for 64bit division)
8485
div dword [ten] ; divide by 10
85-
add edx, '0' ; remainer in `edx`, convert it to ascii
86+
add edx, '0' ; remainder in `edx`, convert it to ascii
8687
dec rsi ; move to the previous char in the buffer
8788
mov [rsi], dl ; store the ascii character
8889
test eax, eax ; quotient in `eax`, test if 0

0 commit comments

Comments
 (0)