deleted old files and modified some dsa source files

This commit is contained in:
2026-02-04 01:58:37 +00:00
parent 889ee8ef71
commit 7780f5804f
8 changed files with 223 additions and 224 deletions
+44 -38
View File
@@ -1,45 +1,51 @@
include fib: "./lib/maths/fib.dsa"
include maths: "./lib/maths/core.dsa"
include print: "./lib/io/print.dsa"
dw idt: 0xFFFF0000
// GENERATED BY DSC COMPILER
// Generated at 2026-02-04 01:44:06
// Imports
include print: "./lib/io/print.dsa"
include fib: "./lib/maths/fib.dsa"
// Globals & Reserved Memory
// Entry Point
dw stack: 0x10000
init:
// setup interrupt handlers
ldw idt, idr
lwi handle_hard_fault, rg0
stw rg0, idr, 4
// set up a stack.
db message: "Process Exited with code:"
_init:
ldw stack, bpr
mov bpr, spr
dw string: "hello world"
start:
lwi 100, rg0
lwi 10, rg1
push rg1
push rg0
call maths::new_divide
pop rg0
pop rg1
hlt
pop rg0
pop zero
push rg0
call print::print_num
pop zero
hlt
// fault handler in case we fail DSA.
dw hard_fault_err: "FATAL: Illegal Instruction or Memory Access!"
handle_hard_fault:
call print::clear
call print::reset
lwi hard_fault_err, rg0
push zero
call main
call print::print_newline
lwi message, rg0
push rg0
call print::print
pop zero
hlt
call print::print_hex_word
pop zero
hlt
// Return
_ret:
mov bpr, spr
pop bpr
return
// Compiled Code Starts...
main:
push bpr
mov spr, bpr
lli 6, rg0
push rg0 // bpr-4: x
push rg0 // push arg 0
call fib::fib_n
pop rg1
push rg1 // bpr-8: y
push rg1 // push arg 0
call print::print_num
pop zero
jmp _ret