;CLI$SETSYM.MAR set a symbol via the CLI routine ; MMLIB.MAR [MICRONAUT] Jeff Capehart Nov 1987 ; .title cli$setsym .ident \v1.01\ .psect $code,pic,con,rel,lcl,shr,exe,rd,nowrt,2 ; ; CLI$SETSYM -- set a symbol via the CLI routine ; ; status = CLI$SETSYM ('symbol','definition',table) ; ;From Pascal: ;[asynchronous] function cli$setsym ( ;%stdescr symnam : [volatile] packed array [$l1..$u1:integer] of char ;%stdescr symdef : [volatile] packed array [$l2..$u2:integer] of char ; table : integer ) : integer ; extern; ; ; use table=2 for the global symbol table ; page .entry cli$setsym,^m<> movzwl #773,cliblok ;cli$k_defglobal*256 + cli$k_clint cmpl @12(r12),#2 ;check table beql setsym ;if 2 then it was global sym movzwl #517,cliblok ;cli$k_deflocal*256 + cli$k_clint setsym: movzwl @4(r12),cliblok+4 ;set length of sym movl 4(r12),r0 movl 4(r0),cliblok+8 ;set addr of sym movzwl @8(r12),cliblok+12 ;set length of def movl 8(r12),r12 movl 4(r12),cliblok+16 ;set addr of def clrl cliblok+20 ;set end of cli blok pushab cliblok ;shove on stack for call calls #1,sys$cli ;call the cli, ret status=r0 ret ;bye bye