From 03f471ba7e466689fca9aac857e53396cca0fdc6 Mon Sep 17 00:00:00 2001 From: Piotr Wiszowaty Date: Wed, 29 Jun 2016 22:10:46 +0200 Subject: [PATCH] Fix m* implementation, correct word list in README --- README.md | 2 +- foco65 | 28 ++++++++++++++-------------- 2 files changed, 15 insertions(+), 15 deletions(-) diff --git a/README.md b/README.md index d1b2a03..14b966c 100644 --- a/README.md +++ b/README.md @@ -191,7 +191,7 @@ Words `+loop` `lshift` `<=` `<` `>=` `>` `-` `+` `or` `over` `rshift` `rsp` `sp` `swap` `unloop` `u<` `u>` `while` `<>` `=` `!` `[` `]` `[code]` `[end-code]` `cell` `cells` `not` `[text-section]` `[data-section]` `variable` `2variable` `constant` `create` `,` `c,` `,'` `'` `,"` `"` `allot` -`lit` `\` `(` `recursive` `[label]` `*` `/` `u*` +`lit` `\` `(` `recursive` `[label]` `*` `/` `m*` Usage ----- diff --git a/foco65 b/foco65 index 6d86b4b..37027e7 100755 --- a/foco65 +++ b/foco65 @@ -1879,8 +1879,8 @@ m_star_n2_plus lda #0 sta tmp+0 sta tmp+1 - sta tmp+2 - sta tmp+3 + sta tmp2+0 + sta tmp2+1 ; tmp := w * z ldy #16 m_star_loop @@ -1889,15 +1889,15 @@ m_star_loop bcc m_star_next lda z clc - adc tmp+2 - sta tmp+2 + adc tmp2+0 + sta tmp2+0 lda z+1 - adc tmp+3 - sta tmp+3 + adc tmp2+1 + sta tmp2+1 m_star_next clc - ror tmp+3 - ror tmp+2 + ror tmp2+1 + ror tmp2+0 ror tmp+1 ror tmp+0 dey @@ -1914,23 +1914,23 @@ m_star_next eor #$FF adc #0 sta tmp+1 - lda tmp+2 + lda tmp2+0 eor #$FF adc #0 - sta tmp+2 - lda tmp+3 + sta tmp2+0 + lda tmp2+1 eor #$FF adc #0 - sta tmp+3 + sta tmp2+1 m_star_done ; push result on the stack lda tmp+0 sta pstack+2,x lda tmp+1 sta pstack+3,x - lda tmp+2 + lda tmp2+0 sta pstack+0,x - lda tmp+3 + lda tmp2+1 sta pstack+1,x jmp next [end-code] ;