Print both sizes

This commit is contained in:
Alex Kotov 2022-01-27 05:28:39 +05:00
parent 53d35a317f
commit b71f68194b
Signed by: kotovalexarian
GPG Key ID: 553C0EBBEB5D5F08
1 changed files with 13 additions and 2 deletions

View File

@ -35,7 +35,8 @@ size: .word _end - _start
disk: .byte 0 disk: .byte 0
newline: .string "\r\n" newline: .string "\r\n"
hello: .string "Hello stage 1!\r\n" hello: .string "Hello stage 1!\r\n"
size_str: .string "Size: " stage1_size_str: .string "Stage 1 size: "
stage2_size_str: .string "Stage 2 size: "
main: main:
cli cli
@ -61,7 +62,17 @@ main:
mov $STAGE2_BASE, %bx /* Address */ mov $STAGE2_BASE, %bx /* Address */
int $0x13 int $0x13
mov $STAGE1_ADDR(size_str), %si mov $STAGE1_ADDR(stage1_size_str), %si
call print_str
mov $STAGE1_ADDR(size), %bx
mov (%bx), %ax
call print_number
mov $STAGE1_ADDR(newline), %si
call print_str
mov $STAGE1_ADDR(stage2_size_str), %si
call print_str call print_str
mov $STAGE2_ADDR(size), %bx mov $STAGE2_ADDR(size), %bx