f_set_data_length

This procedure is identical to f_set_data_pointer with the only difference being the address where the parameter is written. Simply copy the preceding code and change data_pointer to data_length.

Another alternative is to implement a single procedure, thus getting rid of redundant code, which would accept two parameters:

  • The actual parameter (either a pointer to data or its size) as the assembler does not care about types
  • A selector, which will tell the procedure where the parameter value should be stored

Try to implement this yourself; it would be a good quick exercise.

..................Content has been hidden....................

You can't read the all page of ebook, please click here login for view all page.
Reset