Remove dollar sign ($) from front of number tokens
Number tokens with a dollar sign are kind of cumbersome and don't really serve a purpose, so I'm removing them. Signed-off-by: Alek Ratzloff <alekratz@gmail.com>
This commit is contained in:
@@ -1,52 +1,59 @@
|
||||
.section code $0x0 {
|
||||
.section code 0x1000 {
|
||||
main:
|
||||
; Test that interrupts will not called when enabled flag is not set
|
||||
int 0, 0
|
||||
cmpeq (count), 0
|
||||
jnz end
|
||||
|
||||
; Test divide by zero interrupts
|
||||
|
||||
; div
|
||||
mov %status, $1
|
||||
mov %r0, $1
|
||||
div %r0, $0
|
||||
cmpeq (count), $1
|
||||
add %status, 1
|
||||
mov %r0, 1
|
||||
div %r0, 0
|
||||
cmpeq (count), 1
|
||||
jz end
|
||||
|
||||
; idiv
|
||||
mov %status, $2
|
||||
idiv %r0, $0
|
||||
cmpeq (count), $2
|
||||
add %status, 1
|
||||
idiv %r0, 0
|
||||
cmpeq (count), 2
|
||||
jz end
|
||||
|
||||
mov %status, $0
|
||||
mov %status, 0
|
||||
end:
|
||||
halt
|
||||
|
||||
.align u64
|
||||
divide_by_zero:
|
||||
add (count), $1
|
||||
generic_handler:
|
||||
add (count), 1
|
||||
iret
|
||||
|
||||
.export main
|
||||
.export divide_by_zero
|
||||
.export generic_handler
|
||||
}
|
||||
|
||||
.section ivt $0x1000 {
|
||||
.section ivt 0x1800 {
|
||||
ivt:
|
||||
.interrupt $1, divide_by_zero
|
||||
.interrupt 0, 0
|
||||
.interrupt 0, 0
|
||||
.interrupt 0, 0
|
||||
.interrupt 1, generic_handler
|
||||
.export ivt
|
||||
}
|
||||
|
||||
.section shared $0x2000 {
|
||||
count: .u64 $0
|
||||
.section shared 0x2000 {
|
||||
count: .u64 0
|
||||
.export count
|
||||
}
|
||||
|
||||
.section stack $0x4000 .. $0x5000 {
|
||||
.section stack 0x4000 .. 0x5000 {
|
||||
stack_base:
|
||||
.export stack_base
|
||||
}
|
||||
|
||||
.meta {
|
||||
ip: main
|
||||
flags: $0b100
|
||||
sp: stack_base
|
||||
ivt: ivt
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user