Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- ;
- ; File generated by cc65 v 2.13.3
- ;
- .fopt compiler,"cc65 v 2.13.3"
- .setcpu "65816"
- .smart on
- .autoimport on
- .case on
- .debuginfo on
- .importzp sp, sreg, regsave, regbank, tmp1, ptr1, ptr2
- .macpack longbranch
- .dbg file, "test.c", 2398, 1340438471
- .dbg file, "/usr/lib/cc65/include/stdio.h", 5964, 1340423015
- .dbg file, "/usr/lib/cc65/include/stddef.h", 2972, 1340423015
- .dbg file, "/usr/lib/cc65/include/stdarg.h", 2817, 1340423015
- .dbg file, "/usr/lib/cc65/include/string.h", 4883, 1340423015
- .dbg file, "/usr/lib/cc65/include/conio.h", 8680, 1340423015
- .dbg file, "/usr/lib/cc65/include/peekpoke.h", 3108, 1340423015
- .forceimport __STARTUP__
- .import _strlen
- .import _logRegisterA
- .export _main
- ; ---------------------------------------------------------------
- ; void __near__ main (void)
- ; ---------------------------------------------------------------
- .segment "CODE"
- .proc _main: near
- .segment "DATA"
- L0005:
- .byte $48,$65,$6C,$6C,$6F,$2C,$20,$77,$6F,$72,$6C,$64,$21,$00
- L0007:
- .byte $0D
- .segment "RODATA"
- L0003:
- .byte $48,$65,$6C,$6C,$6F,$2C,$20,$77,$6F,$72,$6C,$64,$21,$00
- .segment "BSS"
- L0006:
- .res 1,$00
- .segment "CODE"
- ;
- ; char hello[] = "Hello, world!";
- ;
- .dbg line, "test.c", 37
- ldy #$0E
- jsr subysp
- ldy #$0D
- L0004: lda L0003,y
- sta (sp),y
- dey
- bpl L0004
- ;
- ; goto skip_the_broken_stuff_that_makes_an_endless_loop;
- ;
- .dbg line, "test.c", 44
- jsr decsp1
- bra L0010
- ;
- ; __AX__ = strlen(hello);
- ;
- .dbg line, "test.c", 51
- L000D: inx
- iny
- lda (sp),y
- bne L000D
- ;
- ; logRegisterA(); // This is an asm routine that executes a custom opcode that logs A to the emulator's logfile.
- ;
- .dbg line, "test.c", 52
- jsr _logRegisterA
- ;
- ; for( i=0; i<strlen(hello); ++i )
- ;
- .dbg line, "test.c", 53
- lda #$00
- L0036: sta (sp)
- lda (sp)
- jsr pusha0
- ldx #$FF
- ldy #$02
- L0017: inx
- iny
- lda (sp),y
- bne L0017
- txa
- jsr tosicmp0
- bcs L0010
- ;
- ; POKE( 0x310+i, hello[i] );
- ;
- .dbg line, "test.c", 55
- lda (sp)
- clc
- adc #$10
- pha
- lda #$00
- adc #$03
- tax
- pla
- jsr pushax
- lda sp
- ldx sp+1
- clc
- adc #$03
- bcc L001F
- inx
- L001F: ldy #$02
- clc
- adc (sp),y
- bcc L0020
- inx
- L0020: sta ptr1
- stx ptr1+1
- ldy #$00
- lda (ptr1)
- jsr staspidx
- ;
- ; __AX__ = hello[i];
- ;
- .dbg line, "test.c", 57
- lda sp
- clc
- adc #$01
- clc
- adc (sp)
- ;
- ; logRegisterA();
- ;
- .dbg line, "test.c", 58
- jsr _logRegisterA
- ;
- ; for( i=0; i<strlen(hello); ++i )
- ;
- .dbg line, "test.c", 53
- clc
- lda #$01
- adc (sp)
- bra L0036
- ;
- ; for( i_static=0; i_static<len_static; ++i_static )
- ;
- .dbg line, "test.c", 64
- L0010: stz L0006
- L0027: lda L0006
- cmp L0007
- bcs L0028
- ;
- ; POKE( 0x310+i_static, hello_static[i_static] );
- ;
- .dbg line, "test.c", 66
- lda L0006
- clc
- adc #$10
- sta ptr1
- lda #$00
- adc #$03
- sta ptr1+1
- ldy L0006
- lda L0005,y
- sta (ptr1)
- ;
- ; for( i_static=0; i_static<len_static; ++i_static )
- ;
- .dbg line, "test.c", 64
- inc L0006
- bra L0027
- ;
- ; }
- ;
- .dbg line, "test.c", 69
- L0028: ldy #$0F
- jmp addysp
- .dbg line
- .endproc
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement