From 67d25d837ac55f28a366c0a3b262e439a6e75fc3 Mon Sep 17 00:00:00 2001 From: Dimitri Sokolyuk Date: Sat, 19 Aug 2017 12:15:28 +0200 Subject: Add AmForth --- amforth-6.5/msp430/words/cmove.asm | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) create mode 100644 amforth-6.5/msp430/words/cmove.asm (limited to 'amforth-6.5/msp430/words/cmove.asm') diff --git a/amforth-6.5/msp430/words/cmove.asm b/amforth-6.5/msp430/words/cmove.asm new file mode 100644 index 0000000..a25b255 --- /dev/null +++ b/amforth-6.5/msp430/words/cmove.asm @@ -0,0 +1,16 @@ +;X CMOVE c-addr1 c-addr2 u -- move from bottom +; as defined in the ANSI optional String word set +; On byte machines, CMOVE and CMOVE> are logical +; factors of MOVE. They are easy to implement on +; CPUs which have a block-move instruction. + CODEHEADER(XT_CMOVE,5,"cmove") + MOV @PSP+,W ; dest adrs + MOV @PSP+,X ; src adrs + CMP #0,TOS + JZ CMOVE_X +CMOVE_1: MOV.B @X+,0(W) ; copy byte + ADD #1,W + SUB #1,TOS + JNZ CMOVE_1 +CMOVE_X: MOV @PSP+,TOS ; pop new TOS + NEXT -- cgit v1.2.3