#437 ds390: b destroyed while using dual-ptr

closed
5
2003-01-27
2003-01-13
No

Model ds390:

#include <stdarg.h>
#include <stdio.h>

static bit string_flag =0;
static char * data str ;

void printf_small (char * fmt, ... ) reentrant
{
char c;
va_list ap ;

va_start(ap,fmt);

for (; *fmt ; fmt++ )
{
if (*fmt == '%')
{
fmt++;
if (string_flag)
{
str = va_arg(ap, char *);
while (*str)
*str++;
continue ;
}
while ((c = *str++) != '\0')
;
}
else
putchar(*fmt);
}
}

; b.c:14: for (; *fmt ; fmt++ )
; genAssign
mov a,_bpx
clr c
subb a,#0x08
mov b,a
mov a,_bpx+1
subb a,#0x00
mov dpx,#0x40
mov dph,a
mov dpl,b ; &fmt in dpx,dph,dpl
; genAssign: resultIsFar = FALSE
movx a,@dptr
mov r6,a
inc dptr
movx a,@dptr
mov r7,a
inc dptr
movx a,@dptr
mov r0,a
inc dptr
movx a,@dptr
mov r1,a ; fmt in r1,r0,r7,r6
; genPointerGet
; genGenPointerGet
mov dpl,r6
mov dph,r7
mov dpx,r0
mov b,r1 ; fmt in b,dpx,dph,dpl
mov a,_bpx ; temp. storage for *fmt ?
clr c
subb a,#0xF6 ; prepare &sloc2
mov b,a ; ####### destroy b ########
mov a,_bpx+1
subb a,#0xFF
mov dpx1,#0x40
mov dph1,a
mov dpl1,b ; &sloc2 in dpx1,dph1,dpl1
lcall __gptrget
mov dps,#1
movx @dptr,a ; sloc2 = *fmt;
mov dps,#0

Discussion

  • Johan Knol

    Johan Knol - 2003-01-24

    Logged In: YES
    user_id=63512

    fixed in src/ds390/gen.c:1.160

     
  • Johan Knol

    Johan Knol - 2003-01-24
    • assigned_to: nobody --> johanknol
    • status: open --> closed
     
  • Bernhard Held

    Bernhard Held - 2003-01-26

    Logged In: YES
    user_id=203539

    Sorry, I can't confirm the fix. I took the liberty and re-opened the
    bug.

     
  • Bernhard Held

    Bernhard Held - 2003-01-26
    • status: closed --> open
     
  • Bernhard Held

    Bernhard Held - 2003-01-27
    • status: open --> closed
     
  • Bernhard Held

    Bernhard Held - 2003-01-27

    Logged In: YES
    user_id=203539

    I'm sorry about the false alert. The fix works fine.

     

Log in to post a comment.

Get latest updates about Open Source Projects, Conferences and News.

Sign up for the SourceForge newsletter:





No, thanks