基础代码
来源:互联网 发布:excel表格数据 编辑:程序博客网 时间:2024/06/05 20:26
; Turbo Assembler Copyright (c) 1988, 1991 By Borland International, Inc.
; HELLO2.ASM - Editted version of HELLO.ASM.
; Display greeting after accepting input.
; From the Turbo Assembler Users Guide - Getting started
DOSSEG
.MODEL SMALL
.STACK 100h
.DATA
TimePrompt DB 'Is it after 12 noon (Y/N)?$'
GoodMorningMessage LABEL BYTE
DB 13,10,'Good morning, world!',13,10,'$'
GoodAfternoonMessage LABEL BYTE
DB 13,10,'Good afternoon, world!',13,10,'$'
.CODE
MOV AX,@data
MOV DS,AX ;set DS to point to the data segment
MOV DX,OFFSET TimePrompt ;point to the time prompt
MOV AH,9 ;DOS print string function #
INT 21h ;display the time prompt
MOV AH,1 ;DOS get character function #
INT 21h ;get a single-character response
CMP AL,'y' ;typed lowercase y for after noon?
JZ IsAfternoon ;yes, it's after noon
CMP AL,'Y' ;typed uppercase Y for after noon?
JNZ IsMorning ;no, it's before noon
IsAfternoon:
MOV DX,OFFSET GoodAfternoonMessage ;point to the afternoon greeting
JMP DisplayGreeting
IsMorning:
MOV DX,OFFSET GoodMorningMessage ;point to the before noon greeting
DisplayGreeting:
MOV AH,9 ;DOS print string function #
INT 21h ;display the appropriate greeting
MOV AH,4ch ;DOS terminate program function #
INT 21h ;terminate the program
END
- 基础代码
- 基础代码
- 基础代码
- 基础代码
- 基础代码
- 想用就用,VB基础代码
- JavaScipt基础代码
- 想用就用,VB基础代码
- pb基础公用代码
- QTP的基础代码
- jstl基础代码
- wxpython 基础代码-1
- php基础语法 代码
- RDLC基础代码
- 常用IPHONE 基础代码
- asp.net基础代码
- 通用基础CSS代码
- 数据结构基础(代码)
- 如何将Oracle10g数据导入到9i
- sql2000数据库安全:
- Debian下配置APACHE2+MYSQL5+PHP5
- GDI+与GDI屏幕抓图比较
- oasis文件中的数据类型
- 基础代码
- 循环队列操作实现
- Struts2的HelloWorld程序
- test
- makefile变量使用及其条件判断
- 多线程同步之 CriticalSection(临界区)
- 朝觐华为
- 疯狂地学习C语言
- SHENGHUO