Jump to content

Assembly language help

mikeeginger
Go to solution Solved by jam08060,

So with assembler you are directly manipulating memory, so with the code above you are worried about the data being stored in accumulator AL.  This is because your OUT function takes the value of AL and sends it to the traffic lights.

 

So, with that said... All your code above is doing is storing new decimal values (55, 56, 57, 58, 60, 65) into the accumulator AL and transmitting each of those values to the traffic light.

 

From your code and the hardware you would be working with I'm not entirely sure what AA is, but it doesn't really seem to matter as it is only ever resetting the value inside AL and then being transmitted to the traffic lights, so i'd assume its probably a memory location (accumulator / register) that stores a reset or value that represents an off state... just a guess...

 

So the main thing you need to worry about is what values you will be storing in accumulator AL to then send using the OUT instruction to the traffic lights.

 

This should get you started, although it is a bit tricky to really give you a definitive guide without more context...

 

Hope this helps!

For part of my college  course I have to do some assembly language programming
how ever I am finding it hard to under stand how the changes i make relate to the program
I am trying to write  which is to control a set of traffic lets in a virtual environment
 
are they any good guides or can some one help explain how to work out how
the numbers i put in relate to lights turning on or not
 
the program I have written pasted below in plain text

the assembler i am using is sms32V5

 

 

Start:

 

MOV AL,55 ; 01010101

OUT 01 ; Send the data in AL to Port 01 (the traffic lights)

MOV AL,AA ; 10101010

OUT 01 ; Send the data in AL to Port 01 (the traffic lights)

 

MOV AL,56

OUT     01

MOV AL,AA

OUT 01

 

MOV AL,57

OUT 01

MOV Al,AA

OUT 01

 

MOV  AL,58

OUT 01

MOV AL,AA

OUT 01

 

MOV AL,60

OUT 01

MOV AL,AA

OUT 01

 

MOV  AL,65

OUT 01

 

MOV AL,AC

OUT 01

MOV Al,AC

 

 

IntelCorei54670k,Maximus VI Formula,Swift tech H220, 16gigs Corsair Dominator platinums, Asus DCUII GTX 780,1x256 840 evo, 1x 2TB Segate barracuda, Corsair AX 860, 

3 X Noctua NF-F12, 2x Noctua NF A-14, Ducky Shine 3 Blue Leds Blue switches, Razer Death Adder 2012, Corsair vengence 1400  

Link to comment
Share on other sites

Link to post
Share on other sites

I don't see anything attached?

 

I just took an assembly class so I am no expert, but I did get an 'A' and can try to help.

SSD Firmware Engineer

 

| Dual Boot Linux Mint and W8.1 Pro x64 with rEFInd Boot Manager | Intel Core i7-4770k | Corsair H100i | ASRock Z87 Extreme4 | 32 GB (4x8gb) 1600MHz CL8 | EVGA GTX970 FTW+ | EVGA SuperNOVA 1000 P2 | 500GB Samsung 850 Evo |250GB Samsung 840 Evo | 3x1Tb HDD | 4 LG UH12NS30 BD Drives | LSI HBA | Corsair Carbide 500R Case | Das Keyboard 4 Ultimate | Logitech M510 Mouse | Corsair Vengeance 2100 Wireless Headset | 4 Monoprice Displays - 3x27"4k bottom, 27" 1440p top | Logitech Z-2300 Speakers |

Link to comment
Share on other sites

Link to post
Share on other sites

I don't see anything attached?

 

I just took an assembly class so I am no expert, but I did get an 'A' and can try to help.

Sorry i thought i attached the file the code is posted in plain text

IntelCorei54670k,Maximus VI Formula,Swift tech H220, 16gigs Corsair Dominator platinums, Asus DCUII GTX 780,1x256 840 evo, 1x 2TB Segate barracuda, Corsair AX 860, 

3 X Noctua NF-F12, 2x Noctua NF A-14, Ducky Shine 3 Blue Leds Blue switches, Razer Death Adder 2012, Corsair vengence 1400  

Link to comment
Share on other sites

Link to post
Share on other sites

The tricky skill that you will need programming in any language and is especially hard to have with assembly is the ability to think of your program in a much higher and more abstract level then your code. For example in this program you could simply think of it as what light you are trying to turn on or off at a given moment. When you understand the problem you are trying to solve then it becomes much easier to work with the code and if done well can make the code feel too easy.

My rig: 2600k(4.2 GHz) w/ Cooler Master hyper 212+, Gigabyte Z68-UD3H-B3, Powercolor 7870 xt(1100/1500) w/AIO mod,

8GB DDR3 1600, 120GB Kingston HyperX 3K SSD, 1TB Seagate, Antec earthwatts 430, NZXT H2

Verified max overclock, just for kicks: http://valid.canardpc.com/show_oc.php?id=2609399

Link to comment
Share on other sites

Link to post
Share on other sites

So with assembler you are directly manipulating memory, so with the code above you are worried about the data being stored in accumulator AL.  This is because your OUT function takes the value of AL and sends it to the traffic lights.

 

So, with that said... All your code above is doing is storing new decimal values (55, 56, 57, 58, 60, 65) into the accumulator AL and transmitting each of those values to the traffic light.

 

From your code and the hardware you would be working with I'm not entirely sure what AA is, but it doesn't really seem to matter as it is only ever resetting the value inside AL and then being transmitted to the traffic lights, so i'd assume its probably a memory location (accumulator / register) that stores a reset or value that represents an off state... just a guess...

 

So the main thing you need to worry about is what values you will be storing in accumulator AL to then send using the OUT instruction to the traffic lights.

 

This should get you started, although it is a bit tricky to really give you a definitive guide without more context...

 

Hope this helps!

Link to comment
Share on other sites

Link to post
Share on other sites

  • 2 weeks later...

Thank you to all for the help

 

Manged to sort out the problem by finding a conversion table and using notes I had

 

ps how do i close the thread?

IntelCorei54670k,Maximus VI Formula,Swift tech H220, 16gigs Corsair Dominator platinums, Asus DCUII GTX 780,1x256 840 evo, 1x 2TB Segate barracuda, Corsair AX 860, 

3 X Noctua NF-F12, 2x Noctua NF A-14, Ducky Shine 3 Blue Leds Blue switches, Razer Death Adder 2012, Corsair vengence 1400  

Link to comment
Share on other sites

Link to post
Share on other sites

You don't, you let the thread sink into oblivion. 

 

(Could also select Best answer and leave it at that). 

Interested in Linux, SteamOS and Open-source applications? Go here

Gaming Rig - CPU: i5 3570k @ Stock | GPU: EVGA Geforce 560Ti 448 Core Classified Ultra | RAM: Mushkin Enhanced Blackline 8GB DDR3 1600 | SSD: Crucial M4 128GB | HDD: 3TB Seagate Barracuda, 1TB WD Caviar Black, 1TB Seagate Barracuda | Case: Antec Lanboy Air | KB: Corsair Vengeance K70 Cherry MX Blue | Mouse: Corsair Vengeance M95 | Headset: Steelseries Siberia V2

 

 

Link to comment
Share on other sites

Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

×