Wednesday, 18 March 2015

In assembly, everything is just direct access
instructions and the port table, with the words found there anything can be constructed, all in the datasheet of the processor
How the timer is started (is writing "Timer.Start(8)" somehow easier to understand than "LDI R16,0x02" and OUT TCCRO, R16")
how the timer restarted at zero ("CLR R16" and "OUT TCCR0, R16")

Four basic programs are necessary for assembly programming. These tools are:
1. The editor: Windows notepad. Tips change to Courier.
All you have to do is open a notepad, type, and save 
2. The assembler program, program that reads the text file and produces some kind of output files is calles assembler. NASM
3. The chip programming interface
4. The simulator:

The structure of an assembler program.
1. Comments.
A comments start with a semi-colon.
Put comments around all parts of the program, be it complete subroutine or a table.
2. header informations
3. code at program start, and
4. general structure of programs


The purpose of this tutorial is: How to read two user input and add it and print it to the display.

The main program always start with initialization of the stack pointer, setting registers to default values, and the init of the hardware components used.

PORTS
Ports have a fixed address

Tuesday, 17 March 2015

Kernels are just a code.

Learn variety of interupt and registers.

Directive, instruction, labels

Function (this just an excerpt)
1. Register set
1.1 Register set to a constant
1.2 Register set to 0
1.3 Register set to 255

2. Copy
2.1 Copy register to register
2.2 Copy SRAM to register, directly
2.3 SRAM register
2.4 SRAM to register and INC
2.5 DEC, SRAM to register
2.6 SRAM, displaced to register
2.7 Port to Register
2.8 Stack to register
2.9 etc...

3. Add
3.1 Add 8 bit + 1
3.2 Add 8 bit, for example: add r1, r2
3.3 8 bit + carry
3.4 etc...

4. Substract
4.1 8 bit -1, for example: DEC r1
4.2 8 bit, for example: SUB r1, r2
4.3 8 bit, constant, SUBI rh, c255
4.4 etc

5 Shift
5.1 Shift logic left
5.2 Shift logic right

6. Binary
6.1 Binary And, for example: AND r1, r2
6.2 Binary Or, for example OR r1, r2
6.3 Binary Exclusive-OR, for example: EOR r1, r2
6.4 Ones-complement, for example: COM r1
6.5 Twos-complement: NEG r1

7. Bits change
7.1 Register, set
7.2 Register, clear

8. Status bit set
8.1 Zero flag
8.2 Carry flag
8.3 Negative flag

9. Status bit clear
9.1 Zero f

10. Compare
10.1 Compare register to register, for example: CP r1, r2
10.2 Register, Register + carry, for example: CPC r1, r2

11. Immediate jump
11.1 Relative
11.2

12. Conditional jump
12. Jump if status bit set
12.2 Jump if status bit clear, for example: BRBC b7, c127
12.3 Jump if equal, for example: BREQ c127

13. Conditioned jump
13.1 Register bit = 0, for example: SBRC r1, b7

14. Others
14.1 NOP = no operation
14.2 Sleep = Sleep
14.3 Watchdog reset = WDR




Pseudocode to solve total resistance count function

For instance:
R1, (R2 // R3)

1. Solve the paralel first with formula:
1/Rt = (R2 x R3) / (R3 + R3)
2. Find Rt = 1/...
3. And then add to R1
4. End
 
1. First law: inertia
Sebuah bola kasti yang dilemparkan secara garis lurus di atmosfir bumi / di luar angkasa ke arah matahari, akan terus bergerak dengan kecepatan konstan jika tidak ada force yang mengungguli / force yang melebih force yang melempar bola kasti tersebut.

A moving object will continue moving in a straight line at a constant speed, and a stationery object will remain at rest, unless acted upon by an unbalanced force.

2. Second law: the "F=m x a"
The acceleration produced by a force on an object is proportional to the magnitude of the force, and inversely proportional to the mass of the object.

3. Third law: For every action there is an equal and opposite reaction.
 


Properti fisika

Mass/Thing/Benda
- Center of mass
- Dimension of the mass
- Berat jenis of the mass
- Volume of the mass
- Kelenturan of the mass
- Berat of the mass


Water(air)
- freezing point

Science

Pada mulanya manusia hanya mengenal penggaris dan jam pasir.

Kemudian manusia curios, dia menjatuhkan sebuah benda dari ketinggian:
jika h = 10m, maka t = 10 detik
h = 10 ->  t = 10 detik
h = 5 m -> t = bukan 10/2

manusia kira bahwa waktu akan menjadi setengah dari waktu ketika ketinggian 10 meter ternyata tidak, manusia terkejut. Mereka berfikir kecepatan akan konstan ternyata tidak. Ternyata ada suatu variabel yang mereka belum pahami saat itu.

Monday, 16 March 2015

OS Dev

1. Download BOSCH bosch.sourceforge.net
2. Download virtual floppy drive pada vfd.sourceforge.net
3. Download NASM pada www.nasm.us

1. Install BOSCH.
2. Copy ZIP files ke folder OS Dev kamu.
3. Install NASM .
4. Copy nasm.exe dan nasmpath.exe ke folder OS Dev kamu.

5. Tulis kedalam notepad boschsrc simpan ke folder programfiles BOSCH kamu. Kalau punya saya ada di: 
C:\Program Files (x86)\Bochs-2.6.5