$COMPACT ROM OPTIMIZE(3) WORD16 rom_example: DO; $include(/rmx386/inc/rmxplm.ext) DECLARE WORD_16 LITERALLY 'WORD', WORD_32 LITERALLY 'DWORD', FIFO_Q LITERALLY '0', CALLERS_JOB LITERALLY 'SELECTOR$OF(NIL)', WAIT_FOREVER LITERALLY '0FFFFH', PHYSICAL_FILE_DRIVER LITERALLY '1', OPEN_READ_AND_WRITE LITERALLY '3', SHARE_ALL LITERALLY '3', WORLD_ID LITERALLY '0FFFFH', CR LITERALLY '0DH', LF LITERALLY '0AH', FALSE LITERALLY '00H'; DECLARE exception WORD_16 PUBLIC; rom_example_start: PROCEDURE PUBLIC; DECLARE user_t TOKEN, ids STRUCTURE( length WORD_16, count WORD_16, id (1) BYTE), response_mailbox_t TOKEN, device_connection_t TOKEN, file_connection_t TOKEN, iors_t TOKEN, iors BASED iors_t STRUCTURE( status WORD_16, actual WORD_32), console_name_s (*) BYTE DATA(2, 't0'), hello_world_s (*) BYTE DATA('Hello world',CR,LF); $IF NOT System_120 /* * Create user object and response mailbox for subsequent BIOS calls. */ ids.length = 1; ids.count = 1; ids.id(0) = WORLD_ID; user_t = rq$create$user( @ids, @exception); response_mailbox_t = rq$create$mailbox( FIFO_Q, @exception); $ENDIF /* * Attach the console device. */ CALL rq$A$physical$attach$device( @console_name_s, PHYSICAL_FILE_DRIVER, response_mailbox_t, @exception); $IF NOT System_120 device_connection_t = rq$receive$message( response_mailbox_t, WAIT_FOREVER, NIL, @exception); /* * Get a file connection to the console. */ CALL rq$A$create$file( user_t, device_connection_t, NIL, 0, 0, 0, FALSE, response_mailbox_t, @exception); file_connection_t = rq$receive$message( response_mailbox_t, WAIT_FOREVER, NIL, @exception); /* * Open the file connection to the console. */ CALL rq$A$open( file_connection_t, OPEN_READ_AND_WRITE, SHARE_ALL, response_mailbox_t, @exception); iors_t = rq$receive$message( response_mailbox_t, WAIT_FOREVER, NIL, @exception); CALL rq$delete$segment( iors_t, @exception); $ENDIF /* * Write a string to the console. */ CALL rq$A$write( file_connection_t, @hello_world_s, SIZE(hello_world_s), response_mailbox_t, @exception); $IF NOT System_120 iors_t = rq$receive$message( response_mailbox_t, WAIT_FOREVER, NIL, @exception); CALL rq$delete$segment( iors_t, @exception); /* * Allow time for message to be printed on console. */ CALL rq$sleep( 200, @exception); $ENDIF /* * Allow other jobs to be initialized. */ CALL rq$end$init$task; /* * Clean up the example job. */ CALL rq$delete$job( CALLERS_JOB, @exception); END rom_example_start; END rom_example;