Professional Documents
Culture Documents
[ORG 0]
; Data offset = 0
jmp START
;============================== Data
==================================================
welcomeMessage
db 'About Me:',13,10
db 'Shadi Elwan',13,10
db 'Thebes Academy',13,10
db 'Computer Science - Level 3',13,10,13,10,0
rebootMessage
;============================== Data
==================================================
;
=======================================================
===============================
;============================== Functions
==============================================
ShowMessage:
mov al,[si]
cmp al,0
;If al register equals 0 that means we reache the end of the String
and set "Zero Flag" to 1
jz EndFunction ;if "Zero Flag" equals 1 then go to EndFunction
mov ah,0eh
int 0x10
inc si
jmp ShowMessage
EndFunction:
ret
;
=======================================================
================================
START:
;
=======================================================
================================
mov ax,0x7c0
mov ds,ax
;
=======================================================
================================
mov si,rebootMessage
call ShowMessage
;then reboot!
JMP 0FFFFh:0000h
;========================= Our Real program ends here
==========================
;
=======================================================
================================
times 510-($-$$) db 0
dw 0xAA55
;Fill The file with 0's untill its size reaches 510 bytes
;
=======================================================
================================
End of Code
irst I use nasm tool to compile the code to plain binary file