comparison src/pseudo.c @ 65:31d8e85706e7

Implemented setdp and corrected handling of direct page detection in insn_gen_aux()
author lost
date Mon, 05 Jan 2009 01:40:01 +0000
parents aaddd47219b4
children c8c772ef5df9
comparison
equal deleted inserted replaced
64:aaddd47219b4 65:31d8e85706e7
394 l -> addrset = 2; 394 l -> addrset = 2;
395 395
396 lwasm_register_symbol(as, l, l -> sym, rval, SYMBOL_SET); 396 lwasm_register_symbol(as, l, l -> sym, rval, SYMBOL_SET);
397 } 397 }
398 398
399 /* 399 OPFUNC(pseudo_setdp)
400 void pseudo_setdp(asmstate_t *as, sourceline_t *cl, char **optr) 400 {
401 { 401 int rval;
402 int rval, v1; 402
403 403 // setdp is needed on both passes
404 if (cl -> hassym) 404 if (lwasm_expr_result(as, l, p, EXPR_PASS1CONST | EXPR_PASS2CONST | EXPR_BYTE, &rval) < 0)
405 { 405 rval = 0;
406 register_error(as, cl, ERR_SYM); 406
407 cl -> hassym = 0; 407 l -> symaddr = rval & 0xFF;
408 return; 408 l -> addrset = 2;
409 } 409
410 else 410 as -> dpval = rval & 0xFF;
411 { 411 }
412 rval = eval_expr(as, cl, optr, &v1);
413 if (rval == -1)
414 {
415 errorp1(ERR_FORWARD);
416 }
417 if (rval < 0)
418 {
419 cl -> opcode = -1;
420 return;
421 }
422 }
423 // setdp needs to resolve properly on pass 2
424 if (v1 > 0xff || v1 < 0)
425 {
426 errorp1(ERR_OVERFLOW);
427 }
428 as -> dpval = v1 & 0xff;
429 cl -> dpval = v1 & 0xff;
430 cl -> issetdp = 1;
431 cl -> numcodebytes = 0;
432 //printf("%s\n", "SETDP2");
433 }
434 */
435 412
436 OPFUNC(pseudo_fcc) 413 OPFUNC(pseudo_fcc)
437 { 414 {
438 int delim = 0; 415 int delim = 0;
439 416