⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 boot.asm

📁 写了一个很简单的内核!只是在屏幕上打印“hello,world”但分析此代码
💻 ASM
字号:
; BOOT.ASM : By Vivek Mohan
; =========================
;
; tasm	boot.asm
; tlink /x /3 boot.obj

 _Text SEGMENT PUBLIC USE16
  assume CS:_Text, DS:_Text
  org 0

; This is the entry point for the program

Entry:
  db   0EAh  ; jmp far SEG:OFS  ; Currently we are at 0:7C00
  dw  OFFSET AfterData, 7C0h    ; This makes us be at 7C0:0

 ; Our Message to the world
 ; ========================

 HelloWorld db "Hello World !!",0 ;

 AfterData: 
   push CS
   pop  DS     ; update DS to be 7C0 instead of 0

 ; Display Hello World
 ; ===================

  mov si , OFFSET HelloWorld 
  do:
  mov AL, DS:[SI]
  inc SI
  or AL, AL
  jz done;
  mov BX, 0
  mov AH, 0Eh
  int 10h
  jmp do;
  done  : ;

 ; OK We have displayed the message
 ; ================================

  jmp $    ;

 ; Hang the system
 ; ===============

 ; Make the file 512 bytes long
 ; ============================
 org 510    
 
 ; Add the boot signature
 ; ======================

 dw 0AA55h  

  _Text ENDS
  END

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -