设置内存,首先需要获取内存大小。 ; Use int 15h to find out size of extended memory in KB. ; Extended memory is the memory above 1MB. So by ; adding 1MB to this amount, we get the total amount ; of system memory. We can only detect 64MB this way, ; but that's OK for now. mov ah, 0x88 int 0x15 add ax, 1024 ; 1024 KB == 1 MB mov [mem_size_kbytes], ax 该参数传递给内核。