הנה:
נתחיל בקוד:
[BITS 16] [ORG 0100h] START: mov DX, WORD 230Fh ;We're going to line 35, column 15 call GotoXY mov DX, RandomMsg mov CX, 12h ;Message length is 18 chars, that's 12 in hex call Write mov AX, WORD 4C00h ;Function 4C: Quit to DOS, Errorlevel 00 int 21h ;Call DOS interrupt ;---------------------------------- ; GotoXY ; ------ ; Arguments: ; In DL: X (column) to go to (0-79) ; In DH: Y (line) to go to (0-24) ; Alters: AX,BX ; Action: Positions cursor at (X,Y) ;---------------------------------- GotoXY: mov AH,02h ;BIOS VIDEO service 2: Position Cursor mov BH,0 ;Text display page 0 int 10h ;Call BIOS VIDEO ret ;-------------------------------------- ;Write ;----- ;Arguments: ;In DX: Pointer to string to be written ;In CX: Length of string to be written ;Alters: AX,BX ;Action: Prints a string ;-------------------------------------- Write: mov BX,1 ;Print to stdout mov AH,40h ;Service 40h, Print String int 21h ;Call DOS interrupt ret [SECTION .data] RandomMsg db "This is a message."
איסמבלתי (פועל חדש, בניין פיעל) את זה תחת נזם. הרצתי את זה בווינדוס 2000 פרופשיונל: Start->Run->cmd Alt+Enter MyProggie.com