cnt = uip_len - UIP_LLH_LEN + UIP_TCPIP_HLEN;
cnt = uip_len - (UIP_LLH_LEN + UIP_TCPIP_HLEN);
cs8900a_send(void){  asm("ldx %v", idx);  /* Transmit command. */  asm("lda #$c0");  asm("sta %v,x", cs8900a_txcmd);  asm("lda #$00");  asm("sta %v+1,x", cs8900a_txcmd);  asm("lda %v", uip_len);  asm("sta %v,x", cs8900a_txlen);  asm("lda %v+1", uip_len);  asm("sta %v+1,x", cs8900a_txlen);  asm("ldy #8");tryagain:  /* Check for avaliable buffer space. */  asm("lda #$38");  asm("sta %v,x", cs8900a_packetpp);  asm("lda #$01");  asm("sta %v+1,x", cs8900a_packetpp);  asm("lda %v+1,x", cs8900a_ppdata);  asm("and #1");  asm("bne %g", send);  /* No space avaliable, skip a received frame and try again. */  asm("lda #$02");  asm("sta %v,x", cs8900a_packetpp);  asm("lda #$01");  asm("sta %v+1,x", cs8900a_packetpp);  asm("lda %v,x", cs8900a_ppdata);  asm("ora #$40");  asm("sta %v,x", cs8900a_ppdata);  asm("dey");  asm("bne %g", tryagain);  return;  /* Send the frame. */send:  /* First, send 14+40=54 bytes of header. */  asm("ldy #0");sendloop1:  asm("lda %v,y", uip_buf);  asm("sta %v,x", cs8900a_rxtxreg);  asm("iny");  asm("lda %v,y", uip_buf);  asm("sta %v+1,x", cs8900a_rxtxreg);  asm("iny");  asm("cpy #%b", UIP_LLH_LEN + UIP_TCPIP_HLEN);  asm("bne %g", sendloop1);  if(uip_len <= UIP_LLH_LEN + UIP_TCPIP_HLEN) {    return;  }  /* Next, send rest of the packet. */  cnt = uip_len - UIP_LLH_LEN + UIP_TCPIP_HLEN;  asm("ldx %v", idx);  asm("lda %v", cnt);  asm("lsr");  asm("bcc %g", noinc);  asm("inc %v", cnt);  asm("bne %g", noinc);  asm("inc %v+1", cnt);noinc:  asm("lda %v", uip_appdata);  asm("sta ptr1");  asm("lda %v+1", uip_appdata);  asm("sta ptr1+1");    asm("ldy #0");sendloop2:  asm("lda (ptr1),y");  asm("sta %v,x", cs8900a_rxtxreg);  asm("iny");  asm("lda (ptr1),y");  asm("sta %v+1,x", cs8900a_rxtxreg);  asm("iny");  asm("bne %g", check);  asm("inc ptr1+1");check:  asm("cpy %v", cnt);  asm("bne %g", sendloop2);  asm("dec %v+1", cnt);  asm("bpl %g", sendloop2);}