; ONEPAGE.ASM ; ; This is a one-page, one-segment Intel assembler program in ".COM" form. ; Copy ONEPAGE.ASM to your disk and then assemble it to produce a ; ONEPAGE.OBJ file. Then link ONEPAGE.OBJ to produce a ONEPAGE.COM file. ; Use these command lines (note the trailing semicolon on each): ; ; C:> asm /s onepage ; ; C:> val /co onepage ; ; ; - Using a semicolon as an argument suppresses all the prompts ; for output files and uses the defaults. (See the documentation.) ; - The /s option to ASM suppresses unnecessary verbosity. ; - The /co option to VAL creates a ".COM" file (instead of a ".EXE") ; ; The comments in this file are intended to teach students about the ; meaning of various assembler instructions. They are NOT suitable ; for students documenting their own code, since they do not refer to ; any process or problem being solved. ; ; Students: Do NOT copy these teacher-style comments into your own code. ; ; -IAN! idallen@ncf.ca November 1999, 2000 ; OneP segment ; label matches "OneP ends" below assume CS:OneP,DS:OneP ; tell the assember what will be in CS and DS org 100h ; .COM format executable requires this start: mov dx,offset msg ; offset address of the message text mov ah,09h ; use code for "display ASCII$ string" int 21h ; Note: don't forget the 'h' on 21h! mov al,0h ; load a successful return status mov ah,4Ch ; use code for "terminate program" int 21h ; remember the 'h' ! msg db "This is my first Intel Assembler program." ; define bytes db 0Dh,0Ah ; Hex codes for CR, LF (note the 'h') db "$" ; marks the end of ASCII$ string OneP ends ; label matches "OneP segment" above end start ; "start" is the label on the first instruction