FreeBasic Bare Bones: Difference between revisions
→kernel.bas
[unchecked revision] | [unchecked revision] |
(fixed <pipe> and compiler issues as posted by ScorchOS) |
|||
Line 114:
<!-- GeSHi is *broken*. don't use freebasic as language here !-->
<source lang="qbasic">
Declare Sub PrintString(src
Declare Sub main ()
Sub multiboot ()
Asm▼
const CHECKSUM = -(MAGIC + FLAGS)
▲ .set ALIGN, 1<<0
const STACKSIZE = &h4000
▲ .set MEMINFO, 1<<1
▲ Asm
▲ .set FLAGS, ALIGN | MEMINFO
▲ .set MAGIC, 0x1BADB002
.
.LONG FLAGS
.
▲ .long FLAGS
▲ .comm stack, STACKSIZE, 32
.global loader
loader:
lea esp, [stack + STACKSIZE]
push eax
push ebx
cli
hlt
End Asm
End Sub
Sub main ()
Const s = "Hello World"
PrintString CPtr(Byte Ptr, @s), 35, 12
End Sub
Sub PrintString(src
Dim dst
Dim counter
dst = CPtr(Byte Ptr, &HB8000 + y * 160 + x * 2)
counter = 0
dst[2 * counter] = src[counter]
dst[2 * counter + 1] = 15
counter = counter + 1
End Sub
</source>
|