Programming Forums
User Name Password Register
 

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

Reply
 
Thread Tools Display Modes
Old Jul 26th, 2007, 7:35 AM   #11
blitzmage_89
Newbie
 
Join Date: Jul 2007
Posts: 4
Rep Power: 0 blitzmage_89 is on a distinguished road
aaaawww i'm confused . my professor doesn't teach well , when he teaches it's just like reading a book aka book smart and no evident work experience. He never gives a sample exercise beforehand yet expects us to produce something like this. DaWei if only professors in our university have the same work experience as you, college life would be different. Some of them are only in their twenties and most doesnt even have a masters degree yet and they're teaching at the Philippine's number one private university! can u believe that.

back to the subject : yes I'm using the TASM 8088Emulator. the thing is , I really dont have a clue on how to transfer a value from memory to a register given only the effective address which is CX. Ive been reading the book and i can't really understand it.
blitzmage_89 is offline   Reply With Quote
Old Jul 26th, 2007, 9:53 AM   #12
DaWei
Resident Grouch
 
DaWei's Avatar
 
Join Date: Jun 2005
Posts: 6,453
Rep Power: 10 DaWei is on a distinguished road
At a certain level, students are expected to be able to learn from the materials with only a little guidance. If your professor is not doing his part of the job, then look for tutorials. Play with your emulator. Read about the OPERATION of the micro, not just its instruction set. You have to know how the beastie works, and they don't all work in precisely the same ways.

Some registers may be special purpose, others may be multipurpose. Read.

CX is not an index register. If CX holds the effective address, then put it into an index register and use it. Suppose we want to get the value at address 1000 into register AX. If CX holds the value, 1000, then we can move that value to BP (an index register) and load AX indirectly, using BP, an index register. See the following screenshot, captured in debug.

The first command displays the registers.

The second command displays a little data beginning at 1000. Note the value at 1000 is C7 06. Because this is a little endian machine, that is 06C7 hex.

The third command gets me into assembly mode.
...The first instruction I use is to get the 1000 (EA) into CX
...(since it's not already there)
...The second instruction moves that to BP, an index register
...The third instruction moves the contents POINTED TO by BP to AX

The T commands execute these instructions one at a time, displaying the registers at each step.

Note that CX has gone from 0000 to 1000.
Note that BP has gone from 0000 to 1000.
Note that AX has gone from 0000 to 06C7.

__________________
Abstraction doesn't make it impossible to write bad code; it makes it possible to write superior code.
Contributor's Corner: Grumpy on C++ Exceptions DaWei on Pointers
DaWei is offline   Reply With Quote
Reply

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

Similar Threads
Thread Thread Starter Forum Replies Last Post
Assembly Language DaWei Coder's Corner Lounge 0 Apr 26th, 2007 10:15 PM
management system problem l2u C# 4 Mar 19th, 2007 2:30 PM
Assembly, Assembler? v0id Assembly 15 May 4th, 2006 8:52 AM
Assembly without a compiler grimpirate Assembly 16 Sep 8th, 2005 6:07 AM
SPIM Assembly Programming Simulation Problem tsgrimey Assembly 1 Feb 9th, 2005 2:21 AM




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

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