OM1ZZ, Igor, also asked how to define 2constant and 2variable in FlashForth
2variable create 2 cells allot ; ok<$,ram>
ram 2variable 2qq ok<$,ram>
2qq ok<$,ram>f0a8
here ok<$,ram>f0a8 f0ac \ You can see that 2 cells have been alloted
eeprom 2variable 2eepromVar ok<$,eeprom> 2eepromVar ok<$,eeprom>ec0c here ok<$,eeprom>ec0c ec10 \ Also here you can see that 2 cells have been alloted
2constant flash create , , ram does> dup @ swap cell+ @ swap ; ok<$,ram>
2345 6789 2constant 2kk ok<$,ram> 2kk ok<$,ram>2345 6789
see 2constant 3d44 ec1d f00a call flash 3d48 ec12 f011 call create 3d4c ec49 f00a call , 3d50 ec49 f00a call , 3d54 ec2a f00a call ram 3d58 ec6b f011 call (does>) 3d5c ec94 f009 call (d) 3d60 ecb7 f00b call dup 3d64 ecf7 f009 call @ 3d68 ec70 f00b call swap 3d6c ec75 f00a call cell+ 3d70 ecf7 f009 call @ 3d74 ef70 f00b goto swap ok<$,ram>
Mikael
Mikael, thanks a lot! I do assume the higher word is on tos. 73 Igor
Log in to post a comment.
OM1ZZ, Igor,
also asked how to define 2constant and 2variable in FlashForth
2variable create 2 cells allot ; ok<$,ram>
ram 2variable 2qq ok<$,ram>
2qq ok<$,ram>f0a8
here ok<$,ram>f0a8 f0ac \ You can see that 2 cells have been alloted
eeprom 2variable 2eepromVar ok<$,eeprom>
2eepromVar ok<$,eeprom>ec0c
here ok<$,eeprom>ec0c ec10 \ Also here you can see that 2 cells have been alloted
2constant flash create , , ram does> dup @ swap cell+ @ swap ; ok<$,ram>
2345 6789 2constant 2kk ok<$,ram>
2kk ok<$,ram>2345 6789
see 2constant
3d44 ec1d f00a call flash
3d48 ec12 f011 call create
3d4c ec49 f00a call ,
3d50 ec49 f00a call ,
3d54 ec2a f00a call ram
3d58 ec6b f011 call (does>)
3d5c ec94 f009 call (d)
3d60 ecb7 f00b call dup
3d64 ecf7 f009 call @
3d68 ec70 f00b call swap
3d6c ec75 f00a call cell+
3d70 ecf7 f009 call @
3d74 ef70 f00b goto swap
ok<$,ram>
Mikael
Mikael, thanks a lot!
I do assume the higher word is on tos.
73 Igor