aboutsummaryrefslogtreecommitdiff
path: root/forth/forth/avr/asm2test.fs
blob: 976420b4c29c226931122c3278237dc605725300 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
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
;