Other Programming Languages
 
Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
User Name:
Password:
Remember me
Go Back   Dev Shed ForumsProgramming Languages - MoreOther Programming Languages

Reply
Add This Thread To:
  Del.icio.us   Digg   Google   Spurl   Blink   Furl   Simpy   Y! MyWeb 
Thread Tools Search this Thread Rate Thread Display Modes
 
Unread Dev Shed Forums Sponsor:
Be the architects of evolution and help create the mobile internet future. It’s your move---enter to win here!
  #1  
Old January 31st, 2007, 12:06 PM
cartermdk cartermdk is offline
Registered User
Dev Shed Newbie (0 - 499 posts)
 
Join Date: Dec 2006
Posts: 5 cartermdk User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: 1 h 10 m 59 sec
Reputation Power: 0
Assembly outdec help

If anyone has any knowledge of 8086 assembly,can you please help with a quick question

The below Prints A - Z(conditional loop)putting a space between letter so it will look like A B C D E F G when printed..



Code:

;Prints out all characters from A TO Z with a Space between each letter



title program test5.asm
.model small
.stack 100h
.data

			char1 db 0  	; declared variable
			
.code
			mov ah ,02h     ;
			mov dl, 'A'     ;print out A
			int 21h		;


again:

			mov char1,dl  ;save what's in dl to variable
			
  			
			mov ah,02     ;
			mov dl,20h    ;print a space
			
			int 21h	      ;

			mov dl,char1  ;restore

			cmp dl,'Z'    ;compares whats in dl(A) with Z
			je outof      ;

			add dl,1      ;
			int 21h       ;
			jmp again

outof:

			mov ax,4C00h  ;
			int 21h	      ;

end
			


what I'm trying to do now is print off A - Z but display each letters corresponding ASCII value..for example

A 65
B 66
C 67
D 68

I've know I need to use outdec to print the letters decimal..but I dont know how to get whats in dl, 'A' to outdec?

(ps)im using tasm
and sorry if this is the wrong type of post for this section....

Reply With Quote
  #2  
Old January 31st, 2007, 12:46 PM
Scorpions4ever's Avatar
Scorpions4ever Scorpions4ever is offline
Banned ;)
Dev Shed God 5th Plane (7000 - 7499 posts)
 
Join Date: Nov 2001
Location: Glendale, Los Angeles County, California, USA
Posts: 7,442 Scorpions4ever User rank is Major General (70000 - 90000 Reputation Level)Scorpions4ever User rank is Major General (70000 - 90000 Reputation Level)Scorpions4ever User rank is Major General (70000 - 90000 Reputation Level)Scorpions4ever User rank is Major General (70000 - 90000 Reputation Level)Scorpions4ever User rank is Major General (70000 - 90000 Reputation Level)Scorpions4ever User rank is Major General (70000 - 90000 Reputation Level)Scorpions4ever User rank is Major General (70000 - 90000 Reputation Level)Scorpions4ever User rank is Major General (70000 - 90000 Reputation Level)Scorpions4ever User rank is Major General (70000 - 90000 Reputation Level)Scorpions4ever User rank is Major General (70000 - 90000 Reputation Level)Scorpions4ever User rank is Major General (70000 - 90000 Reputation Level)Scorpions4ever User rank is Major General (70000 - 90000 Reputation Level)Scorpions4ever User rank is Major General (70000 - 90000 Reputation Level)Scorpions4ever User rank is Major General (70000 - 90000 Reputation Level) 
Time spent in forums: 1 Month 1 h 58 m 35 sec
Reputation Power: 797
Thread moved. Best of luck to you.
__________________
Up the Irons
What Would Jimi Do? Smash amps. Burn guitar. Take the groupies home.
"Death Before Dishonour, my Friends!!" - Bruce D ickinson, Iron Maiden Aug 20, 2005 @ OzzFest
Down with Sharon Osbourne

Puzzle of the Month solved by sizeablegrin, etienne141 and L7Sqr, superior C/C++ programmers of the month

Reply With Quote
  #3  
Old February 11th, 2007, 05:38 AM
jella_flores jella_flores is offline
Registered User
Dev Shed Newbie (0 - 499 posts)
 
Join Date: Feb 2007
Posts: 2 jella_flores User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: 58 m 18 sec
Reputation Power: 0
Quote:
Originally Posted by Scorpions4ever
Thread moved. Best of luck to you.


i am just starting into assembly programming, i am currently trying to trace a program step by step to determine a value of a certain register for the particular line but unfortunately, i dont understand how it goes...

i am working on this code i found from somewhere, it says that it will display a message only if correct password is entered by a user...

my concerns arre as follows:
the code is uncommented,and it is very hard for me to trace it(each line's registers value,and of course to find out the password) as i want since i honestly dont understand yet...i want to learn but how can i go on if there is no one to lead on and show me some samples?i hope you all guys understand my situation..thank so much...and please do help me by commenting each line of the code below.i'll appreciate greatly if you'll do..of course,thank you so much for the time.more power!
------------------------------------------------------------------
.MODEL TINY
.CODE
ORG 100H
START:
JMP BEGIN
DATA1 DB 0A3H, 0A1H, 8FH, 0E9H, 8CH, 0ABH, 0DAH, 0A9H
DB 95H, 0BAH, 0DAH, 0A7H, 8EH, 0EEH, 88H, 0A7H
DATA2 DB 9DH, 0A6H, 8EH, 0EFH, 0DBH, 0EFH, 0DAH, 87H
DB 0DAH, 0A6H, 95H, 0BEH, 9FH, 0EEH, 83H, 0A1H
DATA3 DB 8FH, 0E9H, 96H, 0A2H, 0DAH, 0BEH, 9BH, 0BDH
DB 89H, 0EEH, 8EH, 0A6H, 9FH, 0EEH, 8EH, 0ABH
DATA4 DB 99H, 0A6H, 94H, 0A7H, 99H, 0AFH, 96H, 0EEH
DB 9FH, 0B6H, 9BH, 0A3H, 0D4H, 0E0H, 0D4H, 0EAH
DATA5 DB 15 DUP(24H)
DATA6 DB "Enter the password: $"
DATA7 DB "Don't push it...exciting...$"
BEGIN:
LEA DX, DATA6
MOV AH, 9
INT 21H
XOR SI, SI
INPUT:
MOV AH, 1
INT 21H
CMP AL, 0DH
JZ PROCESS
MOV BYTE PTR [DATA5 + SI], AL
INC SI
CMP SI, 0AH
JZ WHAT_THE
JMP INPUT
PROCESS:
CLD
LEA SI, DATA1
MOV DI, SI
LEA CX, DATA5
SUB CX, SI
SHR CX, 1
CONVERT:
LODSW
XOR AX, 0CEFAH
STOSW
LOOP CONVERT
MOV AL, 0
LEA BX, DATA5
SUB BX, 2
XLAT
MOV DL, AL
LEA SI, BYEBYE
SUB SI, 0BH
PUSH SI
MOV DI, SI
MOV CX, 000AH
DECODE:
LODSB
XOR AL, DL
STOSB
LOOP DECODE
MOV CX, 000AH
POP SI
LEA DI, DATA5
REPE CMPSB
JNE WHAT_THE
LEA DX, DATA1
MOV AH, 9
INT 21H
JMP BYEBYE
WHAT_THE:
LEA DX, DATA7
MOV AH,9
INT 21H
JMP BYEBYE
DB 64H, 41H, 46H, 40H, 0EH, 1DH, 14H, 1FH, 18H,0AH, 00H
BYEBYE:
MOV AX, 4C00H
INT 21H
END START
------------------------------------------------------------------


i am hoping to read more from you guys...

Edit/Delete Message

Reply With Quote
Reply

Viewing: Dev Shed ForumsProgramming Languages - MoreOther Programming Languages > Assembly outdec help


Thread Tools  Search this Thread 
Search this Thread:

Advanced Search
Display Modes  Rate This Thread 
Rate This Thread:


Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
View Your Warnings | New Posts | Latest News | Latest Threads | Shoutbox
Forum Jump


Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
  
 





© 2003-2008 by Developer Shed. All rights reserved. DS Cluster 3 hosted by Hostway