embedded systems developers tools, cross compilers
  Home  |   SwiftX Archive  |   SwiftForth Archive  |

Re: CONSTANT doesn't CREATE , DOES> @ anymore.

From: Leon Wagner <leon_at_forth.com>
Date: Fri, 3 Dec 2004 10:40:22 -0800

The greatest benefit is from the code optimizer:

INTERPRETER
: DUMB-CONSTANT ( n -- ) CREATE , DOES> @ ;
TARGET

1 CONSTANT ONE
1 DUMB-CONSTANT UNO

: POO ONE + ;
: FOO UNO + ;

SEE POO
2C05 1 # EBX ADD 83C301
2C08 RET C3

SEE FOO
2C09 UNO CALL E8EEFFFFFF
2C0E 0 [EBP] EBX ADD 035D00
2C11 4 # EBP ADD 83C504
2C14 RET C3

> -----Original Message-----
> From: swiftx-bounce_at_forth.com [mailto:swiftx-bounce_at_forth.com]On Behalf
> Of Bulgrien, Dennis
> Sent: Friday, December 03, 2004 10:24
> To: 'swiftx_at_forth.com'
> Subject: [swiftx] CONSTANT doesn't CREATE , DOES> @ anymore.
>
>
> I was surprised when I investigated CONSTANT . SwiftX Reference manual
> section 4.4 "...a CONSTANT's behavior is to return its value". Experience
> shows that it has been improved such that it doesn't run code that fetches
> (returns) a ROM value and pushes it onto the stack at run-time but now at
> compile-time. The value is inlined the same as an EQU literal. CONSTANT
> run-time speed has increased! though size increases too.
>
> SwiftX ColdFire 3...
> INTERPRETER ok
> : KONSTANT CREATE , DOES> @ ; ok
> TARGET ok
> 7 KONSTANT sevk ok
> : tsevk sevk . ; ok
> 7 CONSTANT sevc ok
> : tsevc sevc . ; ok
> 7 EQU seve ok
> : tseve seve . ; ok
> SEE tsevk
> 20005D5A sevk BSR 61F2
> 20005D5C . BRA 6000B3BE ok
> SEE tsevc
> 20005D60 7 #Q D0 MOV 7007
> 20005D62 D0 A6 -) MOV 2D00
> 20005D64 . BRA 6000B3B6 ok
> SEE tseve
> 20005D68 7 #Q D0 MOV 7007
> 20005D6A D0 A6 -) MOV 2D00
> 20005D6C . BRA 6000B3AE ok
> ----------------------------------------------------------------------
> swiftx_at_forth.com The SwiftX programming discussion email list
> To unsubscribe, send subject "unsubscribe" to swiftx-request_at_forth.com
> For list command help, send subject "help" to swiftx-request_at_forth.com
> Message archives are located at http://www.forth.com/archive/swiftx
> ----------------------------------------------------------------------
> This list is a forum for SwiftX users. For product support and bug
> reports, please send email to support_at_forth.com
> ----------------------------------------------------------------------
>
>

----------------------------------------------------------------------
swiftx_at_forth.com The SwiftX programming discussion email list
To unsubscribe, send subject "unsubscribe" to swiftx-request_at_forth.com
For list command help, send subject "help" to swiftx-request_at_forth.com
Message archives are located at http://www.forth.com/archive/swiftx
----------------------------------------------------------------------
This list is a forum for SwiftX users. For product support and bug
reports, please send email to support_at_forth.com
----------------------------------------------------------------------
Received on Fri Dec 03 2004 - 10:40:44 PST

This archive was generated by hypermail 2.2.0 : Tue Dec 02 2008 - 03:04:50 PST