diff --git a/.gdb_history b/.gdb_history index 249842e..702a74d 100644 --- a/.gdb_history +++ b/.gdb_history @@ -46,3 +46,11 @@ load si xit exit +target extended-remote :3333 +dashboard -layout registers memory +file counter.S +load +load file +load counter.S +si +exit diff --git a/counter.S b/counter.S index 12342b5..40b00c2 100644 --- a/counter.S +++ b/counter.S @@ -1,6 +1,6 @@ .data sentence: .ascii "My fbbirbst btbry\0" // \0 to bajt zerowy czyli koniec zdania w asm, C = - +sentence2: .ascii "proba do dodawania sentence" .text .align 2 .globl _start @@ -9,9 +9,28 @@ _start: la t2, sentence 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 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 beq t3, zero, koniec # jezeli adres w sentence dojdzie do \0 czyli do konca programm sie skonczy