Simplify print number procedure #262
Replies: 3 comments 1 reply
-
The main issue with your proposed implementation is that it is recursive and will use more space in stack frames than the existing implementation uses in creating a fixed-size buffer. It is also worth noting that the existing |
Beta Was this translation helpful? Give feedback.
-
Recursive in assembler makes one div per character, and div is a very slow operation |
Beta Was this translation helpful? Give feedback.
-
This whole discussion is moot as this function is never used. The one place where the bootloader prints arbitrary decimal integers is the video mode selection screen, which uses a different implementation. |
Beta Was this translation helpful? Give feedback.
-
toaruos/boot/text.c
Line 262 in a24baa2
`void print_uint_(unsigned int n)
{
if(n/10) {
print_uint_(n/10);
}
putchar(n%10 + '0');
}`
Beta Was this translation helpful? Give feedback.
All reactions