I am looking for a word that can print the contents of the stack, in this case a quad word. For example, q. ( q-dot prints a quad) If possible, with the same structure as d.
Thanks for nay help.
Jan
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
That requires full 64-bit to 64-bit division which is not available. FF has 64-bit to 32-bit division, which useful for scaling as long as the result fits into 32-bytes.
Which FF are you using ?
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
I have the scamp3, with the latest software, wich I hope this is include.
Did some updates to the PIC24 part.
Less writes to flash on chips that do not have eeprom (almost all chips). A smarter algorithm compares the highest written flash address with the xt to be executed.
DOES> fixed to work also with an empty DOES> part.
Unknown words do not cause INTERPRET to ABORT. This allows that unknown (marker words) words do not abort the loading from blocks or from Pere's file system. This was needed to let MARKER words to be used in those scenarios.
64 by 64-bit unsigned division. It links to the XC16 standard library code.
64 bit right and left shift. 64-bit was needed for controlling the SI570 chip.
2OVER
Mikael
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
Here it is. I will replace the current UQ/MOD quad division word with this one.
Signed formatting is still missing, needs QABS.
I implemented 64-bit div/mod with 64/32 bit result and the number formatting words.
-qmathmarker-qmathflashhex:uqq/mod( uq ud -- ud uq )[eb0300.herecf!2alloteb0380.herecf!2allot2ffc00.herecf!2allot781f80.herecf!2allot7800ae.herecf!2allot78002e.herecf!2allot7802ae.herecf!2allot78022e.herecf!2allot7801ae.herecf!2allot78012e.herecf!2allota90042.herecf!2allotd28102.herecf!2allotd28183.herecf!2allotd28204.herecf!2allotd28285.herecf!2allotd28306.herecf!2allotd28387.herecf!2allot310003.herecf!2allot530f80.herecf!2allot5b8f81.herecf!2allot390003.herecf!2allot530300.herecf!2allot5b8381.herecf!2allota00002.herecf!2allote81fcf.herecf!2allot39fff1.herecf!2allot782f06.herecf!2allot782f07.herecf!2allot782f02.herecf!2allot782f03.herecf!2allot782f04.herecf!2allot782f05.herecf!2allot78004f.herecf!2allot060000.herecf!2allotram:#q( uq1 -- uq2 )base@s>duqq/mod>r>r>r>rdropdigitholdr>r>r>r>;:#qs( uq1 -- uq2 )begin#q2over2overd-d0=until;:#q>( uq -- )2drop2drophp@hbover-;:uq( uq. -- )<##qs#q>typespace;:uq.r( uq u -- )>r<#begin#qr>1-dup>r0=until#q>rdroptypespace;
The assembler source looks like this.
;uq/mod(uqud-- ud uq ).pwordpaddr(9b)+PFLASH9:.byteNFA|6.ascii"uq/mod".align2clrW6;clearremainderclrW7;*mov#-64,W0pushW0mov[W14--],W1;Divisormov[W14--],W0;*mov[W14--],W5;Dividend:Quotientmov[W14--],W4;*mov[W14--],W3;*mov[W14--],W2;*bclrSR,#CUDIV6432_loop:rlcW2,W2;ShiftDividend:QuotientleftonebitrlcW3,W3;*rlcW4,W4;*rlcW5,W5;*rlcW6,W6;IntoremainderrlcW7,W7;*braC,UDIV6432_sub;ifRemainder>32bits,subtractDivisorsubW6,W0,[W15];TryRemainder-Divisor(R-B)subbW7,W1,[W15];if(R<B)Quotientbit=0braNC,UDIV6432_next;skipsubstractionUDIV6432_sub:subW6,W0,W6;if(R>=B)R=R-BsubbW7,W1,W7;subtractDivisorfromRemainderbsetW2,#0;quotientbit0=1UDIV6432_next:inc[--W15],[W15++]braNC,UDIV6432_loopmovW6,[++W14];RemaindermovW7,[++W14];*movW2,[++W14];QuotientmovW3,[++W14];movW4,[++W14];movW5,[++W14];popW0return
Last edit: Mikael Nordman 1 day ago
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
I am looking for a word that can print the contents of the stack, in this case a quad word. For example, q. ( q-dot prints a quad) If possible, with the same structure as d.
Thanks for nay help.
Jan
That requires full 64-bit to 64-bit division which is not available. FF has 64-bit to 32-bit division, which useful for scaling as long as the result fits into 32-bytes.
Which FF are you using ?
I have the scamp3, with the latest software, wich I hope this is include.
Did some updates to the PIC24 part.
Less writes to flash on chips that do not have eeprom (almost all chips). A smarter algorithm compares the highest written flash address with the xt to be executed.
DOES> fixed to work also with an empty DOES> part.
Unknown words do not cause INTERPRET to ABORT. This allows that unknown (marker words) words do not abort the loading from blocks or from Pere's file system. This was needed to let MARKER words to be used in those scenarios.
64 by 64-bit unsigned division. It links to the XC16 standard library code.
64 bit right and left shift. 64-bit was needed for controlling the SI570 chip.
2OVER
Mikael
Here it is. I will replace the current UQ/MOD quad division word with this one.
Signed formatting is still missing, needs QABS.
I implemented 64-bit div/mod with 64/32 bit result and the number formatting words.
The assembler source looks like this.
Last edit: Mikael Nordman 1 day ago
Thanks Mikael for the fast response.
Have test it and it is working as a charm.
Could these routines not for always implemented in FF5?
With kindley regards
Jan
Mikael,
Please can you help me with a definition for q* ( q q - q ).
I'm working on a conversion from string to a quad number. ( addr n -- q )
A word q10x ( q -- q*10) is also a posibility to do the conversion. ( I think the is a beter solution)
Thanks for any help.
With kindley regards
Jan
Hi Jan,
Here is a simple binary multiplication that can be used for number conversion.
It is for multipliers less than 31.
Here is a another version.
Last edit: Mikael Nordman 6 hours ago