Lost Password?

Go Back   CodeCall Programming Forum > Software Development > General Programming

General Programming Non language specific, Assembly, Linux/Unix, Mac and anything not covered in other topics. Talk about Programming Theory here.

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1 (permalink)  
Old 12-09-2007, 05:26 PM
BamaBUB1983 BamaBUB1983 is offline
Newbie
 
Join Date: Dec 2007
Posts: 2
Rep Power: 0
BamaBUB1983 is on a distinguished road
Default 8086 Assembler HELP

I am currently attempting to learn the 8086 Assembler. This is a Lab that I am having problems with. Could someone please help?

Write complete programs for the following problems.

1. Place any binary number is register DX and count the number of binary ones in the number in DX in register AL.

For example, the binary number 3F62h contains nine binary ones. Include a flowchart
describing the program.

2. Write a program that takes the smaller of two words stored in memory locations DS:1234h and DS:5678h and store in register AX.

4. Add together all of the 2-word numbers that are stored from address 6000h to 60FFFh in memory. Store the sum starting at location
61020h. Each 2-word number may range in size from 00000000h to FFFFFFFFh. State your assumptions as to how the words for each number are stored in memory and how large the final sum can be.
Include a flowchart clearly describing your solution.

5. Count the number of bytes located in memory from DS:1000h to DS:1200h that are greater than 77h. Place the count on register CX.
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote

Sponsored Links
  #2 (permalink)  
Old 12-09-2007, 05:34 PM
John's Avatar   
John John is offline
Co-Administrator
 
Join Date: Jul 2006
Age: 19
Posts: 2,731
Last Blog:
Passwords
Rep Power: 20
John has much to be proud ofJohn has much to be proud ofJohn has much to be proud ofJohn has much to be proud ofJohn has much to be proud ofJohn has much to be proud ofJohn has much to be proud ofJohn has much to be proud ofJohn has much to be proud of
Send a message via AIM to John
Default

Care to show us what you have attempted?
__________________
CodeCall Blog | CodeCall Wiki | Shareware | Linux Forum | My Blog
Chat with other CodeCall members on IRC; connect to irc.codecall.net and join #codecall
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
  #3 (permalink)  
Old 12-11-2007, 04:12 PM
G_Morgan G_Morgan is offline
Guru
 
Join Date: Oct 2007
Age: 24
Posts: 408
Rep Power: 8
G_Morgan has a spectacular aura aboutG_Morgan has a spectacular aura aboutG_Morgan has a spectacular aura about
Default

I'd do this backwards. Write down your flowchart or pseudo code and then hand compile it, line by line. Far easier than trying to handle assembly by hand with no clear picture of how your code will work.
__________________
Currently bemused by: LLVM.
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
  #4 (permalink)  
Old 12-12-2007, 09:11 PM
BamaBUB1983 BamaBUB1983 is offline
Newbie
 
Join Date: Dec 2007
Posts: 2
Rep Power: 0
BamaBUB1983 is on a distinguished road
Default Just Learning

THis is what I came up with but having major problems with it. Any inputs??

1.)
code segment
starthere:
mov dx, al
mov al, 000fh
rcl al, 1
rcl al, 1
rcl al, 1
rcl al, 1
mov al, dx
code ends

2.)
code segment
starthere:
mov ds, [1234h]
mov w[s], ax
mov ds, [5678h]
mov w[s], ax
code ends

3.)
code segment ;
starthere:
mov ax, 6000h
mov ds, ax
mov al, [03h]
mov al, [0ch]
mov [20h], al
mov al, [04h]
adc al, [0dh]
mov [21h], al
mov al, [05h]
adc al, [0eh]
mov [22h], al
mov al, 00h
adc al, 00h
mov [23h], al
jmp starthere
code ends




4.)
code segment
starthere:
mov ax, [6000h]
adc w[2], ax
mov 61020h, ax
code ends

5.)
code segment
mov ax, [1000h]
starthere:
rcr ax, 01h
jg great, 77h
mov cx, ax
great:
nop
code ends
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
Reply



Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 
Thread Tools Search this Thread
Search this Thread:

Advanced Search
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
Trackbacks are On
Pingbacks are On
Refbacks are On

Similar Threads
Thread Thread Starter Forum Replies Last Post
new C-like programming language kenna Software Development Tools 14 Yesterday 02:34 PM
Clear Window in 8086 Assembler, no Ints omniscian General Programming 1 02-25-2008 09:58 PM
Problems Using Assembler In C++ dargueta C and C++ 8 10-15-2007 08:48 PM


All times are GMT -5. The time now is 11:59 PM.

Contest Stats

John ........ 223.00000
dargueta ........ 168.00000
Xav ........ 164.00000
LogicKills ........ 20.00000
gaylo565 ........ 18.00000
WingedPanther ........ 15.00000
|pH| ........ 15.00000
Johnnyboy ........ 3.00000
navghost ........ 1.00000

Contest Rules

CodeCall Goal

Goal: 100,000 Posts
Complete: 67%

Ads