📄 boot.asm
字号:
;*******************************************************************
; Boot
; (c) Andre v.d. Merwe 4-Feb-1999
; <dart@pobox.com> <dart@iafrica.com>
; See "zen.txt" for copyright information
;
; Zen Source Library. Assembler example 3
; http://users.iafrica.com/d/da/dart/zen/zen.html
;-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-
;
; Compiler TASM
;
; This is a "bootable" application. Write it to track 0, sector 1
; on a removable disk (using bm.com). When loaded it reads a number
; of sectors from the disk and executes them. In other words it is
; a very simple OS loader.
;*******************************************************************
TITLE Boot
JUMPS
.model Tiny
;---------------------------------------------------------------------------------
.code
.286
org 7c00h ;7c00h = offset loaded to at bootup
;---------------------------------------------------------------------------------
start:
mov ah, 2 ;int 13 - 2
mov al, 2 ;Load 2 sectors (2 sectors = size of dump.com in bytes / 512)
mov bx, 100h ;Offset to load data to (Offset 100h is same as dos offset for COM files)
mov cx, 2000h ;Segment
mov es, cx
mov ch, 1 ;track
mov cl, 1 ;start sector
mov dh, 0 ;head
mov dl, 0 ;drive
int 13h
jnc Sector1Loaded
mov ah, 03h
mov al, '*'
int 10h
mov ah, 0
int 16h
Sector1Loaded:
Go_Location: ;Far jump to 2000:0100 (where data was loaded to)
db 0eah
Location_Offset dw 100h
Location_Segment dw 2000h
halt:
jmp halt
;---------------------------------------------------------------------------------
;---------------------------------------------------------------------------------
.data
;---------------------------------------------------------------------------------
db 446 dup(0)
db 055h, 0AAh ; boot id
;---------------------------------------------------------------------------------
end start
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -