diff --git a/day_01/append_helloos.py b/day_01/append_helloos.py new file mode 100644 index 0000000..1cfca25 --- /dev/null +++ b/day_01/append_helloos.py @@ -0,0 +1,22 @@ +""" +This script is used to attach zero bytes to img file +REMENBER TO CHECK 0x01FF AND 0x1400 +""" + +def append_zeros_to_bin_file(file_path, target_size_hex): + target_size = int(target_size_hex, 16) # Convert hex size to decimal + with open(file_path, "ab") as file: # Open the file in append binary mode + file.seek(0, 2) # Go to the end of the file + current_size = file.tell() # Get the current size of the file + zeros_to_add = ( + target_size - current_size + ) # Calculate the number of zeros to add + + if zeros_to_add > 0: + file.write(b"\x00" * zeros_to_add) # Append the zeros + else: + print("File is already at or exceeds the target size.") + + +# Usage +append_zeros_to_bin_file("helloos.img", "0x168000") diff --git a/day_01/asm_result.png b/day_01/asm_result.png new file mode 100644 index 0000000..9148614 Binary files /dev/null and b/day_01/asm_result.png differ diff --git a/day_01/helloos.asm b/day_01/helloos.asm new file mode 100644 index 0000000..886732e --- /dev/null +++ b/day_01/helloos.asm @@ -0,0 +1,25 @@ +; Hello World Program in 16-bit Assembly +; This code is intended to run on a DOS system. + +.model small +.stack 100h + +.data +helloMessage db 'Hello, World!$' + +.code +start: + ; Initialize the data segment + mov ax, @data + mov ds, ax + + ; Display the message + mov ah, 09h ; AH = 09h for displaying a string in DOS + lea dx, helloMessage ; Load the address of the message into DX + int 21h ; Call DOS interrupt + + ; Terminate the program + mov ax, 4C00h ; Terminate program + int 21h + +end start diff --git a/day_01/helloos.img b/day_01/helloos.img new file mode 100644 index 0000000..cdf0659 Binary files /dev/null and b/day_01/helloos.img differ diff --git a/day_01/result.png b/day_01/result.png new file mode 100644 index 0000000..83380f4 Binary files /dev/null and b/day_01/result.png differ