
This file contains hidden or 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
//just i javascript är det lite småjobbigt att få fram ett index för nuvarande dag på året... suck | |
//https://stackoverflow.com/questions/8619879/javascript-calculate-the-day-of-the-year-1-366 | |
Date.prototype.isLeapYear = function() { | |
var year = this.getFullYear(); | |
if((year & 3) != 0) return false; | |
return ((year % 100) != 0 || (year % 400) == 0); | |
}; | |
// Get Day of Year | |
Date.prototype.getDOY = function() { |
This file contains hidden or 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
;R0 parameter | |
factorial | |
PUSH {R1, R2, LR} | |
CMP R0, #1 | |
BEQ ret ; return 1 | |
MOV R1, R0 ; kopiera R0 till R1 | |
SUB R0, R0, #1 ; dec R0 | |
BL factorial ; anropa factorial | |
MUL R2, R1, R0 ; int result = fact(n-1)*n | |
MOV R0, R2 ; R0 = result |
This file contains hidden or 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
(this file changes the title of this Gist, ignore this) |
NewerOlder