|
||||||
| General Programming Non language specific, Assembly, Linux/Unix, Mac and anything not covered in other topics. Talk about Programming Theory here. |
![]() |
|
|
LinkBack | Thread Tools | Search this Thread | Display Modes |
|
|||
|
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. |
| Sponsored Links |
|
|
|
|||||
|
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 |
|
|||
|
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. |
|
|||
|
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 |
![]() |
| Currently Active Users Viewing This Thread: 1 (0 members and 1 guests) | |
| Thread Tools | Search this Thread |
| Display Modes | |
|
|
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 |
| 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 |
Goal: 100,000 Posts
Complete: 67%