Programming Forums
User Name Password Register
 

RSS Feed
FORUM INDEX | TODAY'S POSTS | UNANSWERED THREADS | ADVANCED SEARCH

 
 
Thread Tools Display Modes
Prev Previous Post in Thread   Next Post in Thread Next
Old Mar 11th, 2005, 1:37 AM   #1
liquidsilver
Newbie
 
liquidsilver's Avatar
 
Join Date: Mar 2005
Location: South Africa
Posts: 21
Rep Power: 0 liquidsilver is on a distinguished road
Post Self Modifying Code

I've just recently started with SMC (Self Modifying Code) and I'm having some problems:

.model tiny
.stack
.data
  key db 01h
.code
org 0100h

mov cx,3
StrLoop:
  dec cx
  mov di,(offset fix)
  add di,cx
  mov al,[di]
  xor al,key
  mov [di],al
  jcxz OutLoop
  jmp StrLoop
OutLoop:

fix db 0B9h, 036h, 003h ;mov ax,0237h
  ret
end main

This is my SMC.COM source. This works, but when I convert it to a EXE then it goes haywire. The correct data seems to not get targeted. I use MASM, please help.
__________________
Small is beautiful
liquidsilver is offline   Reply With Quote
 

Bookmarks

« Previous Thread in Forum | Next Thread in Forum »

Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 
Thread Tools
Display Modes

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

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Forum Jump




DaniWeb IT Discussion Community
All times are GMT -5. The time now is 4:00 PM.

Powered by vBulletin® Version 3.7.0, Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.
Copyright ©2007 DaniWeb® LLC