Created
October 17, 2012 15:21
-
-
Save b-adams/3906114 to your computer and use it in GitHub Desktop.
CS225 WED OCT 17 NOTES
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
BR main | |
msg: .ASCII "Beans beans beans beans beans!\x00" | |
main: NOP0 | |
;Set up index register to 0 | |
LDX 0,i | |
loop:NOP0 | |
LDX 0,i ;Clear accumulator | |
LDBYTEA msg,x ;Load current letter | |
BREQ endloop ;string is over if that letter is 0 aka /x00 | |
CHARO msg,x ;Second letter? | |
ADDX 1,i ;X++ part 1/1 | |
BR loop | |
endloop:NOP0 | |
stop | |
.end |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#include <stdio.h> | |
int main(void) | |
{ | |
int size; | |
scanf("%d", &size); | |
for(int j=0; j<size; j++) | |
{ | |
for(int i=0; i<j; i++) | |
{ | |
printf("*"); | |
} | |
printf("\n"); | |
} | |
return 0; | |
} | |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment