require '_h2ph_pre.ph';

unless(defined(&_ASM_H_)) {
    eval 'sub _ASM_H_ () {1;}' unless defined(&_ASM_H_);
    if(defined(&__STDC__)) {
	eval 'sub _C_LABEL {
	    local($name) = @_;
    	    eval q( &_  $name);
	}' unless defined(&_C_LABEL);
    } else {
	eval 'sub _C_LABEL {
	    local($name) = @_;
    	    eval q( &_name);
	}' unless defined(&_C_LABEL);
    }
    eval 'sub _ASM_LABEL {
        local($name) = @_;
	    eval q($name);
    }' unless defined(&_ASM_LABEL);
    unless(defined(&_KERNEL)) {
	eval 'sub _ENTRY {
	    local($name) = @_;
    	    eval q(. &text; . &even; . &globl $name; . &type $name,@ &function; $name:);
	}' unless defined(&_ENTRY);
    } else {
	eval 'sub _ENTRY {
	    local($name) = @_;
    	    eval q(. &text; . &even; . &globl $name; $name:);
	}' unless defined(&_ENTRY);
    }
    if(defined(&GPROF)) {
	eval 'sub _PROF_PROLOG () { &link  &a6,0;  &jbsr  &mcount;  &unlk  &a6;}' unless defined(&_PROF_PROLOG);
    } else {
	eval 'sub _PROF_PROLOG () {1;}' unless defined(&_PROF_PROLOG);
    }
    eval 'sub ENTRY {
        local($name) = @_;
	    eval q( &_ENTRY( &_C_LABEL($name))  &_PROF_PROLOG);
    }' unless defined(&ENTRY);
    eval 'sub ASENTRY {
        local($name) = @_;
	    eval q( &_ENTRY( &_ASM_LABEL($name))  &_PROF_PROLOG);
    }' unless defined(&ASENTRY);
    eval 'sub ENTRY_NOPROFILE {
        local($name) = @_;
	    eval q( &_ENTRY( &_C_LABEL($name)));
    }' unless defined(&ENTRY_NOPROFILE);
    eval 'sub ASENTRY_NOPROFILE {
        local($name) = @_;
	    eval q( &_ENTRY( &_ASM_LABEL($name)));
    }' unless defined(&ASENTRY_NOPROFILE);
    if(defined(&PROF)) {
	eval 'sub ALTENTRY {
	    local($name, $rname) = @_;
    	    eval q( &ENTRY($name);  &jra $rname+12);
	}' unless defined(&ALTENTRY);
    } else {
	eval 'sub ALTENTRY {
	    local($name, $rname) = @_;
    	    eval q( &_ENTRY( &_C_LABEL($name)));
	}' unless defined(&ALTENTRY);
    }
    eval 'sub RCSID {
        local($x) = @_;
	    eval q(. &text ; . &asciz $x ; . &even);
    }' unless defined(&RCSID);
    eval 'sub GLOBAL {
        local($x) = @_;
	    eval q(. &globl  &_C_LABEL($x) ;  &_C_LABEL($x):);
    }' unless defined(&GLOBAL);
    eval 'sub ASGLOBAL {
        local($x) = @_;
	    eval q(. &globl  &_ASM_LABEL($x) ;  &_ASM_LABEL($x):);
    }' unless defined(&ASGLOBAL);
    eval 'sub LOCAL {
        local($x) = @_;
	    eval q( &_C_LABEL($x):);
    }' unless defined(&LOCAL);
    eval 'sub ASLOCAL {
        local($x) = @_;
	    eval q( &_ASM_LABEL($x):);
    }' unless defined(&ASLOCAL);
    eval 'sub BSS {
        local($name, $size) = @_;
	    eval q(. &comm  &_C_LABEL($name),$size);
    }' unless defined(&BSS);
    eval 'sub ASBSS {
        local($name, $size) = @_;
	    eval q(. &comm  &_ASM_LABEL($name),$size);
    }' unless defined(&ASBSS);
    if(defined(&_KERNEL)) {
	eval 'sub PANIC {
	    local($x) = @_;
    	    eval q( &pea 9 &f ;  &jbsr  &_C_LABEL( &panic) ; 9: . &asciz $x ; . &even);
	}' unless defined(&PANIC);
	eval 'sub VECTOR {
	    local($x) = @_;
    	    eval q(. &long _C_LABEL($x));
	}' unless defined(&VECTOR);
	eval 'sub ASVECTOR {
	    local($x) = @_;
    	    eval q(. &long _ASM_LABEL($x));
	}' unless defined(&ASVECTOR);
	eval 'sub VECTOR_UNUSED () {.\'long 0\';}' unless defined(&VECTOR_UNUSED);
    }
}
1;
