Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- ;:ts=8
- R0 equ 1
- R1 equ 5
- R2 equ 9
- R3 equ 13
- ;struct wario {
- ; unsigned char money;
- ; unsigned short gold;
- ; unsigned short wares;
- ;};
- ;
- ;
- ;struct wario bbb;
- ;
- ;void main() {
- code
- xdef __main
- func
- __main:
- longa on
- longi on
- tsc
- sec
- sbc #L2
- tcs
- phd
- tcd
- ;/*
- ; struct wario aaa;
- ;
- ; aaa.money = 5;
- ; aaa.gold = 5;
- ; aaa.wares = aaa.money + 15;
- ;
- ; bbb.money = 7;
- ; bbb.gold = 7;
- ; bbb.wares = aaa.money + 17;
- ;
- ; aaa = bbb;
- ;*/
- ; struct wario warios[10];
- ; unsigned char i;
- ;
- ; warios[0].wares = 1;
- warios_1 set 0
- i_1 set 50
- lda #$1
- sta <L3+warios_1+3
- ;
- ; for(i=0; i<10; i++) {
- sep #$20
- longa off
- stz <L3+i_1
- rep #$20
- longa on
- bra L10004
- L10003:
- ; warios[i].money = 5;
- lda <L3+i_1
- and #$ff
- sta <R0
- asl A
- asl A
- adc <R0
- tax
- sep #$20
- longa off
- lda #$5
- sta <L3+warios_1,X
- rep #$20
- longa on
- ; warios[i].gold = 7;
- lda <L3+i_1
- and #$ff
- sta <R0
- asl A
- asl A
- adc <R0
- tax
- lda #$7
- sta <L3+warios_1+1,X
- ; warios[i].wares = warios[i-1].wares + 1;;
- lda <L3+i_1
- and #$ff
- sta <R0
- asl A
- asl A
- adc <R0
- sta <R0
- lda <L3+i_1
- and #$ff
- sta <R1
- asl A
- asl A
- adc <R1
- tax
- lda <L3+warios_1-2,X
- ina
- ldx <R0
- sta <L3+warios_1+3,X
- ; }
- sep #$20
- longa off
- inc <L3+i_1
- rep #$20
- longa on
- L10004:
- sep #$20
- longa off
- lda <L3+i_1
- cmp #<$a
- rep #$20
- longa on
- bcc L10003
- ;}
- pld
- tsc
- clc
- adc #L2
- tcs
- rts
- L2 equ 59
- L3 equ 9
- ends
- efunc
- ;
- udata
- xdef __bbb
- __bbb
- ds 5
- ends
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement