aoeuidhtn
Posts: 36
Joined: Sat Jun 13, 2015 10:27 pm
Location: Warsaw, Poland

Re: Free assembly language book available online

Thu Apr 09, 2020 3:36 pm

7. At http://bob.cs.sonoma.edu/IntroCompOrg-R ... sgnop.html descriptions do not match listing similarly as in point 5.

8. Why are you using 12

Code: Select all

sub sp, sp, 12
here http://bob.cs.sonoma.edu/IntroCompOrg-R ... -assignasm if 4 variables are saved on the stack? Shouldn't you use 16? I checked that if `push` is used `sp` moves by 0x10 bytes. You moved by sp by 8 for 2 variables in http://bob.cs.sonoma.edu/IntroCompOrg-R ... choCharAsm.
Last edited by aoeuidhtn on Thu Apr 09, 2020 11:46 pm, edited 1 time in total.

aoeuidhtn
Posts: 36
Joined: Sat Jun 13, 2015 10:27 pm
Location: Warsaw, Poland

Re: Free assembly language book available online

Thu Apr 09, 2020 9:11 pm

9. http://bob.cs.sonoma.edu/IntroCompOrg-R ... tml#p-1882 - a missing word:
The bl instruction behaves exactly like the [MISSING WORD HERE] instruction except that it also stores the current value contained in the pc, the address of the instruction immediately following the bl instruction, in the r14.
Last edited by aoeuidhtn on Thu Apr 09, 2020 11:42 pm, edited 1 time in total.

User avatar
rpdom
Posts: 16797
Joined: Sun May 06, 2012 5:17 am
Location: Chelmsford, Essex, UK

Re: Free assembly language book available online

Thu Apr 09, 2020 9:30 pm

aoeuidhtn wrote:
Thu Apr 09, 2020 9:11 pm
9. http://bob.cs.sonoma.edu/IntroCompOrg-R ... -mach.html - a missing word:
The bl instruction behaves exactly like the [MISSING WORD HERE] instruction except that it also stores the current value contained in the pc, the address of the instruction immediately following the bl instruction, in the r14.
Yes. The missing word is "b".
Unreadable squiggle

aoeuidhtn
Posts: 36
Joined: Sat Jun 13, 2015 10:27 pm
Location: Warsaw, Poland

Re: Free assembly language book available online

Thu Apr 09, 2020 11:49 pm

rpdom wrote:
Thu Apr 09, 2020 9:30 pm
aoeuidhtn wrote:
Thu Apr 09, 2020 9:11 pm
9. http://bob.cs.sonoma.edu/IntroCompOrg-R ... -mach.html - a missing word:
The bl instruction behaves exactly like the [MISSING WORD HERE] instruction except that it also stores the current value contained in the pc, the address of the instruction immediately following the bl instruction, in the r14.
Yes. The missing word is "b".
Yes, most probably, thx. It looks like Robert is not active on this forum any more:
Last active:
Thu Feb 13, 2020 2:49 am

aoeuidhtn
Posts: 36
Joined: Sat Jun 13, 2015 10:27 pm
Location: Warsaw, Poland

Re: Free assembly language book available online

Sat Apr 11, 2020 12:09 pm

10. At http://bob.cs.sonoma.edu/IntroCompOrg-R ... ec-compare it says
This odd sequence of values will be explained in Section 11.3.3
but this is section 12.1.1 so it should say "has been explained in Section 11.3.3". And similarly in section 12.3 at http://bob.cs.sonoma.edu/IntroCompOrg-R ... felse.html:
further explained in Section 11.1

aoeuidhtn
Posts: 36
Joined: Sat Jun 13, 2015 10:27 pm
Location: Warsaw, Poland

Re: Free assembly language book available online

Sat Apr 11, 2020 1:20 pm

11. Coloring is broken at http://bob.cs.sonoma.edu/IntroCompOrg-R ... es-22.html, http://bob.cs.sonoma.edu/IntroCompOrg-R ... ls-if-else and other places where single quote is used before a character.

aoeuidhtn
Posts: 36
Joined: Sat Jun 13, 2015 10:27 pm
Location: Warsaw, Poland

Re: Free assembly language book available online

Sat Apr 11, 2020 1:30 pm

12. I got some doubts about http://bob.cs.sonoma.edu/IntroCompOrg-R ... ls-if-else:

Code: Select all

@ if-else.s
@ NOT A FUNCTION.  Shows if-else structure.
@ 2017-09-29: Bob Plantz

        -------

        ldrb    r3, [fp, #-response] @ load response
        cmp     r3, 'y          @ was it 'y'?
        bne     discard         @ no, discard changes

        (  else block  )

endThen:
        b       endElse         @ branch over else block

discard:

        (  then block  )

endElse:

        -------
Shouldn't "( else block )" and "( then block )" be swapped? I mean, then block is executed first right after "bne discard", not else block, right?

aoeuidhtn
Posts: 36
Joined: Sat Jun 13, 2015 10:27 pm
Location: Warsaw, Poland

Re: Free assembly language book available online

Thu May 14, 2020 11:44 am

13. at http://bob.cs.sonoma.edu/IntroCompOrg-R ... instr.html says:
it will be explained in Section 11.3.3
in a couple of places but this is section 14.1 so it should say "has been explained in section 11.3.3".

aoeuidhtn
Posts: 36
Joined: Sat Jun 13, 2015 10:27 pm
Location: Warsaw, Poland

Re: Free assembly language book available online

Mon May 18, 2020 11:43 am

14. in section 15.3 at http://bob.cs.sonoma.edu/IntroCompOrg-R ... ecord.html putChar() is used but it's introduced in http://bob.cs.sonoma.edu/IntroCompOrg-R ... es-30.html in section 15.7

aoeuidhtn
Posts: 36
Joined: Sat Jun 13, 2015 10:27 pm
Location: Warsaw, Poland

Re: Free assembly language book available online

Tue May 19, 2020 8:17 pm

15. In http://bob.cs.sonoma.edu/IntroCompOrg-R ... ctarg.html why are you using offsets of 24 bytes for x struct:

Code: Select all

        
        .equ    x,-24           @ x struct
? It leaves an empty word between r4 saved on the stack and the beginning of the struct:

Code: Select all

fp - old lr
old fp
old r4
empty word
x struct
20 bytes would be enough:

Code: Select all

        .equ x,-20           @ x struct
as shown by gdb:

Code: Select all

(gdb) break structPass2.s:53
Breakpoint 1 at 0x10540: file structPass2.s, line 53.
(gdb) run
Starting program: /home/pi/assembly/struct/pass-argument/bob/a.out

Breakpoint 1, main () at structPass2.s:53
53             add     r0, fp, y       @ address of y struct
(gdb) bt
#0  main () at structPass2.s:53
Backtrace stopped: previous frame identical to this frame (corrupt stack?)
(gdb) x/x $fp - 12
0x7efffa88:     0x00000032
(gdb) p/c 0x00000032
$1 = 50 '2'
(gdb) x/x $fp - 16
0x7efffa84:     0x000001c8
(gdb) p/d 0x000001c8
$2 = 456
(gdb) x/x $fp - 20
0x7efffa80:     0x00010331
(gdb) p/c 0x00010331
$3 = 49 '1'
And the same applies to y, why not:

Code: Select all

        .equ    y,-32           @ y struct
?

aoeuidhtn
Posts: 36
Joined: Sat Jun 13, 2015 10:27 pm
Location: Warsaw, Poland

Re: Free assembly language book available online

Tue May 19, 2020 11:59 pm

16. http://bob.cs.sonoma.edu/IntroCompOrg-R ... phdwr.html - why are you saving r4-r6 in addFloat2.s if they are not modified by the code?

aoeuidhtn
Posts: 36
Joined: Sat Jun 13, 2015 10:27 pm
Location: Warsaw, Poland

Re: Free assembly language book available online

Wed May 20, 2020 1:35 pm

17. In http://bob.cs.sonoma.edu/IntroCompOrg-R ... phdwr.html in explanation of VCVT it says:
<Sd> and <Dd> are the destination registers, and <Sm> and <Dm> and
<Dn> are the source registers.
but:

- there is no <Dn> parameter

- order of input arguments should be: <Dm> and <Sm> to match order in which output registers are listed

aoeuidhtn
Posts: 36
Joined: Sat Jun 13, 2015 10:27 pm
Location: Warsaw, Poland

Re: Free assembly language book available online

Wed May 20, 2020 7:20 pm

18. http://bob.cs.sonoma.edu/IntroCompOrg-R ... xcept.html - period after
Before describing the differences, we discuss what ought to occur in order for the operating system to deal with each of these events
sentence.


19. http://bob.cs.sonoma.edu/IntroCompOrg-R ... -cond.html - incorrect placement of double quotes:
Unless you are a perfect programmer, you have probably seen a “segmentation fault.”
It should be:
Unless you are a perfect programmer, you have probably seen a “segmentation fault”.

aoeuidhtn
Posts: 36
Joined: Sat Jun 13, 2015 10:27 pm
Location: Warsaw, Poland

Re: Free assembly language book available online

Wed May 20, 2020 7:39 pm

20. In http://bob.cs.sonoma.edu/IntroCompOrg-R ... -cond.html it says:
The address corresponding to the data abort exception vector, 0x00000004, is loaded into the pc.
But this example discusses und exception so it should be:
The address corresponding to the undefined instruction exception vector, 0x00000004, is loaded into the pc.

aoeuidhtn
Posts: 36
Joined: Sat Jun 13, 2015 10:27 pm
Location: Warsaw, Poland

Re: Free assembly language book available online

Wed May 20, 2020 10:19 pm

21. In http://bob.cs.sonoma.edu/IntroCompOrg-R ... nters.html it says:

Code: Select all

5. The address corresponding to the IRQ vector, 0x00000018e is loaded into the pc.
Do you mean 0x00000018?

aoeuidhtn
Posts: 36
Joined: Sat Jun 13, 2015 10:27 pm
Location: Warsaw, Poland

Re: Free assembly language book available online

Thu May 21, 2020 3:02 pm

22. In http://bob.cs.sonoma.edu/IntroCompOrg-R ... o-mem.html you use sudo:

Code: Select all

sudo ./IOmemory
but there is no need to use sudo as you said yourself in the same chapter:
User programs that access the /dev/gpiomem do not need to be executed with the sudo modifier.
providing of course that /etc/udev/rules.d/99-com.rules is setup correctly and udevd is running.

aoeuidhtn
Posts: 36
Joined: Sat Jun 13, 2015 10:27 pm
Location: Warsaw, Poland

Re: Free assembly language book available online

Thu May 21, 2020 3:39 pm

23. In http://bob.cs.sonoma.edu/IntroCompOrg-R ... o-mem.html
Determine the address where peripherals begin. It is 0x3e000000 on my Raspberry Pi 3.
but you're using 0x3f000000 in the code:

Code: Select all

        .equ    PERIPH,0x3f000000   @ RPi 2 & 3 peripherals

Return to “Teaching and learning resources”