I am working with figforth.
I have 12 words on the stack w1..w12. I have construct an assembly routine to rotate 4 words as a block.
( w1 w2 w3 w4 w5 w6 w7 w8 w9 w10 w11 w12 FROT w5 w6 w7 w8 w9 w10 w11 w12 w1 w2 w3 w4 )
But it seems not to work, and I can't figure it out why it is not working.
Please need some help to get it running.
Thanks in advance.
Jan
Code:
ASSEMBLER HEX
CODE FROT ( F1 F2 F3 --- F2 F3 F1 )
XSAVE STX, # 8 LDY,
BEGIN, 0 ,X LDA, PHA, INX, DEY,
0= UNTIL, XSAVE LDX, # 10 LDY,
BEGIN, 8 ,X LDA, 0 ,X STA, INX,
DEY, 0= UNTIL, XSAVE LDX, # 8 LDY,
BEGIN, PLA, 17 ,X STA, DEX, DEY,
0= UNTIL, XSAVE LDX, NEXT JMP,
END-CODE
Code:
* = $3571
3571 86 B5 STX $B5
3573 A0 08 LDY #$08
3575 B5 00 L3575 LDA $00,X
3577 48 PHA
3578 E8 INX
3579 88 DEY
357A D0 F9 BNE L3575
357C A6 B5 LDX $B5
357E A0 10 LDY #$10
3580 B5 08 L3580 LDA $08,X
3582 95 00 STA $00,X
3584 E8 INX
3585 88 DEY
3586 D0 F8 BNE L3580
3588 A6 B5 LDX $B5
358A A0 08 LDY #$08
358C 68 L358C PLA
358D 95 0F STA $0F,X
358F CA DEX
3590 88 DEY
3591 D0 F9 BNE L358C
3593 A6 B5 LDX $B5
3595 4C 46 04 JMP $0446
.END
;auto-generated symbols and labels
L3575 $3575
L3580 $3580
L358C $358C