$TITLE('SDTSAM Sample Diagnostic Test Suite') /*****************************************************************************\ * * * TITLE: SDTSAM Sample Diagnostic Test * * * * DATE: March 3, 1983 * * * * ABSTRACT: This module contains four short tests to be run under * * the SDT monitor. * * * * LANGUAGES DEPENDENCIES: PL/M 86 (Version 2.1) * * * \*****************************************************************************/ SDT$SAMPLE$TEST: DO; $EJECT /*****************************************************************************\ * * * External Data Declarations * * * \*****************************************************************************/ DECLARE td$version (4)BYTE EXTERNAL, td$err$only WORD EXTERNAL, td$debug WORD EXTERNAL; $EJECT /*****************************************************************************\ * * * External Procedure Declarations * * * \*****************************************************************************/ td$display: PROCEDURE (string$ptr) EXTERNAL; DECLARE string$ptr POINTER; END td$display; td$display$char: PROCEDURE (char) EXTERNAL; DECLARE char WORD; END td$display$char; td$new$line: PROCEDURE EXTERNAL; END td$new$line; td$read$line: PROCEDURE (buffer$ptr) EXTERNAL; DECLARE buffer$ptr POINTER; END td$read$line; td$set$tdt$ptr: PROCEDURE (td$ptr) EXTERNAL; DECLARE td$ptr POINTER; END td$set$tdt$ptr; td$start: PROCEDURE EXTERNAL; END td$start; $EJECT /*****************************************************************************\ * * * Local Data Declarations * * * \*****************************************************************************/ DECLARE boolean LITERALLY 'BYTE', cr LITERALLY '0Dh', lf LITERALLY '0Ah', false LITERALLY '0H', true LITERALLY '0FFh'; DECLARE pass$name (*)BYTE DATA( 'PASS: Always passes',0), fail$name (*)BYTE DATA( 'FAIL: Always fails',0), input$string$name (*)BYTE DATA( 'INPUT STRING: Reads a string',0), version$number$name (*)BYTE DATA( 'VERSION NUMBER: Monitor Version',0); $EJECT /*****************************************************************************\ * * * Local Procedure Declarations * * * \*****************************************************************************/ pass: PROCEDURE boolean PUBLIC; RETURN true; END pass; fail: PROCEDURE boolean PUBLIC; RETURN false; END fail; input$string: PROCEDURE boolean PUBLIC; DECLARE buffer (123)BYTE; CALL td$display(@('Input example -- enter a string ',0)); CALL td$read$line(@buffer); IF buffer(0) = 'Y' THEN DO; IF td$debug THEN CALL td$display(@('Test passes if the string begins with ', 'a "y" or "Y"',cr,lf,0)); RETURN pass; END; ELSE DO; IF td$debug THEN CALL td$display(@('Test fails if the string does not begin with ', 'a "y" or "Y"',cr,lf,0)); RETURN fail; END; END input$string; version$number: PROCEDURE boolean PUBLIC; DECLARE i BYTE; CALL td$display(@('SDTMON Version Number ',0)); DO i = 0 TO 3; CALL td$display$char(td$version(i)); END; CALL td$new$line; RETURN true; END version$number; $EJECT /*****************************************************************************\ * * * Public Data Declarations * * * \*****************************************************************************/ DECLARE user$signon (*)BYTE PUBLIC DATA( 'SDTSAM Sample Diagnostic Test, V2.0',0), user$copyright (*)BYTE PUBLIC DATA( 'COPYRIGHT 1982, 1983 Intel Corporation'), user$number$of$tests WORD PUBLIC DATA(4), user$tdt (4)STRUCTURE( flag BYTE, overlay BYTE, addr POINTER, name$ptr POINTER, err$cnt WORD, exe$cnt WORD) PUBLIC INITIAL( 0, 0, @pass, @pass$name, 0, 0, 0, 0, @fail, @fail$name, 0, 0, 0, 0, @input$string, @input$string$name, 0, 0, 0, 0, @version$number, @version$number$name, 0, 0); $EJECT /*****************************************************************************\ * * * Public Procedure Declarations * * * \*****************************************************************************/ user$reset$software: PROCEDURE PUBLIC REENTRANT; CALL td$display(@('User software RESET invoked',cr,lf,0)); END user$reset$software; user$reset$hardware: PROCEDURE PUBLIC REENTRANT; CALL td$display(@('User hardware RESET invoked',cr,lf,0)); END user$reset$hardware; $EJECT /*****************************************************************************\ * * * Mainline Program * * * \*****************************************************************************/ CALL td$set$tdt$ptr(@user$tdt); /* Necessary only if more than one */ /* test descriptor table is in use */ CALL td$start; /* This routine should never be called */ /* more than once */ END SDT$SAMPLE$TEST;