home *** CD-ROM | disk | FTP | other *** search
/ Set of Apple II Hard Drive Images / eric.hdv / SOURCE / OOSPEC.txt < prev    next >
Text File  |  2020-08-13  |  3KB  |  58 lines

  1.  
  2. Object Oriented Machine Language Environment (oospec)           11/27/92
  3.  
  4.  
  5. - A bootstrap process will set up the OO environment by allocating memory from the operating system and relocating the OO driver code.  Programs can then be loaded from disk and set up as entries in the Object Table.  
  6.  
  7. - As objects are loaded into memory, their names and addresses will be maintained in an object table.  Each entry in the Object Table will have a 6 byte object name and a 2 byte address pointer to its code.  Up to 256 entries can be stored in the Object table.  If first byte of entry = 00, then entry is free for use.  Entry= 6 character name in hi-bit ascii + 2 byte adrs (lo/hi)
  8.  
  9. - Object code can only be invoked by sending messages.  The message format and interpretation is completely determined by the receiving object.  However, a protocol may be established to use the first byte of the message as a phase number to determine which part of the code gets executed.
  10.  
  11. - To send a message to an object:
  12.          JSR MESSAGE         ;send a message 
  13.          ASC 'xxxxxx'        ;to object: XXXXXX
  14.          DFB $?? ?? ?? ??    ;describe the format of the message here
  15. ;        ...                 ;code to execute after message is sent.
  16.  
  17. - The Message subroutine will copy the message into the receiving object's message data area, adjust the stack pointer to return to the code following
  18. the message and JSR to the receiving object's code.  When the receiving object
  19. completes, it can do an RTS to return to the caller.  It may pass a response back to the caller via the registers or status flags (the message handler will not alter them).
  20.  
  21. - The message handler address (symbolic: MESSAGE) will be set up as a jump vector in zero page.  A basic interface will be provided via the & vector, so that a string may be passed containing the Object name and message data.  The & vector will invoke code to read the string and invoke the object.
  22.  
  23. - The following is a sample object header and mainline code:
  24.  
  25. ;=======================================
  26. ;OBJECT NAME: SAMPLE
  27. ;DESCRIPTION: SAMPLE OBJECT
  28. ;=======================================
  29. OBSAMPLE JSR MESSAGE         ;send a message to the OSETUP object, with
  30.          ASC 'OSETUP'        ;the new object's name as the message parameter.
  31.          ASC 'SAMPLE'       
  32.          RTS
  33. ;                            ;
  34.          JMP CDSAMPLE        ;jump vector to mainline code of the object
  35. MLSAMPLE DFB $??             ;Message Length: (0-255)
  36. MDSAMPLE DFB $?? ?? ??       ;Message Data Area: depends on MSGLEN
  37. ;
  38. ;optional internal data maintained by object goes here:
  39. ;
  40. ;=======================================
  41. ;MAINLINE CODE FOR OBJECT: SAMPLE
  42. ;=======================================
  43. CDSAMPLE LDA MDSAMPLE        ;get phase number from 1st byte of message data
  44.          CMP #$00
  45.          BNE C1SAMPLE        
  46.          JMP P0SAMPLE        ;phase 0 jump
  47. C1SAMPLE CMP #$01
  48.          BNE C2SAMPLE
  49.          JMP P1SAMPLE        ;phase 1 jump
  50. C2SAMPLE BRK                 ;any other phase, terminates with abend
  51. ;=======================================
  52. P0SAMPLE
  53.          RTS
  54. ;=======================================
  55. P1SAMPLE
  56.          RTS
  57. ;=======================================
  58.