B
bashcommando
Guest
I am attempting to write a OS for fun. I got a error compiling this code using this command. Help?
Code(main.asm):
The command:
The output:
Code(main.asm):
Code:
BITS 64
section .bss
bootmsg db 'Booting...', 0
section .text
global _start
_start:
mov si, bootmsg
call kprintln
mov ax, 0x07C0
mov ds, ax
add ax, 288
mov ss, ax
mov sp, 4096
call setmem
call setscreenmode
setmem:
cli
call a20wait
mov al, 0xAD
out 0x64, al
call a20wait
mov al, 0xD0
out 0x64, al
call a20wait2
in al, 0x60
push eax
call a20wait
mov al, 0xD1
out 0x64, al
call a20wait
pop eax
or al, 2
out 0x60, al
call a20wait
mov al, 0xAE
out 0x64, al
call a20wait
sti
ret
a20wait:
in al, 0x64
test al, 2
jnz a20wait
ret
a20wait2:
in al, 0x64
test al, 1
jz a20wait2
ret
kprintln:
mov ah, 0x0E
.kprintrep:
lodsb
cmp al, 0
je .kdone
int 0x10
jmp .kprintrep
.kdone:
ret
setscreenmode:
out 0x13, 0xA0000
int 0x10
ret
kputpixel:
push rbp
mov rbp, rsp
mov -24(rbp), rdi
mov -28(rbp), esi
mov -32(rbp), edx
mov -36(rbp), ecx
mov edx, -28(rbp)
mov eax, edx
add eax, eax
add edx, eax
mov eax, -32(rbp)
imul eax, eax, $2400
add eax, edx
mov -4(rbp), eax
mov eax, -4(rbp)
add eax, 1
mov edx, eax
mov rax, -24(rbp)
add rdx, rax
mov eax, -36(rbp)
sar eax, 16
mov (rdx), al
mov eax, -4(rdp)
add eax, 2
mov edx, eax
mov rax, -24(rbp)
add rdx, rax
mov eax, -36(rbp)
sar eax, 16
mov (rdx), al
pop rbp
ret
.bootstrap:
cli
hlt
jmp $
times 4096-($-$$) db 0
dw 0xAA55
Code:
nasm -f bin -o test boot.asm
Code:
boot.asm:78: error: comma, colon or end of line expected
boot.asm:79: error: comma, colon or end of line expected
boot.asm:80: error: comma, colon or end of line expected
boot.asm:81: error: comma, colon or end of line expected
boot.asm:82: error: comma, colon or end of line expected
boot.asm:86: error: comma, colon or end of line expected
boot.asm:89: error: comma, colon or end of line expected
boot.asm:90: error: comma, colon or end of line expected
boot.asm:93: error: comma, colon or end of line expected
boot.asm:95: error: comma, colon or end of line expected
boot.asm:98: error: comma, colon or end of line expected
boot.asm:101: error: comma, colon or end of line expected
boot.asm:103: error: comma, colon or end of line expected