User Name Password Register
DaniWeb IT Discussion Community
All
What is DaniWeb IT Discussion Community?
You're currently browsing the Assembly section within the Software Development category of DaniWeb, a massive community of 402,049 software developers, web developers, Internet marketers, and tech gurus who are all enthusiastic about making contacts, networking, and learning from each other. In fact, there are 2,479 IT professionals currently interacting right now! Registration is free, only takes a minute and lets you enjoy all of the interactive features of the site.
Please support our Assembly advertiser: Programming Forums
Views: 356 | Replies: 0 | Solved
Reply
Join Date: Jul 2006
Posts: 70
Reputation: SHWOO is an unknown quantity at this point 
Rep Power: 3
Solved Threads: 0
SHWOO SHWOO is offline Offline
Junior Poster in Training

Simple Macro Question

  #1  
Jul 19th, 2008
Why isn't the mReadkey macro outputting the string "Please enter...." ?

TITLE MASM Template						(main.asm)

; Program: Chapter 10 Problem 1-5
; Author: Jon Wayman
; Created Date: July 17th,2008
; Revision date:

INCLUDE Irvine32.inc
INCLUDE Macros.inc

;-------------------------------
mReadkey MACRO
;
; This macro asks user to press any key
; and it will store the ASCII and scan codes.

	mWriteLn "Please enter a key to output its ASCII & keyboard code: "

	mov	eax,10
	call Delay
	call Readkey

	ENDM
;-------------------------------

.data
ascii BYTE ?
scan BYTE ?
.code

mReadkey

main PROC


	exit
main ENDP

	; (insert addiitonal procedures here)
END main


mWriteLn & mWrite implementation
;------------------------------------------------------
mWrite MACRO text:REQ
;
; Writes a string literal to standard output.
; Receives: a string enclosed in single or double 
;   quotes (null terminator not required).
;------------------------------------------------------
LOCAL string
	.data		;; local data
	string BYTE text,0	;; define the string
	.code
	push	edx
	mov	edx,OFFSET string
	call	WriteString
	pop	edx
ENDM

;------------------------------------------------------
mWriteLn MACRO text:REQ
;
; Writes a string literal to standard output, followined by Crlf
; Receives: a string enclosed in single or double 
;   quotes (null terminator not required).
; DEPRECATED in the Fifth edition.
;------------------------------------------------------
	mWrite text
	call	Crlf
ENDM
Climbing the learning curve of C++
Becoming an expert seems light years away!
AddThis Social Bookmark Button
Reply With Quote  
Reply

Only community members can participate in forum threads. You must register or log in to contribute.

DaniWeb Assembly Marketplace
Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)

 

Thread Tools Display Modes

Similar Threads
Other Threads in the Assembly Forum

All times are GMT -4. The time now is 11:46 pm.
Forum system based on vBulletin Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.
©2003 - 2008 DaniWeb® LLC