* mikeOS 16 bit and amd64 baremetal
[mascara-docs.git] / amd64 / bareMetalOS-0.5.2 / baremetal0.5.2 / programs / test.asm
blob9360e5512892285abf310983a2a004a6a1406c1a
1 [bits 64]
2 [org 0x0000000000200000]
3 %include "bmdev.asm"
5 start:
6 mov rsi, corecnt
7 call b_print_string
8 call b_smp_numcores
9 mov rdi, buffer
10 call b_int_to_string
11 mov rsi, buffer
12 call b_print_string
13 call b_print_newline
14 call task
15 mov rbx, 14
17 cycle:
18 push rbx
19 mov rax, task
20 call b_smp_enqueue
21 pop rbx
22 dec rbx
23 or rbx, rbx
24 jnz cycle
26 call b_smp_wait
27 call b_print_newline
28 mov rsi, finmsg
29 call b_print_string
30 ret
32 task:
33 call b_print_newline
34 mov rsi, corenum
35 call b_print_string
37 call b_smp_get_id
38 mov rdi, buffer
39 call b_int_to_string
40 mov rsi, buffer
41 call b_print_string
43 mov rsi, separator
44 call b_print_string
46 inc qword [number]
47 mov rax, [number]
48 mov rdi, buffer
49 call b_int_to_string
50 mov rsi, buffer
51 call b_print_string
53 mov rcx, 24
54 call b_delay
56 ret
58 corecnt db "Total Available Cores:",0
59 corenum db "Core:",0
60 finmsg db "Finished.", 0
61 separator db " ",0
62 number db 0,0,0,0,0,0,0,0
63 buffer resb 64