Thursday, 9 January 2014

TCP vs UDP

TCP
is analogous to telephone
- connection oriented

UDP
is analogous to passing a note from one computer to another computer.
- connectionless protocol
- maximum data size of individual sends is determined by the network

Question to choose between TCP or UDP
1. Require acknowledgement?
2. Sending big file(Such as image or sound file?)
3. Intermittent?





C / visual basic / COM and windows

Many the low-level function created using C.
All of the DLL in win32 API were implemented in C code

Visual basic tend to be windows only programming language.
Visual basic use different data types and differently store then C.

 Visual basic uses stdcall convention for implementing function call.

COM
Com takes object-oriented programming paradigm to the next level by using standard class.

Com client can be written in any language that support object oriented programming.


Tasks controlling hardware of PC

1. Sending beep to speaker
2. Ejecting CD/DVD-ROM

Wednesday, 8 January 2014

The simple computer model

cmp : compare a register to a value, raise a flag

section .data
store variable

section .bss
Used for reservation

section .text
Used for actual codes

Composer

1. Write your code using notepad
2. Save it as .asm file type
3.
Integer constant
- Leading sign (optional)
- One or more digit
- Radix (h, d, b, r, ...)

Integer expression
- Integer value and their arithmetic operation

Contoh: +, - , /, *

Constant expression
-

Real number constant
Real number constant = presented as decimal number constant
[sign]integer.[integer][exponent]
sign = {+,-}

Example:
+3.0
-44.2E+3

Character constant

String constant

Identifiers
A programmer chosen name.
Might identify a variable, constant, procedure, or a code label
Example:
_main
myVar


Directives
can define: variable, macros, and procedures
can assign name to memory segment
don't executed at run time

Example:
.data, .DATA, .
DWORD

Part 2:
.data
.code
.segment 100h

Instruction
- Label
- Mnemonic
- Operand
- Comment

Basic syntax:
[label:] mnemonic [operands][;comment]

Label
- code label
    Used as jump

Mnemonic
mov = move

Operand
Instruction can have zero operand, two operand, three operand, each of which can be a register, memory operand, constant expression, or input-output port.

Contoh:
96
2 + 4 constant expression
eax register
count memory