Overclock.net › Forums › Software, Programming and Coding › Coding and Programming › Assembly Language noob here
New Posts  All Forums:Forum Nav:

Assembly Language noob here

post #1 of 6
Thread Starter 
I have a question about a program for assembly language

i saw this problem and i dont know how to go about starting it and i also cant get the assembly language to run in visual studio

here is the problem
Quote:
Write an assembly language program fragment to copy higher-order 4 bits from the AL register and lower-order 4 bits from the AH register into the DL register. Use only logical instructions.
The Prodigy
(16 items)
 
 
Dream Rig Contest
(11 items)
 
CPUMotherboardGraphicsRAM
[AMD] Athlon II x2 255 [Gigabyte] GA-78LMT-SP2 [Onboard] ATI Radeon 3000 [Crucial] Ballistix 8GB (2x4GB) 
Hard DriveHard DriveHard DriveOptical Drive
[Western Digital] Blue 320GB [Maxtor] 320GB soon to be adding 4TB from WD Red [Lite-On] DVD Player/Burner 
CoolingOS
[Stock] [Mircrosoft] Windows 7/ Home server 2011 
  hide details  
Reply
The Prodigy
(16 items)
 
 
Dream Rig Contest
(11 items)
 
CPUMotherboardGraphicsRAM
[AMD] Athlon II x2 255 [Gigabyte] GA-78LMT-SP2 [Onboard] ATI Radeon 3000 [Crucial] Ballistix 8GB (2x4GB) 
Hard DriveHard DriveHard DriveOptical Drive
[Western Digital] Blue 320GB [Maxtor] 320GB soon to be adding 4TB from WD Red [Lite-On] DVD Player/Burner 
CoolingOS
[Stock] [Mircrosoft] Windows 7/ Home server 2011 
  hide details  
Reply
post #2 of 6
To my knowledge Visual Studio doesn't support writing assembly. You'll probably have to download an assembler, I use Yasm.
Edited by lin2dev - 12/4/12 at 5:35pm
SolusIgnis
(21 items)
 
2 Watts
(6 items)
 
Huh?!
(13 items)
 
CPUCPUCPUMotherboard
i7-3820 Xeon Phi 31S1P Copressor (WIP) Xeon Phi 31S1P Copressor (WIP) ASRock X79 Extreme6 
GraphicsRAMHard DriveCooling
XFX Reference 6950 Samsung Magic RAM Crucial M4 Cosair H80 
OSMonitorMonitorMonitor
Windows 8.1 Pro HannSpree HF205 1600x900 ASUS VH239H 1920x1080 ASUS VH239H 1920x1080 
KeyboardCaseMouseMouse Pad
CMStorm Quick Fire Pro, Cherry MX Blue Thermaltake Oversoar RX-I MadCatz RAT 9 Saitek Cyborg V.5 
OtherOtherOther
Thrustmaster HOTAS Warthog TrackIR 5 Saitek Pro Combat Pedals 
CPUMotherboardRAMHard Drive
Marvell PXA510 D2Plug DDR3 
Optical DriveCooling
Pssh! Who needs optical drives Passive 
CPUOS
i386 MS-DOS 
  hide details  
Reply
SolusIgnis
(21 items)
 
2 Watts
(6 items)
 
Huh?!
(13 items)
 
CPUCPUCPUMotherboard
i7-3820 Xeon Phi 31S1P Copressor (WIP) Xeon Phi 31S1P Copressor (WIP) ASRock X79 Extreme6 
GraphicsRAMHard DriveCooling
XFX Reference 6950 Samsung Magic RAM Crucial M4 Cosair H80 
OSMonitorMonitorMonitor
Windows 8.1 Pro HannSpree HF205 1600x900 ASUS VH239H 1920x1080 ASUS VH239H 1920x1080 
KeyboardCaseMouseMouse Pad
CMStorm Quick Fire Pro, Cherry MX Blue Thermaltake Oversoar RX-I MadCatz RAT 9 Saitek Cyborg V.5 
OtherOtherOther
Thrustmaster HOTAS Warthog TrackIR 5 Saitek Pro Combat Pedals 
CPUMotherboardRAMHard Drive
Marvell PXA510 D2Plug DDR3 
Optical DriveCooling
Pssh! Who needs optical drives Passive 
CPUOS
i386 MS-DOS 
  hide details  
Reply
post #3 of 6
You want the logic to write the program or to run assembly language in Visual Studio??
post #4 of 6
Thread Starter 
Actually I need both
The Prodigy
(16 items)
 
 
Dream Rig Contest
(11 items)
 
CPUMotherboardGraphicsRAM
[AMD] Athlon II x2 255 [Gigabyte] GA-78LMT-SP2 [Onboard] ATI Radeon 3000 [Crucial] Ballistix 8GB (2x4GB) 
Hard DriveHard DriveHard DriveOptical Drive
[Western Digital] Blue 320GB [Maxtor] 320GB soon to be adding 4TB from WD Red [Lite-On] DVD Player/Burner 
CoolingOS
[Stock] [Mircrosoft] Windows 7/ Home server 2011 
  hide details  
Reply
The Prodigy
(16 items)
 
 
Dream Rig Contest
(11 items)
 
CPUMotherboardGraphicsRAM
[AMD] Athlon II x2 255 [Gigabyte] GA-78LMT-SP2 [Onboard] ATI Radeon 3000 [Crucial] Ballistix 8GB (2x4GB) 
Hard DriveHard DriveHard DriveOptical Drive
[Western Digital] Blue 320GB [Maxtor] 320GB soon to be adding 4TB from WD Red [Lite-On] DVD Player/Burner 
CoolingOS
[Stock] [Mircrosoft] Windows 7/ Home server 2011 
  hide details  
Reply
post #5 of 6
Quote:
Originally Posted by Hartk1213 View Post

I have a question about a program for assembly language
i saw this problem and i dont know how to go about starting it and i also cant get the assembly language to run in visual studio
here is the problem


Write an assembly language program fragment to copy higher-order 4 bits from the AL register and lower-order 4 bits from the AH register into the DL register. Use only logical instructions.
Well, I am not sure what you are asking... Where do you want the higher 4 bits


Wouldn't it just be?

mov dl, 0 ;clearing the DL register
shr al, 4 ;to clear the lower 4 bits of the AL register
shl al, 4 ;moving everything back

shl ah,4 ;to clear the lower 4 bits of the AH register
shr ah,4 ;moving everything back

mov dl,ah ;moving the lower 4 bits into DL
add dl, al ; adding the higher 4 bits into DL



By shifting the bits left and right, they are pushing them out of the register, and the new spaces are being filled with 0 when it is moved back into place.
Then the last part, you move the lower 4 bits into the register, and you can add the higher ones to it, or vice versa.


Enjoy!


I found this awesome little programming community for me to join. biggrin.gif It's nice because it is a ton bit smaller than Dream.in.code, and Stack Overflow, and it still is full of brilliant people!
The Green Hornet
(16 items)
 
  
CPUMotherboardGraphicsRAM
Intel i7 4930k Asus X79 Rampage IV Gene EVGA GTX 1080 4X Corsair Vengeance 8GB RAM Modules 
Hard DriveHard DriveHard DriveCooling
2 TB Seagate Green HDD Samsung 840 Pro OCZ Vertex 4  Custom Watercooling Loop 
OSMonitorKeyboardPower
Windows 10 Acer 28" 4K Display Magicforce 68 Corsair AX860 
CaseMouseMouse PadAudio
Corsair Carbide Air 240 Logitech G500 Black Mousepad Logitech G933 
  hide details  
Reply
The Green Hornet
(16 items)
 
  
CPUMotherboardGraphicsRAM
Intel i7 4930k Asus X79 Rampage IV Gene EVGA GTX 1080 4X Corsair Vengeance 8GB RAM Modules 
Hard DriveHard DriveHard DriveCooling
2 TB Seagate Green HDD Samsung 840 Pro OCZ Vertex 4  Custom Watercooling Loop 
OSMonitorKeyboardPower
Windows 10 Acer 28" 4K Display Magicforce 68 Corsair AX860 
CaseMouseMouse PadAudio
Corsair Carbide Air 240 Logitech G500 Black Mousepad Logitech G933 
  hide details  
Reply
post #6 of 6
I hope I wasn't too late.
Oh yeah! I forgot!

Here is some help setting up Visual Studio 2010 for MASM Here.

Also, I attached a Template MASM file that you can use. Don't forget to import libraries if you need to to so. OCNTemplate.zip 0k .zip file
The Green Hornet
(16 items)
 
  
CPUMotherboardGraphicsRAM
Intel i7 4930k Asus X79 Rampage IV Gene EVGA GTX 1080 4X Corsair Vengeance 8GB RAM Modules 
Hard DriveHard DriveHard DriveCooling
2 TB Seagate Green HDD Samsung 840 Pro OCZ Vertex 4  Custom Watercooling Loop 
OSMonitorKeyboardPower
Windows 10 Acer 28" 4K Display Magicforce 68 Corsair AX860 
CaseMouseMouse PadAudio
Corsair Carbide Air 240 Logitech G500 Black Mousepad Logitech G933 
  hide details  
Reply
The Green Hornet
(16 items)
 
  
CPUMotherboardGraphicsRAM
Intel i7 4930k Asus X79 Rampage IV Gene EVGA GTX 1080 4X Corsair Vengeance 8GB RAM Modules 
Hard DriveHard DriveHard DriveCooling
2 TB Seagate Green HDD Samsung 840 Pro OCZ Vertex 4  Custom Watercooling Loop 
OSMonitorKeyboardPower
Windows 10 Acer 28" 4K Display Magicforce 68 Corsair AX860 
CaseMouseMouse PadAudio
Corsair Carbide Air 240 Logitech G500 Black Mousepad Logitech G933 
  hide details  
Reply
New Posts  All Forums:Forum Nav:
  Return Home
  Back to Forum: Coding and Programming
Overclock.net › Forums › Software, Programming and Coding › Coding and Programming › Assembly Language noob here