7.6.1.0790 BLK b-l-k BLOCK

( -- a-addr )

a-addr is the address of a cell containing zero or the number of the mass-storage block being interpreted. If BLK contains zero, the input source is not a block and can be identified by SOURCE-ID, if SOURCE-ID is available. An ambiguous condition exists if a program directly alters the contents of BLK.

See:

ContributeContributions

FrancoisVignonavatar of FrancoisVignon [376] value okf BLK if the input source is not a blockRequest for clarification2025-04-14 12:13:33

Actually, BLK contains 0 if the input source is not a block ... ok, but when the input source is the block 0 .... ? Actually, I solve this problem by not using block 0 and starting block numeration to 1 ... but not very elegant.

What to you think about changing the BLK content to -1 when source is not a block ? in the meantime, it is what I will do and starting block numeration to 0 ;-)

Thanks for reading me.

AntonErtlavatar of AntonErtl

I also found this irritating. And at first I completely eliminated block 0 (by using an offset), but later found that having a block 0 that cannot be used for load is the traditional way, so I changed Gforth to follow that way. Blocks are a traditional thing. If using Block 0 for something else was good enough in the times of floppy disks, it should be good enough now. In any case, it seems to me that you have understood the issue, and have no need for clarification, so I am closing this topic. If there is any lack of clarity that we should address, please reopen the topic.

If you want to propose a change to the standard, click on "Proposals" above and follow the instructions. However, after Forth-83 and it's change to PICK the desire for breaking existing programs in the interest of elegance has become very small, so I doubt that such a proposal would succeed.

Closed
Reply New Version