x equ r0 y equ r1 si equ r2 xx equ r3 cseg at 0 jmp main cseg at 5 sin: // si=(((y*13)>>8)*(0x7f-((y*6)>>8)))>>8; mov a,y mov b,#13 mul ab ;((y*13)>>8) mov xx,b mov a,y mov b,#6 ;((y*6)>>8) mul ab mov a,#0x7f subb a,b mov b,xx mul ab ;si mov si,b ;si=(((y*43)>>8)*(0x7f-si))>>8; mov a,y mov b,#43 mul ab ;((y*43)>>8) mov xx,b mov a,#0x7f subb a,si mul ab ;si mov si,b ;si=(x*(0xff-si))>>8; mov a,#0xff subb a,si mov b,x mul ab ;si=b mov si,b ret main: ;for(x=0; x<=0x0ff; x++) mov x,#0 ;y=(x*x)>>8; ; sin(y); cikl: mov a,x mov b,x mul ab mov y,b call sin mov P3,si inc x cjne x,#0x7f,cikl jmp main nop end