Hello, tomdkat.
Thanks for the response.
Here si the code for the program:
Code:
; AUTHOR: RKC
; CLASS: CS241
; DUE DATE: January 23, 2008
; DESCRIPTION: This is a simple program which will demonstrate the creation, assembling, linking, and execution of a basic
; assembly language program.
.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 afternoon?
jz IsAfternoon ;yes, it's after noon
cmp al,'Y' ;typed uppercase Y for afternoon?
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 ;this line is a must in every assembly language program
Here are the errors which I receive from gas:
Code:
Lab1.asm: Assembler messages:
Lab1.asm:1: Error: no such instruction: `RKC'
Lab1.asm:2: Error: no such instruction: `cs241'
Lab1.asm:3: Error: no such instruction: `due DATE:January 23,2008'
Lab1.asm:4: Error: no such instruction: `this is a simple program which will demonstrate the creation,assembling,linking,and execution of a basic'
Lab1.asm:5: Error: no such instruction: `assembly language program.'
Lab1.asm:6: Error: unknown pseudo-op: `.model'
Lab1.asm:7: Error: unknown pseudo-op: `.stack'
Lab1.asm:10: Error: no such instruction: `timeprompt DB 73s it after 12 noon?(Y/N)?$10GoodMorningMessage LABEL BYTE'
Lab1.asm:11: Error: no such instruction: `db 13,10,71ood morning,world!4413,10,36'
Lab1.asm:12: Error: no such instruction: `goodafternoonmessage LABEL BYTE'
Lab1.asm:13: Error: no such instruction: `db 13,10,71ood afternoon,world!4413,10,36'
Lab1.asm:15: Error: unknown pseudo-op: `.code'
Lab1.asm:16: Error: invalid char '@' beginning operand 2 `@data'
Lab1.asm:17: Error: too many memory references for `mov'
Lab1.asm:17: Error: no such instruction: `set DS to point to the data segment'
Lab1.asm:19: Error: too many memory references for `mov'
Lab1.asm:19: Error: no such instruction: `point to the time prompt'
Lab1.asm:20: Error: too many memory references for `mov'
Lab1.asm:20: Error: no such instruction: `dos print string function'
Lab1.asm:21: Error: junk `h' after expression
Lab1.asm:21: Error: suffix or operands invalid for `int'
Lab1.asm:21: Error: no such instruction: `display the time prompt'
Lab1.asm:23: Error: too many memory references for `mov'
Lab1.asm:23: Error: no such instruction: `dos get character function'
Lab1.asm:24: Error: junk `h' after expression
Lab1.asm:24: Error: suffix or operands invalid for `int'
Lab1.asm:24: Error: no such instruction: `get a single-character response'
Lab1.asm:26: Error: too many memory references for `cmp'
Lab1.asm:26: Error: no such instruction: `typed lowercase y for afternoon?'
Lab1.asm:27: Error: no such instruction: `yes, it115after noon'
Lab1.asm:29: Error: too many memory references for `cmp'
Lab1.asm:29: Error: no such instruction: `typed uppercase Y for afternoon?'
Lab1.asm:30: Error: no such instruction: `no, it115before noon'
Lab1.asm:33: Error: too many memory references for `mov'
Lab1.asm:33: Error: no such instruction: `point to the afternoon greeting'
Lab1.asm:37: Error: too many memory references for `mov'
Lab1.asm:37: Error: no such instruction: `point to the before noon greeting'
Lab1.asm:40: Error: too many memory references for `mov'
Lab1.asm:40: Error: no such instruction: `dos print string function'
Lab1.asm:41: Error: junk `h' after expression
Lab1.asm:41: Error: suffix or operands invalid for `int'
Lab1.asm:41: Error: no such instruction: `display the appropriate greeting'
Lab1.asm:43: Error: too many memory references for `mov'
Lab1.asm:43: Error: no such instruction: `dos terminate program function'
Lab1.asm:44: Error: junk `h' after expression
Lab1.asm:44: Error: suffix or operands invalid for `int'
Lab1.asm:44: Error: no such instruction: `terminate the program'
Lab1.asm:46: Error: no such instruction: `end'
Lab1.asm:46: Error: no such instruction: `this line is a must in every assembly language program'
I used Gedit to write the rpogram. Should I use something else? I see it's not recognizing comments (

.
Thanks again.
Take care.