![]() ![]() AND USE RESULT FOR YOUR OWN LOOP FJMP READING XA and XB will have the same loop conditions: NOTE XB - RECEIVER MAKE NOTE NOW `T` CONTAINS THE MESSAGE SIZE COPY M T MARK WRITING COPY M F NOTE COUNT DOWN REMAINING CHUNKS SUBI T 1 T TJMP WRITING Sending „Keep Alive Messages“įor bullet-proof communication your best choice is to have XA send a „keep alive message“… NOTE XA - SENDER GRAB 199 MARK READING COPY F M TEST EOF NOTE SEND RESULT OF TEST TO M. XA will send the message size to XB and use it for its own loop: NOTE XA - SENDER GRAB 199 NOTE `T` CONTAINS THE NUMBER OF CHUNKS TO READ COPY T M MARK READING COPY F M NOTE COUNT DOWN REMAINING CHUNKS SUBI T 1 T TJMP READING This way the XB does not have to test for the message to end, but will know when all message chunks have been delivered. If XA knows the file size it is reading to the network in advance, it is a very clever trick to send the file size to the receiver XB as well. NOTE XB - RECEIVER MAKE MARK WRITING COPY M T COPY T F NOTE TEST EOM FROM `T` TJMP WRITING NOTE DELETE EOM FROM FILE SEEK -1 VOID F Sending „Packet Size“ Remember: If T is 0, it is evaluated to false – all other values will evaluate to true. The receiver XB now copies the message to T, from where it is written into the file and is also executable from TJMP or FJMP. This only works if you know for sure that the file you are reading from never contains the symbol 0, as XA will use this as its „End Of Message“ message ( EOM): NOTE XA - SENDER GRAB 199 MARK READING COPY F M TEST EOF FJMP READING NOTE EOF, SEND EOM COPY 0 M If you do not want to think about timing, the receiving XB can test for a marker which tells it that the end of the message has been reached. …with XB having to wait one operation less than before: NOTE XB - RECEIVER MAKE MARK WRITING COPY M F NOOP TEST MRD TJMP WRITINGīy a rule of thumb the number of instructions in your receiver loop after your last read from M and before doing TEST MRD has to be as many instructions as it takes the sender to reach its next write to M after its last write to M. If the job of XA is to just read its file and die afterwards, your programme could be written even more compact: NOTE XA - SENDER GRAB 199 MARK READING COPY F M JUMP READING NOTE CRASH AND BURN AT END OF FILE NOTE XB - RECEIVER MAKE MARK WRITING COPY M F NOOP NOOP TEST MRD TJMP WRITING One solution for timing issues is to add additional NOOP commands in your writing loop, telling your receiver to wait until the sender is back online. Before writing to M it needs to be empty, before reading from M the corresponding write operation has to be finished. Transfers via the M register are not instantaneous. This seems to be rather well designed, but most often ends up in XB never finishing its job because there is nothing waiting in M when TEST MRD is executed. …where XB reads from M and writes these messages to another file: NOTE XB - RECEIVER MAKE MARK WRITING COPY M F TEST MRD TJMP WRITINGĪs you can see, XA tests for the end of file ( EOF), while XB tests for receivable messages ( MRD). ![]() Exa XA reads from a file and sends them to the network register M… NOTE XA - SENDER GRAB 199 MARK READING COPY F M TEST EOF FJMP READING Timing problems can ruin the proper execution of your Axiom code.Ĭonsider these two Exas trading messages via the M register. How are people achieving this? All of the internet solutions use two EXAs to achieve many fewer cycles, which is easy enough - but the stats show 1 exa is used in 90% plus solutions.Sending and receiving messages in Exapunks is a tricky business. It seems average executed lines are about 25 or so. ![]() Size is 16 lines, about average - and 1 EXA, which is also average. NOTE Grab our order again and continue if not doneīut with the register juggling in the loop, executed lines are up to 59, way above average. NOTE Switch to the order doc and add our word to the end NOTE Get your order and move into the room Did Euclid's pizza - approached it with a loop ![]()
0 Comments
Leave a Reply. |