-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathclear.asm
27 lines (17 loc) · 1.05 KB
/
clear.asm
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
;==========================
; CLEAR COMMAND
;==========================
[bits 16] ; tell NASM to assemble 16-bit code
[org 0x7c00] ; tell NASM the code is running at 0x0000_8000 address (shell)
%define SHELL_SEGMENT 0x800 ; executable file bytes typed from hex editor
mov ax, 0 ; set ACCUMULATOR REGISTER to 0
mov ds, ax ; set DATA SEGMENT to 0
mov es, ax ; set EXTRA SEGMENT to 0
mov ss, ax ; set STACK SEGMENT to 0
mov bp, 0x7c00 ; set STACK BASE to 0x0000_7c00
mov sp, bp ; set STACK POINTER to 0x0000_7c00
mov ah, 0x00 ; BIOS code to set video mode
mov al, 0x03 ; 80 x 25 text mode
int 0x10 ; set video mode
jmp SHELL_SEGMENT:0x0000 ; execute code at 0x0000_0500!
times 512 - ($ - $$) db 0 ; fill trailing zeros to get exactly 512 bytes long binary file