DASM The Basic Assembler

What is DASM?

DASM is an interpreted programming language I am writing. It is written in Visual Basic 6, and has an easy to use and understand syntax.

Features of DASM

Other Snippets

Compare two numbers

begin

; load two numbers into addresses A and B
move 1 a
move 2 b

; compare them
cmp a b

; if comparison was true then display message
if
out "They're equal"
endif

end.

Subroutines

begin

; Call subroutine
go TheSub

end.

lbl TheSub
out "Hello World"
return

Perform a loop 3 times

; Loops 3 times
begin

; Maximum # of loops
var MaxLoops
move 3 z
let MaxLoops z

; We hold how many times we've looped in address T
move -1 t

; start loop
do

; add 1 to our timer
move 1 a
add a t

; check to see if we've looped 3 times
load MaxLoops a
cmp a t

; if we haven't skip over the next bit of code...
beq skipto

; otherwise break out of loop
break

; code rejoins here
lbl skipto

; message for users
out Loop Completed

; end loop
loop

; message out
out Loop done 3 times!

end.