Repeat a string: Difference between revisions

Line 83:
<pre>hahahahaha
*****</pre>
 
=={{header|6502 Assembly}}==
<lang 6502asm>CHROUT equ $FFD2 ;KERNAL call, prints the accumulator to the screen as an ascii value.
 
org $0801
 
 
db $0E,$08,$0A,$00,$9E,$20,$28,$32,$30,$36,$34,$29,$00,$00,$00
 
 
 
lda #>TestStr
sta $11
lda #<TestStr
sta $10
 
ldx #5 ;number of times to repeat
 
loop:
jsr PrintString
dex
bne loop
 
RTS ;RETURN TO BASIC
PrintString:
ldy #0
loop_PrintString:
lda ($10),y ;this doesn't actually increment the pointer itself, so we don't need to back it up.
beq donePrinting
jsr CHROUT
iny
jmp loop_PrintString
donePrinting:
rts
TestStr:
db "HA",0</lang>
{{out}}
<pre>
READY.
LOAD"*",8,1:
 
SEARCHING FOR *
LOADING
READY.
RUN
HAHAHAHAHA
READY.
</pre>
 
 
=={{header|8th}}==
1,489

edits