NHERELYN MENDOZA CET 2 – 1

01-24-2012 Van Balicao

Example 1: The Hello World program: title Hello World program (hello.asm)

; This program displays "Hello world" .model small ; The '.' precedes assembler directives .stack 100h ; Allocate stack size .data HelloMess db 'Hello, World',13,10,'$' .code main proc mov ax, @data mov ds, ax ;Set DS to point to data segment mov ah, 9 ;Print string function mov dx, OFFSET HelloMess ;Point to "Hello World" int 21h ;Display "Hello World" mov ah, 4C00h ;Terminate program function int 21h ;Terminate the program main endp end main

.. The programmer's greeting . Message . Main program ROM_CALL(CLEARLCD) ld ld ld ld .. 0 ... wait for keypress .... GetLoop ret . ... get program's memory address ld DE.. String data Message: ...h" ..end .. 3 ..end program .. Mark the end of the file for TASM ...... (PROGRAM_ADDR) .asm . key pressed . world". string add HL...db "Hello". try again ......db "Hello.. 3 (CURSOR_COL).org 0 .. Hello. clear screen HL... ... Title of program . print the string GetLoop: call GET_KEY or A jr z.. 0 .... HL ld HL.MARK DAVE CERILLO CET 2 – 1 01-24-2012 . get difference between address of program....... add to get address of string ROM_CALL(D_ZT_STR) . DE . HL HL.... set text cursor position (CURSOR_ROW). if no key......... Include TI function definitions #include "TI-85..........

Sign up to vote on this title
UsefulNot useful