Jetzt kann ich auch in cc65 die serielle Schnittstelle bedienen.
Habe dann auch gleich die Inline-Syntax vom cc65 kennengelernt.
Es wird der Wert 67 nach draussen gesendet.
C
- #include <stdio.h>
- #include <stdlib.h>
- #include <string.h>
- #include <conio.h>
- #include <ctype.h>
- unsigned char wert[2];
- unsigned char wert1;
- void sende(){
- asm(" lda #2");
- asm(" ldx #2");
- asm(" ldy #0");
- asm(" jsr $ffba");
- asm(" lda #2");
- asm(" ldx #<(_wert)");
- asm(" ldy #>(_wert)");
- asm(" jsr $ffbd");
- asm(" jsr $ffc0");
- asm(" ldx #2");
- asm(" jsr $ffc9");
- asm(" ldy #0 ");
- asm(" lda _wert1,y ");
- asm(" jsr $ffd2 ");
- asm(" jsr $ffcc");
- asm("_label1:");
- asm(" lda $029d");
- asm(" cmp $029e");
- asm(" bne _label1");
- asm(" ldx #30");
- asm("_label2:");
- asm(" jsr $eeb3");
- asm(" dex");
- asm(" bne _label2");
- asm(" lda #2");
- asm(" jsr $ffc3");
- asm(" rts");
- }
- int main (void)
- {
- wert[0]=6;
- wert[1]=0;
- wert1=67;
- sende();
- }