multisection.asm
来自「开源的nasm编译器源码,研究编译器原理很有帮且」· 汇编 代码 · 共 87 行
ASM
87 行
; To test where code that is placed before any explicit SECTION; gets placed, and what happens if a .text section has an ORG;statement, uncomment the following lines.;; times 10h nop;;section .text;org 0x300; times 20h inc ax; let's see which of these sections can be placed in the specified order.section .appspecificsection .datasection .stringdatasection .mytextsection .codesection .extra_codesection .stringdatamystr1: db "Hello, this is string 1", 13, 10, '$'section .extra_codeorg 0x200bits 16more: mov si, asciz1 mov ah, 0x0E xor bx, bx.print: lodsb test al, al jz .end int 0x10 jmp short .print.end: xor ax, ax int 0x16 mov ax, 0x4c00 int 0x21section .appspecificasciz1: db "This is string 2", 0section .codeorg 0x100bits 16start: mov dx, mystr1 mov ah, 9 int 0x21 xor ax, ax int 0x16 jmp moresection .text xor eax,eax times 50h nopsection .mytext xor ebx,ebxsection .data db 95h,95h,95h,95h,95h,95h,95h,95hsection .hmm resd 2section .bss resd 8section .final1 inc axsection .final2 inc bxsection .final3 inc cx
⌨️ 快捷键说明
复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?