DragonVM/extra/dss/newTest.dss

80 lines
No EOL
919 B
Text

.load 0x1740
@struct Rectangle
width:2 > 0x11, 0x22
height:2 > 0x99
x:2
y:2 > 0xAA
@end
.data
$string "Hello World!!"
$rect <Rectangle> = (0x11, 0x22, 0x33, 0x44, 0x55, 0x66, 0x77, 0x88)
$test_byte 0xAF
$super_long_variable_name 0x01, 0x02, 0x03, 0x04
.code
begin:
mov R10, Rectangle.SIZE
mov R9, [$rect.height]
mov R8, [$rect.width]
mov R7, [$rect.x]
mov R5, $strlen
push $string
push 1
call R5
push 0
call $testinttest
debug_break
mov [$rect.y], 0x0000
## debug_break
jmp $begin
push $string
push 1
call $strlen
mov R1, RV
mov IP, 0x0001
mov R1, RV
hlt
testinttest:
push 0
call $inttest
ret
inttest:
push 0
call $testint
ret
testint:
push 0
call $test_int
ret
test_int:
push 0
call $int_test
ret
int_test:
nop
ret
strlen:
arg R1
mov R2, 0
loop:
movb ACC, *R1
inc R1
jeq $loop_end, 0
not_zero:
inc R2
jmp $loop
loop_end:
mov RV, R2
ret
.fixed 512, 0x00