old-trainOS/scripts/main.spark

45 lines
533 B
Text
Raw Normal View History

.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