Example #1
0
static void ins_long P1(long, l)
{
    if (prog_code + 8 > prog_code_max) {
	mem_block_t *mbp = &mem_block[A_PROGRAM];
	UPDATE_PROGRAM_SIZE;
	realloc_mem_block(mbp);
	
	prog_code = mbp->block + mbp->current_size;
	prog_code_max = mbp->block + mbp->max_size;
    }
    STORE_PTR(prog_code, l);
}
Example #2
0
/*
 * Store a 2 byte number. It is stored in such a way as to be sure
 * that correct byte order is used, regardless of machine architecture.
 * Also beware that some machines can't write a word to odd addresses.
 */
static void ins_short P1(short, l)
{
    if (prog_code + 2 > prog_code_max) {
	mem_block_t *mbp = &mem_block[A_PROGRAM];
	UPDATE_PROGRAM_SIZE;
	realloc_mem_block(mbp);
	
	prog_code = mbp->block + mbp->current_size;
	prog_code_max = mbp->block + mbp->max_size;
    }
    STORE_SHORT(prog_code, l);
}
Example #3
0
static void ins_byte P1(unsigned char, b)
{
    if (prog_code == prog_code_max) {
	mem_block_t *mbp = &mem_block[A_PROGRAM];
	UPDATE_PROGRAM_SIZE;
	realloc_mem_block(mbp);
	
	prog_code = mbp->block + mbp->current_size;
	prog_code_max = mbp->block + mbp->max_size;
    }
    *prog_code++ = b;
}
/*
 * Store a 4 byte number. It is stored in such a way as to be sure
 * that correct byte order is used, regardless of machine architecture.
 */
static void ins_int P1(int, l)
{
    if (prog_code + 4 > prog_code_max) {
	struct mem_block *mbp = &mem_block[current_block];
	UPDATE_PROGRAM_SIZE;
	realloc_mem_block(mbp, mbp->current_size * 2);
	
	prog_code = mbp->block + mbp->current_size;
	prog_code_max = mbp->block + mbp->max_size;
    }
    STORE_INT(prog_code, l);
}
Example #5
0
/*
 * Store a 4 byte number. It is stored in such a way as to be sure
 * that correct byte order is used, regardless of machine architecture.
 */
static void ins_int (long l)
{

    if (prog_code + SIZEOF_LONG > prog_code_max) {
        mem_block_t *mbp = &mem_block[A_PROGRAM];
        UPDATE_PROGRAM_SIZE;
        realloc_mem_block(mbp);
        
        prog_code = mbp->block + mbp->current_size;
        prog_code_max = mbp->block + mbp->max_size;
    }
    STORE_INT(prog_code, l);
}
Example #6
0
static void ins_real P1(double, l)
{
    float f = (float)l;

    if (prog_code + 4 > prog_code_max) {
	mem_block_t *mbp = &mem_block[A_PROGRAM];

	UPDATE_PROGRAM_SIZE;
	realloc_mem_block(mbp);
	
	prog_code = mbp->block + mbp->current_size;
	prog_code_max = mbp->block + mbp->max_size;
    }
    STORE_FLOAT(prog_code, f);
}