Friday 17 October 2014

OSD600: Release 0.2

I took issue#319 in Webmaker for this release. I already completed it. Please find it here

This issue is about the UI, to align the line on the homepage with the text instead of centralize it. 

Now it looks as following:



Wednesday 15 October 2014

OSD600: Release 0.2 – Webmaker – issue#319

In project release 0.2, I would like to take the issue #319 in webmaker. And I already left a message on github to ask and am still waiting for the response. This issue is about the UI, making the line to align with the text in the homepage. It is a small bug and easy to fix. However, it will a good start for me to go through the whole project and get the ideas about how it works. Whenever I get confirmed, I will send the pull request to make my first contribution on a real open source project. 

I have been hesitating in taking bugs for a while. Inspired by David's article "Minimum Viable Product" in Oct. 8, I decide to start with small bugs. Taking a small bug makes me feel more confident on open source development. And I am willing to take more bugs. 

Also, there is another small bug (#315) I am interested in. After I am done with this, I am most likely to work on that if it’s still available.

Monday 6 October 2014

OSD600: Project for Release 0.2

Kate Hudson introduced Mobile Webmaker project in last Wednesday. It is a mobile application providing users the framework to create the mobile apps. In other words, it is a software being used to create software. She also showed some examples and gave the links of how to start. This is a cool project, which also have the clear information to start.

Moreover, I have some friend who are going to work on this project as well. Thus, I can discuss with them. And we may help each other although we work on different issues.

I need to look at the issues in detail and then decide which one to take. I will do so no later than this Wednesday, and will post which issue I would like to take.


SPO600: Lab3 - Loop in Assembly

In lab3, we were asked to write the assembly programs in both x86_64 and aarch64 to display number 0-29 in a loop.

This was my first assembly code. And it took me one night and 2 whole days to get them work. Now the loop is working to display the numbers. But I still have the problem for the newlines. My outputs do not have the newlines as I expect.  In other words, my output is on one line. I spent some time on this issue, but have not found the solution.

One frustrating thing in assembly is that different platform requires different syntax. The code I run in one platform without problems could not smoothly transform to the other platform. I still need to spend amount of time to recode it even though both programs have the same logic and same output.


Here is the code on X86_64 in GAS syntax.

 .text  
 .globl _start  
 start = 0  
 max = 30  
 _start:  
     mov  $start,%r15       /* starting value for the loop index*/  
 loop:  
     /*showing digit*/  
     mov   $'0',%r14  
     mov   $10,%r13  
     mov   $0,%rdx  
     mov   %r15,%rax  
     div   %r13  
     cmp   $0,%rax  
     je   singledigit  
     mov   %rax,%r13        /*store the second digit from right*/  
     add   %r14,%r13  
     mov   %r13,msg+5  
 singledigit:  
     mov   %rdx,%r12  
     add   %r14,%r12  
     mov   %r12,msg+6  
     /*showing loop in front of digit*/  
     mov   $len,%rdx  
     mov   $msg,%rsi  
     mov   $1,%rdi  
     mov   $1,%rax  
     syscall  
     inc   %r15              /* increment index*/  
     cmp   $max,%r15            /* see if we're done */  
     jne   loop              /* loop if we're not */  
     movq  $0,%rdi             /* exit status */  
     movq  $60,%rax            /* syscall sys_exit */  
     syscall  
 .data  
 msg:  .ascii   "loop:  '\n'"  
 .set len, . - msg  

And ARM assembly in aarch64:
 .text  
 .global _start  
 _start:  
     start = 0  
     max = 30  
     mov   x15,start        /*starting value for the loop index*/  
 loop:  
     mov   x28,0  
     mov   x27,10  
     adr   x12,msg         /*loading the message*/  
     udiv  x10,x15,x27       /*getting the quotient*/  
     msub  x9,x10,x27,x15     /*getting the reminder*/  
     cmp   x10,0          /*if quotient equals 0, then go to execute single digit*/  
     beq   singledigit  
     add   x14,x10,0x30      /*display quotient - second digit from right*/  
     str   x14,[x12,6]  
 singledigit:  
     add   x11,x9,0x30       /*display reminder - first digit from right*/  
     str   x11,[x12,7]  
     /*system call write*/  
     mov   x1,x12  
     mov   x2,len  
     mov   x0,1  
     mov   x8,64  
     svc   0  
     /*loop*/  
     add   x15,x15,1  
     cmp   x15,max  
     blt   loop  
     /*system exit*/  
     mov   x0,0  
     mov   x8,93  
     svc   0  
 .data  
 msg:  .ascii  "loop: ##\n\r"  
 len=  . - msg  

Through the practice in this lab, I got the basic idea how assembly works with memory and register, how to do the system call and how loop works.


In the end, I would like to ask if anyone has any good tutorials in assembly for beginners or suggestions, please comment it because I could not find one good for beginners. I highly appreciate.