Page 4 of 4 FirstFirst ... 234
Results 31 to 36 of 36

Thread: Pas2C64

  1. #31
    After I found a very simple c64 interrupt routine here:

    http://xabreman.wordpress.com/2011/0...rrupt-example/

    I thought that I can do this too, so by adding some new routines into the Pascal language & their support framework (parsing + code generation), I can now actually do this very same interrupt routine using compiled Pascal routines:

    Code:
    program Test;
    
    procedure irqtest; interrupt;
    begin
      IncMemB($d020);
      StdIRQ;
    end;
    
    procedure Init;
    begin
      SetInterrupt(irqtest);
    end;
    
    begin
      Init;
    end.
    which produces this:
    Code:
        :BasicUpstart2(main) // 10 sys <start address>
        
        .import source "rtl\Macros_RTL.asm"
        .import source "rtl\Consts_RTL.asm"
        
    int_irqtest:
        inc $d020
        jmp STDIRQ
        rti
    proc_init:
        sei       // disable interrupts
        
        // set a custom interrupt routine address to interrupt vector
        
        lda #<int_irqtest       // low byte of irqtest start addr
        ldx #>int_irqtest       // high byte of irqtest start addr
        sta IRQVECLO
        stx IRQVECHI
        
        cli                 // clear interrupt disable bit
        rts
    main:
        jsr proc_init
        rts
    and when run in the c64 VICE emulator, it hooks the interrupt routine into the interrupt vector and merrily runs in the background incrementing the background colour!

    Now this is progress!! haha

    cheers,
    Paul
    Last edited by paul_nicholls; 15-06-2011 at 12:40 PM.

  2. #32
    Quote Originally Posted by paul_nicholls View Post
    Why can't you work on it? You just don't feel like it?

    cheers,
    Paul
    I have a lot of open projects, and I don't know how to say "no" (so when somebody propose something I always say "yes" ), and I'm not in my best moment right now...
    No signature provided yet.

  3. #33
    Well, I have come up with a logo for my pas2c64 project:


    What do you guys think? I quite like it, but feel free to comment, I value your feedback

    cheers,
    Paul
    Last edited by paul_nicholls; 16-06-2011 at 01:48 AM.

  4. #34
    I'd prefer Pas2Atari800XE, but your logo looks good too

  5. #35
    Quote Originally Posted by mobilus View Post
    I'd prefer Pas2Atari800XE, but your logo looks good too
    haha! thanks mate

    cheers,
    Paul

  6. #36
    Neat! I have added a handy feature to pas2c64 - allowing pure 6502 assembly code procedure that I can call from the rest of the program!

    This is great for testing and extending pas2c64 without even adding new features and recompiling

    Here is an example:
    Code:
    procedure UpperCase; assembler;
    asm
      lda $d018
      and #253
      sta $d018
    end;
    
    procedure LowerCase; assembler;
    asm
      lda $d018
      ora #2
      sta $d018
    end;
    
    begin
      LowerCase;
      UpperCase;
    end.
    cheers,
    Paul

Page 4 of 4 FirstFirst ... 234

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •