old-trainOS/scripts/main.spark
2015-10-08 00:29:11 +02:00

44 lines
533 B
Text

.name OS
.author "Felix Queißner"
.descr "The main file of the operating system"
; PUB main()
main:
pushi 0
pusht "Hello World from Conductance!\n"
calln print 1
_loop:
load 0
pushi 5
comp_less
jmp_if_not _end
load 0
pushi 1
add
store 0
pusht "counter: "
load 0
pusht "\n"
calln print 3
jmp _loop
_end:
; Our OS should not go into shutdown mode...
jmp _end
ret
; PUB irq( id : INT32, data : CPUSTATE )
irq:
pusht "Hello IRQ: "
load -1
pusht ", "
load -2
readfld eax
pusht "\n"
calln print 5
ret