aboutsummaryrefslogtreecommitdiff
path: root/forth/forth/avr/asm2test.fs
diff options
context:
space:
mode:
authorDimitri Sokolyuk <demon@dim13.org>2018-09-29 01:02:00 +0200
committerDimitri Sokolyuk <demon@dim13.org>2018-09-29 01:02:00 +0200
commit79cabd5b1c8bcd9f50dc49e77776e713a57dff48 (patch)
tree6eb73857e9c174610839291cf05a02d77fc82b8c /forth/forth/avr/asm2test.fs
parent247df3bb9d4c89d4e5ff18dcc23ba1c9532f28c0 (diff)
parent110a6411bae421260476eacf6173897c1d1f4b8a (diff)
Merge branch 'master' of dim13.org:elegoo
Diffstat (limited to 'forth/forth/avr/asm2test.fs')
-rw-r--r--forth/forth/avr/asm2test.fs32
1 files changed, 32 insertions, 0 deletions
diff --git a/forth/forth/avr/asm2test.fs b/forth/forth/avr/asm2test.fs
new file mode 100644
index 0000000..976420b
--- /dev/null
+++ b/forth/forth/avr/asm2test.fs
@@ -0,0 +1,32 @@
+
+-asmtest
+marker -asmtest
+
+: qq
+ as: if eq
+ as: nop
+ as: then
+;
+
+: ww
+ as: begin
+ as: nop
+ as: until eq
+;
+\ square root of unsigned cell.
+: sqrt ( u --- u )
+ as: adiw r24 1
+ as: ldi r16 $00
+ as: ldi r17 $80
+ as: begin
+ as: eor r16 r17
+ as: mul r16 r16
+ as: cp r0 r24
+ as: cpc r1 r25
+ as: if sh
+ as: eor r16 r17
+ as: then
+ as: lsr r17
+ as: until eq
+ as: movw r24 r16
+; \ No newline at end of file