Bell v0.2 manual

Binary data Exchange Link Library

Sending over data

Using send and receive

If you want to send over some data from one calculator to another (in one direction) or you haven't called bell_connect, you can use the send and receive routines to transfer bytes, blocks of data or strings. All you have to do is call bell_sendXXX on one calculator and the corresponding bell_recvXXX on the other at approximately the same time (within the timeout delay) and the routines will do the rest. A demonstration of how to send over "Hello world":

call bell_sync ; synchronize ret nz ; return if clear was pressed or a ; which calculator are we? jp nz,receive ; if we're the second connected calc, ; receive the string send: ; otherwise; send the string ld hl,string call bell_sendString ret receive: ld hl,saferam1 ; receive the string to some buffer call bell_recvString ret nz ; return if a transmission error occured bcall(_clrLCDFull) ld hl,saferam1 bcall(_puts) ; display the string bcall(_getkey) ; wait for a keypress ret ; and return string: .db "Hello world!",0

Using swap

Swapping data is much easier in situations where both calculators are more or less equal and they need to exchange the same kind of data (a game for example). You just call bell_swapXXX on both calculators at approximately the same time (within the timeout delay) and the routine will swap the data for you. A demonstration of how to use this will be given in the form of a simple game.

< previous | contents | next >