Cheat Engine Forum Index Cheat Engine
The Official Site of Cheat Engine
 
 FAQFAQ   SearchSearch   MemberlistMemberlist   UsergroupsUsergroups   RegisterRegister 
 ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 


Assembly Help

 
Post new topic   Reply to topic    Cheat Engine Forum Index -> General programming
View previous topic :: View next topic  
Author Message
mickym2005
How do I cheat?
Reputation: 0

Joined: 13 Oct 2007
Posts: 8

PostPosted: Mon Mar 16, 2009 11:32 am    Post subject: Assembly Help Reply with quote

I'm still learning about Assembly language and I don't understand how to output an answer.

similar to the problem I'm using.

int Year=2004, R2D2; R2D2 is memory
Year++
R2D2=36 + Year - 2000 + (Year * 3 )% 7
Output R2D2


i have to translate that into Assembly and then output it.

Quote:

.model small
.stack 100h
.data
message db "Hello, world!" ,0dh,0ah, '$'

Year dw 2004
R2D2 dw ?


.code
main proc
mov ax,@data
mov ds, ax

; mult year by 3 (ax: 177F) x
mov dx,Year
inc dx
mov ax,3
mul dx

; (year * 3) % 7 (cx: 2) x
mov bx,7
idiv bx
mov cx,dx

; Add 36 + year (bx: 7F9) x
mov ax,36
mov bx,year
inc bx
add bx,ax

; sub 2000 from (36 + year) (Dx) (= 29)
mov ax,2000
sub bx,ax

; 36+year-2000+(year * 3) % 7 (BX 2B)
add bx,cx

; R2D2 (A: 2B)
mov R2D2, bx


mov ax,4C00h
int 21h
main endp
end main



the Answer i get is 2B, but I'm not sure how to output it.
any help is appreciated.
Back to top
View user's profile Send private message
Display posts from previous:   
Post new topic   Reply to topic    Cheat Engine Forum Index -> General programming All times are GMT - 6 Hours
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum
You cannot attach files in this forum
You can download files in this forum


Powered by phpBB © 2001, 2005 phpBB Group

CE Wiki   IRC (#CEF)   Twitter
Third party websites