6502.org Forum  Projects  Code  Documents  Tools  Forum
It is currently Sat Nov 09, 2024 3:47 pm

All times are UTC




Post new topic Reply to topic  [ 266 posts ]  Go to page Previous  1 ... 5, 6, 7, 8, 9, 10, 11 ... 18  Next
Author Message
PostPosted: Sun Mar 11, 2018 9:35 pm 
Offline

Joined: Mon Jan 07, 2013 2:42 pm
Posts: 576
Location: Just outside Berlin, Germany
Tali Forth 2 now allows stripping out the underflow checks for native compiled new words and handles the special cases of native compile such as R> and >R. To see how it works, we''ll take >R, because it totally sucks to have to compile this word in subroutine threaded code (STC): When we jump to >R, what is on the top of the stack (TOS) is the return address. So we have to move it out of the way before we can get any real work done. Also, we have an underflow check to see if we have anything on the Data Stack to push on the Return Stack.
Code:
;               pla             ; LSB
                sta tmptos
                ply             ; MSB

                ; --- CUT HERE FOR NATIVE CODING ---

                cpx #dsp0-1
                bmi +
                lda #11
                jmp error
*
                lda 1,x         ; MSB
                pha
                lda 0,x         ; LSB
                pha

                inx
                inx

                ; --- CUT HERE FOR NATIVE CODING ---

                phy             ; MSB
                lda tmptos
                pha             ; LSB

z_to_r:         rts
That's 25 bytes just to push the TOS on the Return Stack!

So what Tali now does automatically if native compile is enabled (and NC-LIMIT is set to some number larger than 25 bytes) is strip the first and last four bytes off. Now, in the second step, if UF-STRIP is set to TRUE, the nine bytes of the underflow check vanish as well. We can test this with a fake example word:
Code:
: ccc >r ;  ok
see ccc
 nt: 19F7  xt: 1A02
 size (decimal): 8
 
1A02  B5 01 48 B5 00 48 E8 E8   ok
You can see the most dramatic change with DROP. Because underflow checks are enabled by default, a simple test word includes them out of the box:
Code:
: aaa drop ;  ok
see aaa
 nt: 19D2  xt: 19DD
 size (decimal): 11
 
19DD  E0 77 30 05 A9 0B 4C 42  AD E8 E8  ok
The actual DROP is the last two bytes, the INX INX. Now this is what happens after UF-STRIP is set to TRUE:
Code:
: bbb drop ;  ok
see bbb
 nt: 19E9  xt: 19F4
 size (decimal): 2
 
19F4  E8 E8  ok
DROP is how it should be, two bytes.

With that code, everything that was supposed to go into ALPHA is in. I'll be going through the code one more time for a few tests, but BETA shouldn't be long.


Top
 Profile  
Reply with quote  
PostPosted: Mon Mar 12, 2018 6:04 am 
Offline
User avatar

Joined: Sun Jun 30, 2013 10:26 pm
Posts: 1948
Location: Sacramento, CA, USA
In native_words.asm:

Save 10 bytes with:
Code:
; ## DNEGATE ( d -- d ) "Negate double cell number"
; ## "dnegate"  src: ANSI double  b: 33  c: TBA  status: coded
xt_dnegate:     
                cpx #dsp0-3
                bmi +
                lda #11
                jmp error
*
                ldy #0
                sec

                tya
                sbc 2,x         ; LSB of low cell
                sta 2,x

                tya
                sbc 3,x         ; MSB of low cell
                sta 3,x

                tya
                sbc 0,x         ; LSB of high cell
                sta 0,x

                tya
                sbc 1,x         ; MSB of high cell
                sta 1,x

z_dnegate:      rts


Spend 7 bytes of the 10 we just saved above (but roughly triple the speed of the inner loop) with:
Code:
; ## FILL ( addr u char -- ) "Fill a memory region with a character"
; ## "fill"  src: ANSI core  b: TBA  c: TBA  status: coded
        ; """Fill u bytes of memory with char starting at addr. Note that
        ; this works on bytes, not on cells. On an 8-bit machine such as the
        ; 65c02, this is a serious pain in the rear. It is not defined what
        ; happens when we reach the end of the address space
        ; """
xt_fill:       
                cpx #dsp0-5
                bmi +
                lda #11         ; underflow
                jmp error
*

                ; We use tmp1 to hold the address
                lda 4,x         ; LSB
                sta tmp1
                lda 5,x         ; MSB
                sta tmp1+1

                phx             ; we also use X in our inner loop to
                                ;   improve performance, so save it

                ; Unfortunately, we also need to make sure that we don't
                ;   fill beyond the end of the RAM.  So we check:
                ;     if ram_end < base_addr then don't fill anything
                ;     if ram_end - base_addr < fill_count then
                ;       set fill_count to ram_end - base_addr
                sec
                lda #<ram_end   ; LSB
                sbc tmp1
                tay
                lda #>ram_end   ; MSB
                sbc tmp1+1
                bcc _done
                pha
                cpy 2,x
                sbc 3,x
                pla
                bcs +           ; fill_count is legal, so proceed
                sty 2,x         ; fill_count is not legal, so adjust it
                sta 3,x         ;   to the largest legal value
*
                ldy 0,x         ; the fill byte value we'll be using
                lda 3,x
                eor #$ff        ; complement the fill_count to improve
                sta tmp2        ;   performance of the inner loop
                lda 2,x
                eor #$ff
                tax
                tya
                ldy #0
                bra +

_loop:
                ; We're not in ROM and we still have stuff on the counter,
                ;   so let's actually do what we came here to do

                sta (tmp1),y
                iny
                bne +
                inc tmp1+1
*
                ; Update our fill_count and loop while not zero
                inx
                bne _loop
                inc tmp2
                bne _loop
_done:
                ; Drop three cells off the Data Stack. This uses one byte
                ;   less than six times INX
                pla
                clc
                adc #6
                tax
z_blank:
z_erase:
z_fill:         rts
.scend

Untested, as usual :-)

Mike B.


Top
 Profile  
Reply with quote  
PostPosted: Mon Mar 12, 2018 12:02 pm 
Offline

Joined: Mon Jan 07, 2013 2:42 pm
Posts: 576
Location: Just outside Berlin, Germany
@mike - DNEGATE works perfectly, included, thanks!

There is one problem with FILL, though: There is no instruction "CPY 2,X" - CPY only has Absolute, Immediate and Direct Page (much to my constant annoyance). We'll have to figure out a different way for that part.

Thanks again!


Top
 Profile  
Reply with quote  
PostPosted: Mon Mar 12, 2018 10:09 pm 
Offline
User avatar

Joined: Sun Jun 30, 2013 10:26 pm
Posts: 1948
Location: Sacramento, CA, USA
Doh! I shouldn't still be making those types of errors. Your original FILL did a partial fill if the byte count caused it to bump into the end of RAM. Would it be okay for its replacement to just DROP DROP DROP without filling anything if it knew that was going to happen?

Mike B.


Top
 Profile  
Reply with quote  
PostPosted: Wed Mar 14, 2018 3:36 am 
Offline
User avatar

Joined: Sun Jun 30, 2013 10:26 pm
Posts: 1948
Location: Sacramento, CA, USA
Scot, I think that clc at line 1205 of https://github.com/scotws/TaliForth2/bl ... _words.asm might need to be a lda 0,x instead. And you might need to insert an sec between lines 1446 and 1447. And that sta tmp2 at line 1485 doesn't look right to me either. With that in mind ...

In native_words.asm:

Save 25 bytes with:
Code:
; ## ALLOT ( n -- ) "Reserve or release memory"
; ## "allot"  src: ANSI core  b: 90  c: TBA  status: tested
        ; """Reserve a certain number of bytes (not cells) or release them.
        ; If n = 0, do nothing. If n is negative, release n bytes, but only
        ; to the beginning of the Dictionary. If n is positive (the most
        ; common case), reserve n bytes, but not past the end of the
        ; Dictionary. See http://forth-standard.org/standard/core/ALLOT
        ; """
        ; TODO see what to do with the Dictionary Pointer (dp) memory is
        ; released to the beginning of the Dictionary
.scope
xt_allot:       
                cpx #dsp0-1
                bmi +
                lda #11                 ; underflow
                jmp error
*
                ; cp adjust code is the same for negative, zero or positive
                clc
                lda cp
                adc 0,x
                sta cp

                lda cp+1
                adc 1,x
                sta cp+1

                ; did we just reserve bytes or free them?
                lda 1,x
                bmi _negative

                ; did we just grant more space than we have available?
                ldy #<cp_end           
                cpy cp
                lda #>cp_end
                sbc cp+1
                bcs _done               ; we're good

                ; we're not good, so we fail hard. This is going to be rare,
                ; and so it's not worth keeping the old values around to
                ; restore them. Instead, we reserve max memory
                sty cp
                lda #>cp_end
                sta cp+1

                lda #1                  ; error code for ALLOT
                jmp error
_negative:
                ; Free at most to the beginning of the Dictionary space. Note
                ; this completely destroys the user's Dictionary. Currently,
                ; this leaves the Dictionary Pointer dangling, so this is probably
                ; not the best solution
                ; TODO find the best solution
                ldy #<cp0
                cpy cp
                lda #>cp0
                sbc cp+1
                bcc _done               ; CP still > than CP0, we're good

                ; we're totally not good, set CP to CP0
                sty cp
                lda #>cp0
                sta cp+1                ; drop through to _done
_done:
                inx
                inx
z_allot:
                rts
.scend


Save 12 bytes with:
Code:
; ## COMPILE_COMMA ( xt -- ) "Compile xt"
; ## "compile,"  src: ANSI core ext  b: TBA  c: TBA  status: fragment
        ; """Compile the given xt in the current word definition. It is an
        ; error if we are not in the compile state. Because we are using
        ; subroutine threading, we can't use , (COMMA) to compile new words
        ; the traditional way. By default, native compiled is allowed, unless
        ; there is a NN (Never Native) flag associated. If not, we use the
        ; value NC_LIMIT (from definitions.tasm) to decide if the code
        ; is too large to be natively coded: If the size is larger than
        ; NC_LIMIT, we silently use subroutine coding. If the AN (Always
        ; Native) flag is set, the word is always natively compiled
        ; """
.scope
xt_compile_comma:
                cpx #dsp0-1
                bmi +
                lda #11                 ; underflow
                jmp error
*
                ; See if this is an Always Native (AN) word by checking the
                ; AN flag. We need nt for this. First, save a copy of xt to
                ; the Return Stack
                lda 1,x                 ; MSB
                pha
                lda 0,x
                pha                     ; LSB

                jsr xt_int_to_name      ; ( xt -- nt )

                ; put nt away for safe keeping
                lda 0,x
                sta tmptos
                lda 1,x
                sta tmptos+1

                ; status byte is one further down
                inc 0,x
                bne +
                inc 1,x                 ; ( nt -- nt+1 )
*
                lda (0,x)
                sta tmp3                ; keep copy of status byte for NN
                and #AN                 ; mask all but Always Native (AN bit
                beq _compile_check

                ; We're natively compiling no matter what. Get length and
                ; compile in code. Get the original nt back
                lda tmptos
                sta 0,x
                lda tmptos+1
                sta 1,x

                jsr xt_wordsize         ; ( nt -- u )

                bra _compile_as_code

_compile_check:
                ; See if Native Compile is even alowed by checking the NN
                ; flag
                lda tmp3
                and #NN
                beq _check_size_limit

                jmp _compile_as_jump    ; too far for BRA

_check_size_limit:
                ; Native compile is a legal option, but we need to see what
                ; limit the user set for size
                lda tmptos
                sta 0,x
                lda tmptos+1
                sta 1,x

                jsr xt_wordsize         ; ( nt -- u )

                ; We implicitly assume that we don't want to compile anything
                ; greater than 255 bytes, so we only deal with LSB
                lda 0,x                 ; !!!this was a "clc", which had to be a bug!!!
                cmp nc_limit            ; user-defined limit
                bcc _compile_as_code

                jmp _compile_as_jump    ; too far for BRA

_compile_as_code:
                ; We arrive here with the length of the word's code TOS and
                ; xt on top of the Return Stack. MOVE will need ( xt cp u )
                ; on the data stack
                dex
                dex                     ; ( -- u ?? )
                dex
                dex                     ; ( -- u ?? ?? )

                lda 4,x
                sta 0,x                 ; LSB of u
                lda 5,x
                sta 1,x                 ; ( -- u ?? u )

                pla
                sta 4,x                 ; LSB of xt
                pla
                sta 5,x                 ; ( -- xt ?? u )

                lda cp                  ; LSB of cp
                sta 2,x
                lda cp+1
                sta 3,x                 ; ( -- xt cp u )

                ; --- SPECIAL CASE 1: PREVENT RETURN STACK THRASHINIG ---
               
                ; Native compiling allows us to strip the stack antics off
                ; a number of words that use the Return Stack such as >R, R>,
                ; 2>R and 2R> (but not 2R@ in this version). We compare the
                ; xt with the contents of the table
                ldy #0
_strip_loop:
                lda _strip_table,y      ; LSB of first word
                cmp 4,x                 ; LSB of xt
                bne _next_entry

                ; LSB is the same, test MSB
                lda _strip_table+1,y
                cmp 5,x
                beq _found_entry

                ; MSB is not equal.
_next_entry:
                ; Not a word that needs stripping, so check next entry in table
                ; Let's see if we're done with the table (marked by zero entry)
                lda _strip_table,y      ; pointing to LSB
                ora _strip_table+1,y    ; get MSB
                beq _underflow_strip    ; table done, let's get out of here

                iny             
                iny
                bra _strip_loop
_found_entry:
                ; This word is one of the ones that needs to have its size
                ; adjusted during native compile. We find the values in the
                ; next table with the same index, which is Y.
                tya
                lsr
                tay

                ; Get the adjustment out of the size table. We were clever
                ;   enough to make sure the cut on both ends of the code is
                ;   the same size
                lda _strip_size,y
                sta tmptos              ; save a copy

                ; Adjust xt: Start later
                clc
                adc 4,x
                sta 4,x
                bcc +
                inc 5,x
*
                ; Adjust u: Quit earlier. Since we cut off the top and the
                ;   bottom of the code, we have to double the value
                asl tmptos

                sec
                lda 0,x
                sbc tmptos
                sta 0,x
                bcs +
                dec 1,x
*
                ; drop through to underflow check stripping

_underflow_strip:
                ; --- SPECIAL CASE 2: REMOVE UNDERFLOW CHECKING ---
               
                ; The user can choose to remove the underflow testing in those
                ; words that have the UF flag. This shortens the word by
                ; 9 bytes and increases speed by 5 cycles (because the branch
                ; is taken) if there is no underflow.
               
                ; See if the user wants underflow stripping turned on
                lda uf_strip
                ora uf_strip+1
                beq _specials_done

                ; See if this word even contains underflow checking
                lda tmp3
                and #UF
                beq _specials_done

                ; If we arrived here, underflow has to go. It's always 9 bytes
                ; long (except for PICK, which has a special case that can't
                ; be stripped)
 
                ; Adjust xt: Start later
                clc
                lda 4,x
                adc #9
                sta 4,x
                bcc +
                inc 5,x
*
                ; Adjust u: End earlier
                sec
                lda 0,x
                sbc #9
                sta 0,x
                bcs +
                dec 1,x
*
                ; --- END OF SPECIAL CASES ---
_specials_done:
                ; Store size of area to be copied for calculation of
                ; new CP. We have to do this after all of the special cases
                ; because they might change the size
                lda 1,x                 ; MSB
                pha
                lda 0,x                 ; LSB
                pha
               
                ; Enough of this, let's move those bytes already! We have
                ; ( xt cp u ) on the stack at this point
                jsr xt_move

                ; Update CP
                clc
                pla                     ; LSB
                adc cp
                sta cp

                pla                     ; MSB
                adc cp+1
                sta cp+1

                bra _done

_strip_table:
               ; List of words we strip the Return Stack antics from
               ; during native compile, zero terminated. The index here
               ; must be the same as for the sizes
                .word xt_r_from, xt_r_fetch, xt_to_r    ; R>, R@, >R
                .word xt_two_to_r, xt_two_r_from, 0000  ; 2>R, 2R>, EOL

_strip_size:   
                ; List of bytes to be stripped from the words that get their
                ; Return Stack antics removed during native compile. Index must
                ; be the same as for the xts. Zero terminated.
                .byte 4, 4, 4, 6, 6, 0          ; R>, R@, >R, 2>R, 2R>, EOL
               
_compile_as_jump:
                ; Compile xt as a subroutine jump
                lda #$20
                sta (cp)
               
                ldy #1
                pla             ; LSB
                sta (cp),y
                iny
                pla             ; MSB
                sta (cp),y

                ; allot space we just used
                tya
                sec
                adc cp
                sta cp
                bcc +
                inc cp+1
*
                inx             ; drop xt
                inx
_done:               
z_compile_comma:
                rts
.scend


Save 15 bytes with:
Code:
; ## CONSTANT ( n "name" -- ) "Define a constant"
; ## "constant"  src: ANSI core  b: 82  c: TBA  status: tested
        ; """Forth equivalent is  CREATE , DOES> @  but we do
        ; more in assembler and let CREATE do the heavy lifting.
        ; See http://www.bradrodriguez.com/papers/moving3.htm for
        ; a primer on how this works in various Forths.
        ; """
xt_constant:   
                cpx #dsp0-1
                bmi +
                lda #11
                jmp error
*
                jsr xt_create

                ; CREATE by default installs a subroutine jump to DOVAR,
                ; but we want DOCONST for constants. Go back two bytes and
                ; replace the subroutine jump target
                sec             ; !!!this was missing, and had to be a bug!!!
                lda cp
                sbc #2
                sta tmp1
                lda cp+1
                sbc #0
                sta tmp1+1

                lda #<doconst   ; LSB of DOCONST
                sta (tmp1)
                ldy #1
                lda #>doconst   ; MSB of DOCONST
                sta (tmp1),y

                ; Now we save the constant number itself in the next cell
                jsr xt_comma            ; drop through to adjust_z

adjust_z:
                ; Now the length of the complete word (z_word) has increased by
                ; two. We need to update that number or else words such as SEE
                ; will ignore the PFA. We use this same routine for VARIABLE,
                ; VALUE and DEFER
                jsr xt_latestnt         ; gives us ( -- nt )

                ; z_word is six bytes further down
                lda 0,x
                sta tmp1
                lda 1,x
                sta tmp1+1

                ldy #6
                lda (tmp1),y
                clc
                adc #2
                sta (tmp1),y    ; !!!this was sta tmp2, and had to be a bug!!!
                iny
                lda (tmp1),y
                adc #0          ; only need carry
                sta (tmp1),y
             
                inx
                inx

z_constant:     rts


Mike B.


Top
 Profile  
Reply with quote  
PostPosted: Thu Mar 15, 2018 6:20 pm 
Offline
User avatar

Joined: Sun Jun 30, 2013 10:26 pm
Posts: 1948
Location: Sacramento, CA, USA
Save 4 bytes with:
Code:
; ## PICK ( n n u -- n n n ) "Move element u of the stack to TOS"
; ## "pick"  src: ANSI core ext  b: TBA  c: TBA  status: coded
        ; """Take the u-th element out of the stack and put it on TOS,
        ; overwriting the original TOS. 0 PICK is equivalent to DUP, 1 PICK to
        ; OVER. Note that using PICK is considered poor coding form. Also note
        ; that FIG Forth has a different behavior for PICK than ANS Forth.
        ; """
.scope
xt_pick:
                ; Checking for underflow is difficult because it depends on
                ; which element we want to grab

                asl 0,x         ; we assume u < 128 (stack is small)
                txa
                adc 0,x
                tay
                lda 0002,y
                sta 0,x
                lda 0003,y
                sta 1,x
               
z_pick:         rts
.scend


Mike B.


Top
 Profile  
Reply with quote  
PostPosted: Fri Mar 16, 2018 12:10 pm 
Offline

Joined: Mon Jan 07, 2013 2:42 pm
Posts: 576
Location: Just outside Berlin, Germany
Corrections/improvements to PICK, ALLOT and CONSTANT all included and tested, thank you again (the CONSTANT bugs were rather scary, good thing this is ALPHA). COMPILE, is going to take a bit longer, the Real World (TM) is increasingly inserting itself into my coding time, so I might not get around to it until late next week. :( Please don't let that keep you from further corrections, I'll catch up at some point. And again, thank you!


Top
 Profile  
Reply with quote  
PostPosted: Sat Mar 17, 2018 4:27 am 
Offline
User avatar

Joined: Sun Jun 30, 2013 10:26 pm
Posts: 1948
Location: Sacramento, CA, USA
scotws wrote:
... The first change (cmpl_subroutine) seems to work fine until I try the word SEE, at which point it prints garbage. SEE is a high-level word, so I'm going to skip that for a moment because it might have to do with the other two ...

I think I see what happened; I hadn't realized that cmpl_word must be able to stand by itself, because it is "jsr"d explicitly from a couple of other places. Here's a more careful version, just slightly shorter and faster than the original:
Code:
cmpl_subroutine:
                lda #$20        ; compile "JSR" opcode first
                bra cmpl_common
cmpl_jump:
                lda #$4c        ; compile "JMP", fall through to common
cmpl_common:
                ; A contains the opcode that must be compiled
                ; first. This is basically C, ("c-comma")
                sta (cp)
                inc cp
                bne cmpl_word
                inc cp+1
cmpl_word:
                ; The cmpl_word routine is the body of all these routines
                ; and compiles the value on the Return Stack
                pla             ; LSB of return address
                sta tmp1
                pla             ; MSB of return address
                sta tmp1+1

                pla             ; LSB of word to compile
                sta (cp)
                ldy #1
                pla             ; MSB of word to compile
                sta (cp),y

                tya
                sec
                adc cp
                sta cp
                bcc +
                inc cp+1
*
                lda tmp1+1
                pha             ; MSB of return address
                lda tmp1
                pha             ; LSB of return address

                rts


Mike B.


Top
 Profile  
Reply with quote  
PostPosted: Tue Mar 27, 2018 2:13 pm 
Offline

Joined: Thu Mar 03, 2011 5:56 pm
Posts: 284
Looks like there is a problem with native compilation and constant/variable access:

Code:
Tali Forth 2 for the 65c02                                                     
Version ALPHA 11. Mar 2018                                                     
Copyright 2014-2018 Scot W. Stevenson                                           
Tali Forth 2 comes with absolutely NO WARRANTY                                 
Type 'bye' to exit                                                             
variable foo  ok                                                               
65 foo !  ok                                                                   
: bar foo dup @ .s ;  ok                                                       
bar  ok                                                                         
.s <1> 16319  ok                                                               
drop  ok                                                                       
0 nc-limit !  ok                                                               
variable foo2  ok                                                               
63 foo2 !  ok                                                                   
: bar2 foo2 dup @ .s ;  ok                                                     
bar2 <2> 16448 63  ok                                                           
drop drop  ok                                                                   
: baz foo dup @ .s ;  ok                                                       
baz <2> 16047 65  ok                                                                                               


I noticed this while trying to run the mandelbrot program, which I could not get to provide any output at all.


Top
 Profile  
Reply with quote  
PostPosted: Tue Mar 27, 2018 4:19 pm 
Offline

Joined: Thu Mar 03, 2011 5:56 pm
Posts: 284
I set the default value for nc-limit to 0 (effectively disabling native compilation – or possibly more precisely, inlining).

That made the mandelbrot program run... in about 7 seconds (CHOCHI E, 40MHz, with a 115200 bps connection to minicom).

Martin_H ran this program in about 4m5s on his 6502 machine (https://www.youtube.com/watch?v=fVa3Fx7dwBM). This is about 40 times slower than what I got, so assuming a 1MHz 6502, Tali Forth 2 seems to have about the same performance.


Top
 Profile  
Reply with quote  
PostPosted: Wed Mar 28, 2018 8:02 am 
Offline

Joined: Fri Apr 15, 2016 1:03 am
Posts: 139
Bug reproduced on a 65816 emulator.
"foo" is not marked as "NN" (never native), so it may be inlined where it is referenced, incorrectly making a new instance of a variable & disrupting the flow of the referencing word.
VARIABLE uses CREATE to make the word header. Since many CREATEd words should not be native compiled, CREATE should be changed to initialize the status byte of the created header to NN (never native) - in native_words.asm at line 1579 change "tya" to "lda #NN".


Top
 Profile  
Reply with quote  
PostPosted: Wed Mar 28, 2018 6:57 pm 
Offline

Joined: Mon Jan 07, 2013 2:42 pm
Posts: 576
Location: Just outside Berlin, Germany
Thanks for the bug report! It will be about two weeks before I can get anything fun done, so I'll mark it as an issue for the moment.


Top
 Profile  
Reply with quote  
PostPosted: Sun Apr 08, 2018 11:28 am 
Offline

Joined: Mon Jan 07, 2013 2:42 pm
Posts: 576
Location: Just outside Berlin, Germany
leepivonka wrote:
CREATE should be changed to initialize the status byte of the created header to NN (never native) - in native_words.asm at line 1579 change "tya" to "lda #NN".
Did just that and seems to work with first testing. Thanks for the fix!


Top
 Profile  
Reply with quote  
PostPosted: Sun Apr 08, 2018 5:25 pm 
Offline

Joined: Mon Jan 07, 2013 2:42 pm
Posts: 576
Location: Just outside Berlin, Germany
@mike - Have (finally) included changes to cmpl_word, quick testing looks like it works. Thanks!


Top
 Profile  
Reply with quote  
PostPosted: Mon Apr 16, 2018 12:32 am 
Offline

Joined: Mon Jan 07, 2013 2:42 pm
Posts: 576
Location: Just outside Berlin, Germany
My only very slightly pathological tendency to overcomment (I can stop any time!) has finally paid off with an automatically generated list of native words with their sizes and statuses - see https://github.com/scotws/TaliForth2/bl ... ORDLIST.md .

Now when I say "automatic", what I mean is that there is a Python script that is run from the shell script for assembling the code, and looks at the formatted header comments in the assembler code for native words. So it all depends on keeping the comments up to date, and we all know how well that works in practice.

Still, anything is better than relying on my updating the doc/WORDLIST.md file as with the first version of Tali, because that really didn't work. The main take-away from all of this, anyway, is the number of words that are still not marked as "tested" (in any sense) -- currently 126 of 183 words :shock: .


Top
 Profile  
Reply with quote  
Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 266 posts ]  Go to page Previous  1 ... 5, 6, 7, 8, 9, 10, 11 ... 18  Next

All times are UTC


Who is online

Users browsing this forum: No registered users and 0 guests


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot post attachments in this forum

Search for:
Jump to:  
cron