sss
This commit is contained in:
parent
52c546b9d8
commit
d58fed710f
@ -46,3 +46,11 @@ load
|
|||||||
si
|
si
|
||||||
xit
|
xit
|
||||||
exit
|
exit
|
||||||
|
target extended-remote :3333
|
||||||
|
dashboard -layout registers memory
|
||||||
|
file counter.S
|
||||||
|
load
|
||||||
|
load file
|
||||||
|
load counter.S
|
||||||
|
si
|
||||||
|
exit
|
||||||
|
21
counter.S
21
counter.S
@ -1,6 +1,6 @@
|
|||||||
.data
|
.data
|
||||||
sentence: .ascii "My fbbirbst btbry\0" // \0 to bajt zerowy czyli koniec zdania w asm, C =
|
sentence: .ascii "My fbbirbst btbry\0" // \0 to bajt zerowy czyli koniec zdania w asm, C =
|
||||||
|
sentence2: .ascii "proba do dodawania sentence"
|
||||||
.text
|
.text
|
||||||
.align 2
|
.align 2
|
||||||
.globl _start
|
.globl _start
|
||||||
@ -9,9 +9,28 @@ _start:
|
|||||||
la t2, sentence
|
la t2, sentence
|
||||||
li t0, 0x62 //ascii "b"
|
li t0, 0x62 //ascii "b"
|
||||||
|
|
||||||
|
la s2, sentence
|
||||||
|
li s3, 0x79 // ascii "o"
|
||||||
|
|
||||||
|
li s4, 0x00 // licznik o w sentence2
|
||||||
|
|
||||||
li t1, 0x00 // licznik b w sentence
|
li t1, 0x00 // licznik b w sentence
|
||||||
|
|
||||||
loop:
|
loop:
|
||||||
|
|
||||||
|
lbu s5, 0(s2)
|
||||||
|
beq s5, zero, koniec
|
||||||
|
|
||||||
|
bne s5, s3, 1f
|
||||||
|
addi s4, s4, 1
|
||||||
|
|
||||||
|
2:
|
||||||
|
|
||||||
|
addi s2, s2, 1
|
||||||
|
j
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
lbu t3, 0(t2) // ladujemy do rejestra t3 adres 1 litery sentece
|
lbu t3, 0(t2) // ladujemy do rejestra t3 adres 1 litery sentece
|
||||||
beq t3, zero, koniec # jezeli adres w sentence dojdzie do \0 czyli do konca programm sie skonczy
|
beq t3, zero, koniec # jezeli adres w sentence dojdzie do \0 czyli do konca programm sie skonczy
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user