P. 1
cao_2nd_lab

cao_2nd_lab

|Views: 6|Likes:
Published by Waqar Ahmed

More info:

Published by: Waqar Ahmed on Mar 25, 2011
Copyright:Attribution Non-commercial

Availability:

Read on Scribd mobile: iPhone, iPad and Android.
download as TXT, PDF, TXT or read online from Scribd
See more
See less

03/25/2011

pdf

text

original

org 100h MOV AH, MOV AL, INT 10h MOV AL, INT 10h MOV AL, INT 10h MOV AL, INT 10h

MOV AL, INT 10h MOV AL, INT 10h ret

0Eh 'H' 'e' 'l' 'l' 'o' '!'

; ; ; ; ; ; ; ; ; ; ; ; ;

select sub-function. ASCII code: 72 print it! ASCII code: 101 print it! ASCII code: 108 print it! ASCII code: 108 print it! ASCII code: 111 print it! ASCII code: 33 print it!

org 100h MOV AX, 0B800h MOV DS, AX MOV [2E8h], 'A' MOV [2EAh], 'l' MOV [2ECh], 'i' MOV [2EEh], 'm' MOV [2F4h], 'H' MOV [2F6h], 'a' MOV [2F8h], 's' MOV [2FAh], 'a' MOV [2FCh], 'n' ;---------MOV [338h], '2' MOV [33Ah], '2' MOV [33Ch], '3' MOV [33Eh], '1' ;---------MOV [388h], 'K' MOV [38Ah], 'I' MOV [38Ch], 'E' MOV [38Eh], 'T' ret

offset above_5 print: mov ah. "$" db " is below five!" . '5' jb below ja above mov dx.org 100h game: mov dx. 1 int 21h cmp al.0Ah. offset msg1 mov ah. offset equal_5 jmp print below: mov dx. offset below_5 jmp print above: mov dx. 0Dh. "$" . stop msg1 db equal_5 below_5 above_5 "enter a number or any other character to exit: $" db " is five! (equal)". 0Dh. read character in al: mov ah. "$" db " is above five!" . loop. '9' ja stop cmp al. '0' jb stop cmp al. 0Dh. stop: ret .0Ah.0Ah. 9 int 21h . 9 int 21h jmp game .

You're Reading a Free Preview

Download
scribd
/*********** DO NOT ALTER ANYTHING BELOW THIS LINE ! ************/ var s_code=s.t();if(s_code)document.write(s_code)//-->