Skip to main content

Posts

Showing posts from August, 2023

62 commands in Ubuntu

1. **ifconfig**: Display network interface information.    Example: `ifconfig` 2. **ip addr**: Show IP addresses of network interfaces.    Example: `ip addr show` 3. **ip route**: Display routing table information.    Example: `ip route show` 4. **ping**: Test network connectivity.    Example: `ping google.com` 5. **traceroute**: Trace the route to a destination.    Example: `traceroute google.com` 6. **netstat**: Display network statistics and connections.    Example: `netstat -an` 7. **ss**: Display socket statistics.    Example: `ss -tuln` 8. **nslookup**: Perform DNS lookups.    Example: `nslookup google.com` 9. **dig**: Another DNS lookup utility.    Example: `dig google.com` 10. **route**: Manage the IP routing table.     Example: `route -n` 11. **wget**: Download files from the web.     Example: `wget https://example.com/file.txt` 12. **curl**: Transfer data to/from a ser...

Program 10: Matrix Multiplication

     ** Program 10: Matrix Multiplication ** ```assembly .model small .stack 100h .data     matrix1 dw 1, 2, 3, 4     matrix2 dw 5, 6, 7, 8     result dw 0, 0, 0, 0 .code     main proc         mov ax, 0              ; Initialize AX to 0              outer_loop:         mov cx, 2              ; Set loop counter for rows              inner_loop:         mov bx, ax             ; Copy AX to BX (row index)         add bx, cx             ; Add CX to BX (row index + column index)                  mov dx, 0              ; Initialize DX (column index)        ...

Program 9: Bubble Sort

  **Program 9: Bubble Sort** ```assembly .model small .stack 100h .data     array db 5, 2, 8, 3, 1     n db 5 .code     main proc         mov bx, n             ; Load 'n' into BX         dec bx                ; Decrement BX for loop              outer_loop:         mov si, 0             ; Initialize SI for inner loop              inner_loop:         mov al, [array + si]  ; Load array element at index SI         cmp al, [array + si + 1] ; Compare with next element        ...

Program 8: Linear Search

 **Program 8: Linear Search** ```assembly .model small .stack 100h .data     array db 10, 20, 30, 40, 50     search_value db 30     found db 0 .code     main proc         mov si, 0           ; Initialize index register SI         mov al, search_value ; Load the search value into AL         mov cx, 5           ; Set the loop counter              search_loop:         cmp al, [array + si] ; Compare AL with array element         je found_element     ; Jump if equal (found)         inc si               ; Increment index         loop search_loop     ; Decrement counter and loop if not zero                ...

Program 7: Fibonacci Series

  **Program 7: Fibonacci Series** ```assembly .model small .stack 100h .data     count dw 10     fib1 dw 0     fib2 dw 1     result dw ? .code     main proc         mov cx, count       ; Load 'count' into CX              fib_loop:         add result, fib1    ; Add fib1 to result         mov ax, fib1        ; Swap fib1 and fib2         mov fib1, fib2         mov fib2, ax         loop fib_loop       ; Decrement CX and loop if not zero                  mo...

Program 6: Finding Prime Numbers in a Range

  ** Program 6: Finding Prime Numbers in a Range ** ```assembly .model small .stack 100h .data     start dw 1     end dw 20 .code     main proc         mov ax, start           ; Load 'start' into AX              find_primes:         inc ax                  ; Move to the next number         cmp ax, end             ; Compare with 'end'         jg end_prog             ; Jump to end if AX > 'end'                  mov cx, ax              ; Copy AX to CX   ...

Program 5: Counting Digits in a Number

  **Program 5: Counting Digits in a Number** ```assembly .model small .stack 100h .data     num dw 12345     count db 0 .code     main proc         mov ax, num           ; Load the number into AX         mov bx, 10             ; Divisor for digits              count_digits:         xor dx, dx             ; Clear DX for division         div bx                 ; Divide AX by BX         inc count              ; Increment digit count         test...