Commit e1a431897164473f7027a7f7d91eaf41abe67fbf
1 parent
5a805765
--no commit message
Showing
4 changed files
with
26 additions
and
0 deletions
floppy.img
No preview for this file type
second_binary.asm
@@ -21,6 +21,27 @@ print_char: | @@ -21,6 +21,27 @@ print_char: | ||
21 | INT 0x10 ; Signal video interrupt to BIOS | 21 | INT 0x10 ; Signal video interrupt to BIOS |
22 | RETN | 22 | RETN |
23 | 23 | ||
24 | +execute_sector: | ||
25 | + PUSH ebp | ||
26 | + MOV ebp, esp | ||
27 | + PUSH ax | ||
28 | + PUSH bx | ||
29 | + PUSH cx | ||
30 | + PUSH dx | ||
31 | + MOV ax, [10 + ebp] ; base address | ||
32 | + MOV es, ax | ||
33 | + MOV al, [8 + ebp] ; num | ||
34 | + MOV cl, [6 + ebp] ; offset | ||
35 | + MOV ah, 2 ; Function read | ||
36 | + XOR ch, ch ; cylinder | ||
37 | + XOR dh, dh ; head | ||
38 | + MOV dl, 0x81 ; drive | ||
39 | + INT 0x13 | ||
40 | + XOR si, si | ||
41 | + PUSH es | ||
42 | + PUSH bx | ||
43 | + RETF | ||
44 | + | ||
24 | Start: | 45 | Start: |
25 | XOR ax, ax | 46 | XOR ax, ax |
26 | MOV ds, ax | 47 | MOV ds, ax |
@@ -30,6 +51,11 @@ XOR bx, bx | @@ -30,6 +51,11 @@ XOR bx, bx | ||
30 | for_start_0: | 51 | for_start_0: |
31 | MOV si, str | 52 | MOV si, str |
32 | CALL print_string | 53 | CALL print_string |
54 | + PUSH 0x7c0; Base address, offset is 0 | ||
55 | + PUSH 1 ; num | ||
56 | + PUSH 1 ; offset | ||
57 | + XOR bx, bx; | ||
58 | + ;CALL execute_sector | ||
33 | ;JMP for_start_0 | 59 | ;JMP for_start_0 |
34 | JMP $ | 60 | JMP $ |
35 | 61 |
second_binary.bin
No preview for this file type
usb.img
No preview for this file type