#ifndef _asmutil_c_ #define _asmutil_c_ #include "asmutil.h" #pragma SRC void writeFarWord( unsigned int seg, unsigned int address, unsigned int val ) { // variable val assigned to R10 // variable address assigned to R9 // variable seg assigned to R8 #pragma ASM EXTS R8,#1 movw [R9],R10 nop #pragma ENDASM } void writeFarByte( unsigned int seg, unsigned int address, unsigned char val ) { // variable val assigned to R10 // variable address assigned to R9 // variable seg assigned to R8 #pragma ASM push R7 mov R7,R10 EXTS R8,#1 movb [R9],RL7 nop pop R7 #pragma ENDASM } void reset_to_rom( void ) { #pragma ASM MOV CP,#0FC00H MOV R0,#0 MOV R1,#0 SRST #pragma ENDASM } void reset_to_ram( void ) { int ct; //short test, if ramspace //started with the same objcode //as the romcode ct = 0; while( ct < 10 ){ if( RAMPROG_VARS[ct] != ROMPROG_VARS[ct] ){ return; } ct++; } #pragma ASM MOV CP,#0FC00H MOV R0,#7FF1H MOV R1,#6AB2H SRST #pragma ENDASM } #endif