Assembly vs BASIC
From Maze
(Difference between revisions)
| Line 36: | Line 36: | ||
BASIC makes both of these acts compact and accessible. Print a character, generate a random number. Normally, carrying out either of these in assembly is an arduous task. Here's an example of a commonly used routine for generating a random 8-bit number in 6502 assembly: | BASIC makes both of these acts compact and accessible. Print a character, generate a random number. Normally, carrying out either of these in assembly is an arduous task. Here's an example of a commonly used routine for generating a random 8-bit number in 6502 assembly: | ||
| − | <pre | + | <pre> |
Rand8 | Rand8 | ||
lda random ; get seed from memory (must be non-zero) | lda random ; get seed from memory (must be non-zero) | ||
