1 ; org: all instructions from now on start in 7c00h
2 ; 7c00h is where the bios loads the 1st sector
3 ; assembler formatting:
7 ; at boot: real mode (like it's 8086)
8 ; we have to tell assembler that code is 16bit mode
14 ; service 0: set videomode ah
15 ; param: which video mode (13h: 320x200, 256 colors) al
16 ; ax: ah (high 8 bits), al (low)
20 ; software interrupt 10h
29 ; video ram is mapped in a0000
30 ; first 64000 bytes appear immediately on screen
31 ; mem addresses in real mode have 2 parts: segment and offset
32 ; bits overlap: segment is shifted by 4 and is added to the
33 ; overlapping offset (20 bits number = x86's addressable space = 1MB)
34 ; segment register for the segment: es, ds, cs, ss (and: fs, gs)
35 ; default register = ds (data segment), es = extra segment
36 ; cs = code segment cs:ip (it points where to read instructions and is
37 ; automatically set to 7c0 (7c00h)
38 ; offset can be paired with any register
47 ; dereferrence[] address
51 ; when cx is 0, 0 flag is set
55 ; assembler trick: write as many 0 needed to fill 510 bytes