FreeBasic Bare Bones: Difference between revisions
Jump to navigation
Jump to search
m
Reverted edits by Nathan (Talk); changed back to last version by Combuster
[unchecked revision] | [unchecked revision] |
Line 114:
<!-- GeSHi is *broken*. don't use freebasic as language here !-->
<source lang="qbasic">
Declare Sub PrintString(src
Declare Sub main ()
Sub multiboot ()
const XALIGN = 1 shl 0 ▼
const MEMINFO = 1 shl 1 ▼
'setting up the Multiboot header - see GRUB docs for details
const FLAGS = XALIGN or MEMINFO▼
const MAGIC = &h1BADB002 ▼
▲ Asm
.align 32▼
.
.
.long
.comm stack, STACKSIZE ▼
.long CHECKSUM
.set STACKSIZE, 0x4000
▲ .comm stack, STACKSIZE, 32
.global loader
loader:
lea esp,
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>
|